![]() |
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? |
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. |
| All times are GMT -5. The time now is 20:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi