|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Programming Motors for Arm
There are two schools of thought to this, but personally I prefer PID control because I have seen/done it before effectively. If you want pre set positions, I would say that the potentiometer + PID to be the best control system for your robot. Not only will the values stay consistant, the arm will almost always go into the same position (assuming that you don't move the potentiometer (or pot)). The PID function is found under the analog tab. Basically, the set point determines what voltage the pot should read at the desired position, the process variable is the raw instantanious pot reading, the array of 3 values that are used to tune the loop (bottom always 0, mid is 0 or really small, top is the tuning number >0). The top output is the value you set your motors to. It is a bit confusing, pm me if you need examples/extra explination.
|
|
#2
|
||||
|
||||
|
Re: Programming Motors for Arm
How will I determine the correct voltage when I get the arm position I want? And then for the process variable, which I understand to be the actual position of the pot, you mentioned an array; is this preset in the PID or will I have to do something extra for that?
|
|
#3
|
|||||
|
|||||
|
Re: Programming Motors for Arm
You physically position the arm where you want it, then measure the pot output in LabVIEW (front panel indicator or probe), or you use a multi-meter to get your voltage reading.
|
|
#4
|
|||||
|
|||||
|
Re: Programming Motors for Arm
Another option is to first convert your potentiometer voltage to an angle (The relationship should be of the form angle=m*voltage + offset). You can then use that angle to calculate the height of your arm end effector (you'll likely need to draw out the geometry to arrive at the correct equation). Your presets could then be set in inches from the floor.
|
|
#5
|
|||||
|
|||||
|
Re: Programming Motors for Arm
Quote:
I've already uploaded this in a different thread, here's the link. http://www.chiefdelphi.com/forums/sh...ad.php?t=90604 |
|
#6
|
||||
|
||||
|
Re: Programming Motors for Arm
Quote:
And one of the posts said the top value is the one you set your motor to, so I figured this was just the motor output. However, one of the pics of code had a box with 1 on top and -1 on the bottom and the actual motor set leading from the left edge of the PID. Which is the correct way for our robot? Last edited by dmitch : 11-02-2011 at 15:30. |
|
#7
|
|||||
|
|||||
|
Re: Programming Motors for Arm
The PID block has quite a few terminals which you want to wire specific things to.
I'll start at the top and rotate around the VI counterclockwise. On the top you want to wire a constant to the Output Range terminal by right clicking and selecting "Create->Constant". For most FRC applications you want to change the default 100 and -100 to 1 and -1. Setpoint is where you wire the point you want to device to go to. Process Variable is where you wire the measurement of the device's position. You must make sure that the Setpoint and Process Variable have the same units, the PID block will try to drive the Process Variable until it matches the Setpoint. For tuning purposes you likely want to make a control for the PID gains terminal. A good starting place for the tuning of a position loop is to set the Integral Time and Derivative Time to 0. To find a starting point for the Proportional Gain, estimate the smallest error you want to still result in the maximum output. Then take the max output (usually 1) and divide by the error and you will have a starting point for the P gain. I would actually start the tuning with a gain lower than this number. I highly recommend reading this paper to understand the basic concepts so you can tune your PID loop. One thing to be careful of is the Labview implementation of PID is different than the implementation described in the paper. Labview uses Integral Time(Ti) and Derivative Time(Td) instead of Integral Gain(Ki) and Derivative Gain(Kd). The conversion is Kp equals Kc, Ki equals Kc/Ti, and Kd equals KcTd. The output terminal of the PID block should be wired into the Motor Set Speed VI. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|