# Torque control of pancakemotor

Discussion in 'The Projects Forum' started by MrBear, Nov 9, 2013.

1. ### MrBear Thread Starter Member

Dec 3, 2012
19
0
Hello
I have spent countless hours on my project and i am now out of ideas and energy. I am trying to achieve true torque control (aka current control) which is done (as i understand it) by sampling the amount of current that runs in the system and using that as the Input-parameter of the PID algorithm.

The system consists of the following:
pancakemotor: http://www.pml.com.cn/ver2en/motors/GPM16LR.html
Motorboard: http://www.robotshop.com/eu/en/devantech-md03-50v-20a-h-bridge-driver.html
Ampsensor: http://www.panucatt.com/product_p/cs-50a.htm
Arduino Uno

I have a setup similar to this:

There is one funny (read terrible) but interesting response of the system. If i apply a steady low output (without PID, just a steady PWM) from the arduino to the motor board the spring will tighten but after a few seconds the motor begins to make a little audible noise. Thats not the problem, but once in a while it is as if the motor looses power for an instant - the duration of the "hole" is very short, only enough to make the motor rotate opposite the pulling direction for a few (15-20) degrees, then the motor re-energizes. My first guess was that it was the motor board is going into over-current protection (a feature it has to not burn out) due to the varying and very low resistance at certain rotor-positions, and the very low inductance (<100uH) of this kind of motor. I have looked at the PWM on a oscilloscope and it does not seem to change accordingly when the motor looses power.
So i have a motor that seems to get a constant PWM voltage but occasionally looses power for (less than) a split second. ????!!!!!!????? Anyone?
I am running PWM @ 32kHz

PLEASE..........ANYONE i am out of things (and forums) to try.

Thank you.

2. ### SgtWookie Expert

Jul 17, 2007
22,202
1,793
Does the (average) current flow through the motor remain constant while there is a sudden loss of torque? If so, that would eliminate just about everything else except the motor itself.

I am not familiar with that particular type of motor

3. ### MrBear Thread Starter Member

Dec 3, 2012
19
0
The average current drops when there is a loss of torque. I tried an other motor board, rated to 160A continuous (so way overkill for the motor) and it seemed like the effect was less when using a lower PWM frequency. It does not make sense to me. I have also tried to connect a large cap (1000uF) across the motor leads. That did not help either.

4. ### SgtWookie Expert

Jul 17, 2007
22,202
1,793
A large cap across the motor would simply increase the load on your motor driver's MOSFETs, as current flow during turn-on would be excessive.

Do you have long, loopy wiring as shown in the video? If so, that would be a source of problems, as each would have a fair amount of inductance. You should try to keep wiring lengths as short as possible. If you have "ringing" on the wiring due to the inductance, that could be causing your driver's MOSFETs to be switching on and off randomly.

5. ### MrBear Thread Starter Member

Dec 3, 2012
19
0
Eureka!
The pancake-motors have a very small inductance as i mentioned in my post, so adding a choke (coil in series) helped a lot. Of cause it also gave me some more headache. I actually got a pretty decent PD loop working great........ until i cranked the PWM to the motor board all the way up and saw that most of my power was gone. The voltage drop over each coil (one on either side of the motor) is almost 8V, leaving me with about 8V to supply the motor. I am not sure i understand why.
It would make sense if the voltage drop was largest at 50% duty cycle but this is happening at a steady slope all the way from 0 to max_PWM.

Would love a push in the correct direction.

6. ### GetDeviceInfo AAC Fanatic!

Jun 7, 2009
1,615
238
Might have something to do with $X_L=2{\pi}fL$

7. ### MrBear Thread Starter Member

Dec 3, 2012
19
0
Okay........ i guess...... the impeadence goes up with the frequency. and higher PWM is equal to higher frequency (what). Sorry for my stupidity here but the frequency is set to a specific value e.g 32k. as i turn up the PWM the frequency will remain at 32k right?

Do you know how to calculate a fitting size of the inductor?
i have a <100uH inductance from the load (motor, http://www.pml.com.cn/ver2en/motors/GPM16LR.html)

1) First off the inductor needs to be able to handle the Amps.
2)Wanting to maintain a small electrical constant i would choose a small inductor, but not too small. If its too small the motor will become jerky with a constant PWM.
3)Help please, how will i know what the minimum value of inductance i can go for?

Thanks again

8. ### GetDeviceInfo AAC Fanatic!

Jun 7, 2009
1,615
238
See what your documentation may call for in reference to chokes on the supply side.

9. ### shortbus AAC Fanatic!

Sep 30, 2009
5,918
3,374
Just a complete guess here, but, why are you using such a high PWM carrier frequency? It, PWM frequency, is usually in the ~18k to ~20k frequency range, just high enough to be out of the audible spectrum. Maybe try lowering the PWM frequency?

10. ### MrBear Thread Starter Member

Dec 3, 2012
19
0
Thanks for the reply. Well i am using 32K because that is a standard prescalefactor of the Microcontroller i am using. One step down would be about 3900Hz and that is very loud.

11. ### GopherT AAC Fanatic!

Nov 23, 2012
8,025
6,788
What? Which microcontroller are you using?

12. ### MrBear Thread Starter Member

Dec 3, 2012
19
0
I am not sure what you mean. sorry

Dec 3, 2012
19
0
Arduino UNO.

14. ### MrBear Thread Starter Member

Dec 3, 2012
19
0
Yes but is the frequency seen by the inductor not highest at 50% duty cycle(largest spacing between pulses)?

Thanks

15. ### shortbus AAC Fanatic!

Sep 30, 2009
5,918
3,374
At 32kHz PWM, the unknown quality of the "motorboard" (H-bridge) is suspect. If the switching drivers on the H-bridge are not capable of switching that fast, it could be dropping out when trying to go above a certain level.

I'm not a digital/micro type guy, but I always assumed that you could use one to set any frequency output you needed. Why not just set an output that works?