Go to Post For We Will Rock You, we quit counting Saturday morning when it got to 12 times. - Gary Dillard [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-12-2010, 16:33
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,667
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by Andrew Schreiber View Post
Neither... the controllers pulse a voltage (12v in our case). http://homepages.which.net/~paul.hil...llersBody.html Has a little more info.

Edit: Thinking more on it. JesseK is "correct" as far as I can tell. Because of the pulsing of the output you are limiting the amount of current which limits the amount of torque. He is correct but I wanted to make sure there was no confusion about how an ESC worked.
Hmm

The second paragraph under "Theory of a Speed Controller" states that it's an 'averaged' effect of lowering the voltage by switching the full-voltage signal on and off. Later on the page, a figure shows the effect of the PWM switching on current as if the signal 'pulses' the current, thereby averaging it to a lower value as well. Rather than neither I'm inclined so say 'both' ... but really I'm just getting confused.

I'll look at it more later. Thanks for the link.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
Reply With Quote
  #2   Spotlight this post!  
Unread 14-12-2010, 16:40
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,062
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by JesseK View Post
Hmm

The second paragraph under "Theory of a Speed Controller" states that it's an 'averaged' effect of lowering the voltage by switching the full-voltage signal on and off. Later on the page, a figure shows the effect of the PWM switching on current as if the signal 'pulses' the current, thereby averaging it to a lower value as well. Rather than neither I'm inclined so say 'both' ... but really I'm just getting confused.

I'll look at it more later. Thanks for the link.
Yeah, I'm talking with an EE who has a better understanding than and he is saying that the Jags also have the capability of being operated in a Voltage or Current mode over CAN.

I have a few other links regarding ESC design and construction if you are interested. It has been a couple years since I read them and I admit they move way beyond my understanding pretty quickly.
__________________




.
Reply With Quote
  #3   Spotlight this post!  
Unread 14-12-2010, 17:28
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,083
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING




If you are using a Victor, or a Jaguar with servo input (not CAN), then your command to the Victor (or Jaguar) results in an output voltage to the motor being controlled.

The motor then draws current (at that voltage) according to how heavily it is loaded. As you load the motor, the motor slows down and draws more current (according to the motor's current vs torque curve for that particular voltage).

This is variously referred to as open-loop control or voltage control.

If you limit the inputs to the tank drive vi, what you are doing is limiting the available maximum voltage supplied to the motors.

Limiting the maximum voltage to the motors limits the maximum speed of the motors, but it also limits the amount of current that can flow when the motors are trying to push something. It is current that provides torque, so this limits the motor torque and thus the robot's pushing force.

The output voltage from the Vic or Jag is modulated by a technique called Pulse Width Modulation (PWM). The voltage is alternately turned ON and OFF at a high rate of speed (15,000 times per second for the Jag and 150 times per second for the Vic). The motor sees this as if it were a steady DC voltage equal to the percent of the time the voltage is ON. For example, if the voltage is ON 75% of the time and OFF 25% of the time, the motor would think it is getting 9 volts DC (75% of 12).


Now, having said all that, there are ways to operate the motor other than voltage control. One such way is speed control. This requires that you have a sensor to sense the motor's (or the wheel's) speed.

What you can do is to feed the speed signal to the cRIO. Your software looks at the speed and says "hey, it's going slower (or faster) than what I wanted". Your software then increases (or decreases) the command until the motor is doing what you want. This is called a closed-loop control. There are many ways to do this. One very popular way is called PID. LabVIEW provides a PID vi to do this.

Another option, available on the Jag only, and only if using CAN, is to connect the speed sensor directly to the Jag instead of the cRIO. The Jag has a microcontroller inside it, with a built-in PID algorithm, and the Jag can "close the loop" for you so you don't have to do it in the cRIO. The Jag provides options for controlling speed, position, or current.





Last edited by Ether : 14-12-2010 at 17:37.
Reply With Quote
  #4   Spotlight this post!  
Unread 14-12-2010, 23:42
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
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.)
__________________
-- Marshal Horn
Reply With Quote
  #5   Spotlight this post!  
Unread 15-12-2010, 01:18
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,083
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: HELP with TANK DRIVE PROGRAMMING

Quote:
Originally Posted by kamocat View Post

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




Last edited by Ether : 15-12-2010 at 09:58. Reason: added explanation of RMS
Reply With Quote
  #6   Spotlight this post!  
Unread 16-12-2010, 20:44
kamocat's Avatar
kamocat kamocat is offline
Test Engineer
AKA: Marshal Horn
FRC #3213 (Thunder Tech)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 2008
Location: Tacoma
Posts: 894
kamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nicekamocat is just really nice
Send a message via AIM to kamocat Send a message via MSN to kamocat
Re: HELP with TANK DRIVE PROGRAMMING

I'll read up on AC power. It's apparent I don't understand it well.
__________________
-- Marshal Horn
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with tank drive nickcvet89 NI LabVIEW 16 02-02-2010 16:35
Problem with tank drive Mr. E NI LabVIEW 6 27-01-2009 16:59
Help with programing Tank Drive in Lab View zackcool123 NI LabVIEW 3 18-01-2009 19:49
EASY C PRO help tank drive issues!!! can any 1 solve this programming issue? mayazk Programming 2 16-02-2008 02:17
Tank Drive help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Idaman323 Programming 3 18-02-2005 15:17


All times are GMT -5. The time now is 01:03.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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