Quote:
Originally Posted by Ether
Y, d, and b should be initialized.
|
^Following up on the above^
You can improve the spinup response of TBH by clever selection of the initial values before you change the setpoint "S" from 0 to your desired speed.
Do a simple open-loop test to establish the approximate value of motor command (in the range 0 to +1) required to hold your wheel speed at the target value. Call this experimentally determined motor command value "M". It doesn't have to be exact.
To start your spinup do the following:
Set S to your desired wheel speed; initialize Y=1, d=1, and b=2*M-1; and turn your speed controller on.
Since Y=1, you will be applying full voltage to the motor to spin it up (just like bang-bang). Y will remain equal to 1 (applying full voltage) during the spinup, because there will be no zero crossings until you reach the target speed S.
When you reach the first zero crossing (at the target speed), the TBH algorithm will set Y (and b) equal to (Y+b)/2 = (1+(2*M-1))/2 = M, which is the experimentally-determined motor command value required to maintain the wheel at the target speed. You will immediately have the correct (or approximately correct) motor command for your target speed. This will reduce overshoot and oscillation.