Quote:
Originally Posted by GearsOfFury
Curious, in your accel equation, "PWM" cancels out in numerator and denominator - so it would have no effect on accel.
|
It doesn't cancel out, the PWM is still there when you multiply it out:
accel = p2*PWM*(1-RPM/(p1*PWM)) = p2*(PWM-RPM/p1)
It probably would have been better to formulate it like that, because there would be no problem with divide-by-zero and I could have removed the conditional logic.
Quote:
|
It looks like you are trying to estimate torque based on a delta to final speed?
|
That simple formula predicts the motor torque available for a given RPM and voltage (PWM), assuming a linear motor torque vs speed curve. You can think of p2 as the stall torque, and p1 as the free speed.
Quote:
|
Personal preference, I would prefer to see an inertia term in there explicitly so you have some relation to the physical world instead of just p1 / p2, so you can sort of check whether the parameters you end up with are realistic.
|
Yeah, if I were going to spend more time on this I would get all the units right and do it the way you suggested, for the reason you stated. But I knew ahead of time I was just going to tweak parameters to get to "roughly" model the real world, so I kept it simple (and admittedly somewhat obscure).
Quote:
|
I'm curious enough to try this myself, if you can explain your accel reasoning (I think you know far more about motor modeling than I!)
|
I think you're on the right track. Do you have access to a proper modeling environment? Please share your results if you decide to pursue this. FWIW, I've posted
C-code for the Take-Back-Half algorithm.