Victor linearization procedures:

This will explain the victor linearization procedures as well as tuning the PID to achieve the entire closed loop calibration.  First I should mention that while I have added  the same functionality to fixed point rotary systems, the steps below are velocity control rotary system.  In regards to the fixed point we may find a good average known curve to use, but this assumes that one would be needed if the WPI library falls short of solving this here.  In either case fixed point nature solves for 0 velocity and there may not be a noticeable improvement  once it is applied.

The way other teams handle obtaining the victor curve is to obtain x amount of steady state points at various speeds that usually is an even distribution over the full range.  Steady state is defined as giving each point enough time to stabilize to an accurate rate.  So this would imply that the momentum and kinetic energy of the load have finished taking effect to get that value.

We could take this approach; however, I feel it is a very time consuming process and could undershoot with more error because the kinetic and momentum have not had time to catch up.  Instead I propose we use an open loop at the desired rate that we want to have, and measure this as an open loop.  The timing of this will not be exactly the same because the PID is not taking effect on the voltage, but it should be good enough in the ballpark to work out.  The idea here is that we have a good linear ramp of voltage with the encoder readings against it to show the curve.  From this we can determine the ideal equations and then verify them using the same test.  So I will list the steps below:

1.  Setup LUA for a PID of 0, 0, 0 and turn on the show_pid_dump to yes, and also have is_closed to yes.  We may want to lower the max_accel_forward and reverse if we desire to get a more steady state of our points (still need to test that).  Also make sure curve_voltage=

   {t4=0, t3=0, t2=0, t1=1, c=0} or you can delete it entirely to accomplish same effect

2.  Capture a ramp up of the rotary system, and we may want to graph this

3.  Use curve fitting on these points to create equations...  Currently this can be achieved using Excel... I’ll look for some alternatives to this.  I may want to write code to interpret the dump itself to do this.  It should be noted we want the inverse of the curve we present as the inverse curve added to this curve should yield a linear result.

4.  Apply the equations to the curve_voltage parameter in LUA.

5.  Run same test again and compare results.  If we have a low max accel it should stop curving, but may still be falling behind of where the voltage is being shown.  This may be good enough to work with.

6.  At this point the victors are linearized and now it will be time to tune the PID... start with p around 100, and slowely increment this until we have a steady oscillation occuring.  This will ensure the P can act quick enough to each stage in the tuning.  This is when capturing and viewing graph will come in handy

7.  From this point increment D to dampen the oscillation we may want the tolerance set high during this step.  You may want a smaller tolerance during 6 to force it to oscillate

8.  Tune down tolerance and observe results.  We may want to use I for the kill as it can fine tune error... this all depends on how well PD alone behave as I is a bit risky, and how accurate we need the error and tolerance to be tuned.

Cache-control: no-store