Quote:
Originally Posted by ajlapp
Does using this strategy prevent the controller from requesting max duty cycle when starting from zero?
What I'm currently seeing is my FF go to the requested value and stay there until near the target speed....the P term does not seem to boost the duty cycle request to max at startup as I initially expected.
|
Anthony,
I use I for that. I know 254 and even the SRX manual says go FF - P - D, but I am a purist. Note that if you use motion profile (externally) it will also get you what you desire.
For everyone else, real robot companies basically do this:
1. Tune FF (which is usually variable depending on desired speed) More on this later.
2. Tune I (this helps acceleration to desired speed)
3. Tune P (oscillations, blah, blah)
4. Tune D, if necessary
Note that if you are using an external motion profile generator (see 3310's code for the 2015 robot on Github) then you don't really need to tune I and tuning P/D is fine as the motion generator sets command velocity at each time step and the change in command is very low.
OK, let's demystify Feed Forward. It is really quite simple. FF is the command voltage (PWM duty cycle, whatever your team calls it when you give different voltages to the motor from the speed controller) it would take if everything is perfect with no friction, etc.
Some of us calculate that using the motor equations that relate voltage, current, rotational velocity, etc. but this is really not necessary.
Experimentally, you give the speed controller different open loop PWM commands until it goes to the speed you need with no other devices running (Jared spoke of this earlier). Record that voltage, do the unit conversions required for the Talon and now you get your multiplier (aka, FF gain).
From a pure control theory point of view, I gain for speed control is the same as P gain for position control. If you ONLY use P gain, then you will get to only about 50 - 60% of your desired speed. When you use FF gain, then this does not apply and eliminating I gain is fine for most.
However, I gain will help accelerate a little faster than just FF gain alone if your FF gain isn't already at max voltage (Which I do not recommend. Pick a desired wheel speed that is significantly slower than motor free speed so you have headroom for disturbances)
Paul