Submitted by proty on Mon, 04/04/2011 - 12:01
Posted in
Hello. I have created my own motion control unit. I use an arduino and a l298 driver to control my motor. I have a 12v battery to feed the system.
My problem is that when I put the control pin at 255 value (maximun value), the output to the motor is 10v but no 12v as I spect. When I put the control pin to 130 (the medium value) the output is 6v, but when I put the value to 129 or less the output voltage is 1v. It's not proporcional to the value of muy control pin.
Do anyone knows something about that?
Sorry about my bad english and thanks for this fantastic forum.

Proty, When you speak of "put
Proty,
When you speak of "put the control pin at 255 value," I'm presuming that you're talking about using PWM control, which is Pulse Width Modulation.
e.g.:
Alas, you're not actually writing an analog value. Instead, you're controlling the parameters for a Pulse-Width-Modulated signal which, in turn, causes the driver to create a related PWM signal. I hate to not completely answer your question and instead send you a primer on PWM, so I'm going to give a short answer and then let another resource give you more detailed info =)
Short answer:
The output pin is not putting out -any- of those voltages. It is putting out 12V and 0V. However, it is putting out that 12V for very brief periods of time, much faster than your voltmeter can register, so the voltmeter is averaging the result of the PWM signal.
Now, as to why your 255 value, which should be '100% 12V and 0% 0V' does not result in a similar output from the L298? That's a more difficult question, whose answer would require, at a minimum, the details of your circuit.
Obviously, wikipedia has a great article on PWM in general: http://en.wikipedia.org/wiki/Pulse-width_modulation
The reason why your readings are non-linear is the voltmeter its self. Use an oscilloscope instead to see the actual PWM waveform, rather than the black magic of the physical properties of your voltmeter that impact its buffering! =)
!c