Need help on voltage measurement

04 Mar 2011

Hello, can anyone help me on voltage measurement by using mbed? I am using L298 to drive a motor and I am trying to measure the voltage of the motor. When I use multimeter to check the voltage drop on the motor is 3.2V and but the result I got from mbed is not the same. The following pictures are my program and also my results. Thanks

Ken

/media/uploads/ongchouzhien/voltage.jpg /media/uploads/ongchouzhien/result.jpg

04 Mar 2011

A wiring diagram would be helpful.

Otherwise we're just guessing.

For example: maybe you have hooked p18 to the L298 output pin that is being driven low. Then 0.7 volts would make sense...

04 Mar 2011

Can you show your schematics?

04 Mar 2011

/media/uploads/ongchouzhien/schematic2.jpg

Hi Hexley and Igor,

Does this diagram helps you to understand my circuit?

Thanks for your reply.

Ken

04 Mar 2011

Yes, that helps.

The voltage that you are measuring will be equal to (Motor_Current_in_Amps * 1 ohm) + (Saturation_voltage_L298). So 0.7 volts seems reasonable if your motor isn't drawing much current.

If you want the voltage across the motor, you would have to measure the voltage at pin 14 of the L298, and subtract the voltage you are reading now.

But this must be done carefully, as pin 14 will be pulling up to +Vs, which is above 3.3 volts. So you would need a resistor network to scale it down to below 3.3 volts, so the ADC does not saturate at full scale. (Then take that scale factor into account when you calculate the differential voltage, of course.)

05 Mar 2011

Thanks for your reply. I will try it on Monday.

Ken

06 Mar 2011

What do you want to measure? The driver is an H bridge designed for PWM control. The voltage on the output is either very low, close to the supply or some floating value depending on the motor and the voltage at the other terminal. BTW, the L298 needs protection diodes (2 per output). So the voltage across the motor in PWM mode is a complex waveform, your voltmeter only shows an average. When you want to measure this with the ADC you should measure both terminals and do a lot of filtering (averaging), either analog or digital. Voltages on motors can become very high (when you switch of the current), therefore you need the diodes and always use an RC network to your ADC input or you will damage the MBED.

11 Mar 2011

Sorry for this late reply. Thanks for you all, it's working now.

Regards Ken

05 Jul 2012