Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   HELP with TANK DRIVE PROGRAMMING (http://www.chiefdelphi.com/forums/showthread.php?t=87927)

kamocat 14-12-2010 23:42

Re: HELP with TANK DRIVE PROGRAMMING
 
Ether is correct, PID-based speed control is your best option. Know that you must test and tune this until you can trust it to work how you want.


Now, about how Jaguars control motors: This is my understanding; please correct me if I'm wrong.
Say you have a DC brushed motor that draws 6A at 12V DC under normal load. That's 72W.
Now say you're driving it at 50% duty cycle, at 15khz. (I think that's the chop rate of a Jaguar). That motor coils have enough impedance that the motor effectively gets the RMS voltage - the average voltage. At 50% duty cycle, that would be 6v. Using ohm's law, we say that the motor would draw 3A. That makes 18W; a quarter of full power.

Now let's compare that to a 2 ohm resistor, with no significant impedance. The 50% duty cycle is still 12v, but only half the time. That means we take 60W / 2 = 30W. In this case, the Jaguar is better described as controlling current, as opposed to the voltage control in the previous example.

Victor 884's have a chop rate of 150hz, if I remember correctly. I know it's very poor control, and very audible at low speeds. It's clear that the motor impedance is not enough to make up for the low chop rate, and so the Victor effectively controls current. (I've looked at the waveform of a Victor 884 controlling a Globe motor. At 50% duty cycle, the inductive ring almost fades completely before the MOSFETs switch.)
Could this be why the control resembles a square root function? The Victor has a square root function internally because P=R*I^2, when (because of the low chop rate) the equation is actually P=V*I? (The only manipulated variable here is I; V and R are constants.)

Ether 15-12-2010 01:18

Re: HELP with TANK DRIVE PROGRAMMING
 
Quote:

Originally Posted by kamocat (Post 985693)

Say you have a DC brushed motor that draws 6A at 12V DC under normal load. That's 72W.
Now say you're driving it at 50% duty cycle, at 15khz. (I think that's the chop rate of a Jaguar). That motor coils have enough impedance that the motor effectively gets the RMS voltage - the average voltage. At 50% duty cycle, that would be 6v. Using ohm's law, we say that the motor would draw 3A. That makes 18W; a quarter of full power.

This is my understanding; please correct me if I'm wrong.

There are two fundamental errors in the above analysis:


I)

The RMS* of a 12V 50% duty cycle square wave is ~8.5 volts, not 6 volts. If the motor inductance is high enough, or the PWM period is short enough, then the motor inductance filters the square wave so that for purposes of computation the motor effectively sees the algebraic average, which is 6 volts, not the RMS.

II)

The only time motors obey Ohm's law is when they are not moving. Since you mentioned "normal load" I will infer that the motor is spinning with a speed well above 50% of no-load speed. Since the motor is moving, Ohm's law does not apply, and your analysis is incorrect.

If you have a motor that is drawing 6 amps at 12 volts and producing torque T, and then you reduce the applied voltage to 6 volts, what happens depends on whether you maintain the same torque load on the motor and allow the motor speed to drop, or some other combination of torque and reduced speed.

Say you maintain the same torque load on the motor and allow the speed to drop. Since the torque remains the same, the current will remain 6 amps. The motor will be drawing 6amps times 6volts = 36 watts.

Quote:

Now let's compare that to a 2 ohm resistor, with no significant impedance. The 50% duty cycle is still 12v, but only half the time. That means we take 60W / 2 = 30W. In this case, the Jaguar is better described as controlling current, as opposed to the voltage control in the previous example.
If you put a 12V 50% duty cycle square voltage waveform across a 2 ohm pure resistance, the power consumed by the resistor will be the square of the RMS voltage of the waveform divided by 2 ohms, or (8.485^2)/2 = 36 watts, not 30 watts.


Quote:

It's clear that the motor impedance is not enough to make up for the low chop rate, and so the Victor effectively controls current.
No it doesn't. Again, Ohm's Law is not applicable to a spinning motor. For a given output PWM duty cycle percent, the average voltage that the motor sees remains constant, but the average current that the motor draws increases (or decreases) as the torque load on the motor increases (or decreases). Also, for a given motor torque load, changing the output PWM duty cycle percent just changes the motor's speed, not its current... unless of course you drop the percent until the speed is zero, in which case further reduction of the percent causes current to drop.

The effect of low motor inductance, or long PWM period, is to cause ripples in the current. The ripples cause increased motor heating (Irms^2*R) for a given average motor torque (which varies with Iave, not Irms^2).


*RMS means "root mean square": take the square root of the average of the squares. So, for a 12V 50% duty-cycle square wave: 1) multiply the wave by itself (ie square it). You now have a 144V 50% duty-cycle square wave. 2) take the average: 144/2=72 (because it's 50% OFF). 3) Take the square root: the square root of 72 is ~8.5 volts




Ether 15-12-2010 13:14

Re: HELP with TANK DRIVE PROGRAMMING
 
Quote:

Originally Posted by Mark McLeod (Post 985548)
P.S.
Not that you've said you have this issue, but if turning at low power is a problem with your robot you can also do something in software that doesn't require adding sensors, physically changing the gearing, or swapping out sticky wheels for slicks.
In your code you can avoid applying the power reduction to any turning component or make just turning a higher percentage. For example, if one of your joysticks is forward and the other is backward, then don't reduce the power to the joysticks. If they are both forward but to varying degrees, so you get a curved driving path, then leave the difference between the sticks alone and only reduce the straight component.


Here's one possible implementation of what Mark has suggested:

Let Y1 be the left joystick command and Y2 be the right joystick command.

Then compute these modified joystick commands:


Y1' = [(a+1)*Y1 + (a-1)*Y2]/2

Y2' = [(a-1)*Y1 + (a+1)*Y2]/2


where "a" is your speed adjustment factor, e.g. 0.25

Then send the modified Y1' and Y2' commands to the tank drive vi.



This transformation yields Y1' and Y2' values which are always in the range -1 to +1 (assuming that Y1 and Y2 were in that range).

It also handles cases where [(Y1>0) and (Y2<0)] or [(Y1<0) and (Y2>0)], so no conditional logic is required.




Cyberphil 15-12-2010 18:49

Re: HELP with TANK DRIVE PROGRAMMING
 
Now, I do not know about your robot at all, but rather than doing this with the programming, why don't you just change the gear ratio of the DT? This will probably save a lot of headache (If your DT is anything like ours). It will, in turn, give you more power, but in most robot destruction cases I have seen in the past 4 years, it has been because of the speed of the bot.

If this is not what you are looking for, then please just disregard this! Hope this helps! :)

Ether 15-12-2010 20:27

Re: HELP with TANK DRIVE PROGRAMMING
 
Quote:

Originally Posted by Cyberphil (Post 985818)
why don't you just change the gear ratio of the DT? It will ... give you more power

i.e. , if you gear it down further, it will reduce the top speed, and increase the pushing force.





kamocat 16-12-2010 20:44

Re: HELP with TANK DRIVE PROGRAMMING
 
I'll read up on AC power. It's apparent I don't understand it well.


All times are GMT -5. The time now is 21:20.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi