Perhaps I missed something really basic, but this is how I read these posts:
Quote:
Originally Posted by Ether
You don't ramp "towards a speed greater than that desired". You ramp toward the setpoint S, by reducing (or increasing) Y. When you cross the setpoint, the sign of the error changes, and Y is adjusted.
|
This is only true over the longer course if/when Y is regularly adjusted. I was referring to the period between the first and second crossings of the setpoint speed,
during which the voltage applied is held constant. My contention (presented below) is that the second crossing is never achieved in my third case (estimate for M is too large), beginning from a standstill.
Quote:
Originally Posted by Ether
Y will be integrated in the proper direction until the sign of the error changes. You will cross the setpoint.
|
How does integration of Y cause the sign of the error to change? The "crossing" is determined by whether d and e have the same sign bit. Y is not part of this calculation, only S (setpoint/desired speed) and P (measured speed).
Here's what I'm considering: for simplicity, let's assume a ridiculously simple system such that over the range of 0.2 to 0.8, the asymptotic/terminal speed is equal to the applied voltage multiplier (for a fresh battery). The target speed is 0.5, but M for a desired speed of 0.5 was previously mis-measured at 0.6.
At initialization, b = 2 * 0.6 - 1 = 0.2. e=S-P begins positive, as the motor is not moving (Set point speed definitely faster than measured speed).
The applied voltage multiplier at startup is 1.0, which causes the shooter to promptly reach a speed of 0.5. By the time speed reaches [for argument's sake] 0.51, the applied voltage is adjusted to 0.6, and e is set to a negative value (that is, running too fast). The speed then
continues to increase until asymptotically reaching 0.6. d continues to return negative values, so signbit(e) == signbit(d). The if clause in your loop is never reached, and the voltage is held at 0.6 -- until the battery voltage drops so that a voltage multiplier of 0.6 cannot maintain a speed of 0.5. At that point, the algorithm would begin to work as desired, but the match would likely be long over.