|
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.
|