# PWM to DC converter.

Discussion in 'Robotics & Mechatronics' started by kaarvannan, Dec 11, 2011.

Joined:
Dec 11, 2011
Messages:
27
Likes:
0
2. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
You can calculate the ripple current with the formula (approximation):

Iripple = Vcc / (2 * Fpwm * (Lm + Lc))

Where:
Iripple = ripple current amplitude.
Vcc = supply voltage.
Fpwm = pwm frequency.
Lm = motor inductance.
Lc = choke inductance.

Choke inductance is an additional inductor in series with the motor.

You don't need capacitors near the motor, but you need them near the control electronics (across supply voltage). Also use twisted wires to the motor.

Last edited: Dec 12, 2011

Joined:
Jul 27, 2009
Messages:
60
Likes:
4

Joined:
Jan 12, 1997
Messages:
-
Likes:
0

5. ### pilkoMember

Joined:
Jul 27, 2009
Messages:
60
Likes:
4

@ misterT,--- If you remove the capacitor near the motor you will get this:-

File size:
175.5 KB
Views:
154
6. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
Well.. voltage across 12 ohm resistor has little to do with current through a dc motor.

Last edited: Dec 12, 2011
7. ### kaarvannanNew Member

Joined:
Dec 11, 2011
Messages:
27
Likes:
0
I tried the circuit with my motor controller and a O-scope. using a 16u inductance does not smooth the square wave, so i kept increasing the inductance. I got a nice smooth linear voltage with 100u inductance. However, if i try to run the motor at higher speeds, the motor controller shuts down. Could someone explain the reasoning behind this please.

8. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
Which circuit did you try? Is the motor controller a home-build h-bridge, IC-circuit, or a commercial controller? What was the pwm frequency and duty, when you tried to run at higher speeds? what was the frequency and duty when the motor was working as expected?

9. ### kaarvannanNew Member

Joined:
Dec 11, 2011
Messages:
27
Likes:
0
I tried the circuit in post#11. Its a commercially available controller. PWM freq in constant at 20KHz. I am not sure about the duty cycles. It works fine, when the load current is less than 1.4 amps(the motors is rated at 3 amps) anything above that and the controller shuts down (with a clicking sound).

10. ### pilkoMember

Joined:
Jul 27, 2009
Messages:
60
Likes:
4
Thanks misterT,

@ kaavanaan, ---- I'm going to leave you in misterT's and others' more capable hands.

regards

pilko

11. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
Can you post the model of the controller? Maybe I can find a manual or datasheet online? Sounds like that the controller has some kind of internal over-current limit. Anyway. I think all you need as a filter is a big enough inductor (5 mH).. maybe small ceramic capacitors across the motor connectors.

Last edited: Dec 13, 2011
12. ### kaarvannanNew Member

Joined:
Dec 11, 2011
Messages:
27
Likes:
0
I played around by changing the inductance and the capacitance in the circuit and I get a nice linear output (which i see in the oscilloscope). But it still doesn't work for me because the whole point of doing this conversion from PWM to Linear is to eliminate the noise the PWM signal induces into a nearby cable carrying some sensor data. I still have the noise in the sensor cable. And I know for sure, its from the motor controller because I tried a different motor controller that does not use a PWM signal and there is no noise.
So my guess is that, though i am seeing a nice liner output on my O-scope there is still enough fluctuation there to induce noise into the sensor cable. Do to fix this?

13. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
What kind of inductor did you use and where did you place it? Inductors are good antennas.. they radiate and receive em-noise very well. Use toroidal inductor close to the controller and away from the sensor cable. Twist the motor cables together very thight and place them away from the sensor cable. If you can, increase the PWM frequency. DC-Electric motors also create a lot of noise (due to commutation).

Best solution would be to use shielded cable for the sensor. Maybe even a differential signal, if possible.

Are the sensor and motor-controller connected to the same power supply? If they are, that migh also be a problem. You need filters and snubbers for the power-supply also.

Could you draw a simple diagram how the system is connected?

Last edited: Dec 13, 2011
14. ### kaarvannanNew Member

Joined:
Dec 11, 2011
Messages:
27
Likes:
0
I have attached a rough schematic of my setup here. The motor controller and the inductor are pretty far from the sensor cable. They should not be a source of the noise. If i remove the sensor cable from the 25ft tube, there is no noise. But I HAVE to keep all the cables inside the tube. If i use a linear motor controller that does not use PWM signal all together, there is no noise even with the sensor cable inside the 25ft tube.

File size:
82.2 KB
Views:
138
15. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
That can be a tricky one to solve. PWM controller does create a lot of noise. I doubt that you can solve this one with a filter on the motor wires. Try some of the things I suggested in previous post.. mainly twisting the motor cables and using shielded cable for the sensor (or motor).
What kind of sensor is it?

Last edited: Dec 13, 2011
16. ### kaarvannanNew Member

Joined:
Dec 11, 2011
Messages:
27
Likes:
0
As I mentioned before, I can not change the cables. The one thing I dont understand is that, there is no noise when using a linear motor controller. So, i assume there should be no noise once I change my PWM signal to a linear DC signal. I also get a pretty good DC signal.( I have attached the image of the circuit and the linear DC signal I get) the peak to peak voltage in the linear DC signal is thus 2V, could this be the reason for the noise?

File size:
18.4 KB
Views:
137
17. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
Could you measure the current in the wires?

18. ### kaarvannanNew Member

Joined:
Dec 11, 2011
Messages:
27
Likes:
0
the motors are pulling 1.2 Amps.

19. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
Could you measure the current with an oscilloscope and post the graph?

20. ### kaarvannanNew Member

Joined:
Dec 11, 2011
Messages:
27
Likes:
0
I dont know how to measure current in a oscilloscope. does it need any extra probe?

21. ### misterTWell-Known MemberMost Helpful Member

Joined:
Apr 19, 2010
Messages:
2,697
Likes:
368
Location:
Finland
Safest way is to use a 0.1 ohm shunt resistor in series with the motor and measure the voltage across it. You need to use two probes referenced to ground and measure the difference of the two channels.