velocity estimation from position measurement for speed control
May 18, 2007 3 Replies
D
dr5417
Hi, Could somebody help and advice how I estimate the velocity from the position output of an incremental shaft encoder (two outputs, 90 deg. shifted). I use Simulink and xPC target to control an actuator with DC motor. The easiest way would be to take the difference between the last two sampled positions divided by the sampling period. But I don't know where I should get the sampling period from? Is there another way which I could try to perform speed control?
Thanks Dan
Didn't find your answer? Ask the community — no account required.
T
Tim Wescott
Surely you know the sampling rate?
A bare first difference, such as you propose, will work far better than nothing -- good enough, perhaps, that you don't need more.
If you have noise problems, consider making a band-limited differentiator, though.
J
Jerry Avins
Fine, but that doesn't answer his sample-period question. The period is the reciprocal of the sample rate. Surely, that is a constant?
Thanks Jerry and Tim for your discussion. I managed to create a model which simulates a DC motor with encoder feedback. The reference speed changes at a predefined time interval (e.g. 0.5 sec). A counter counts the pulses coming from the shaft encoder to get the position of the actuator. This counter is then reset to obtain the position at the end of the predefined time interval. Multiplying the final counter content with a constant should give me then the exact position at the end of the time interval (0.5 sec.). This value is then divided by the time interval to get the average speed of the actuator for the predefined time interval.
My problem is now how to get only the final content out of the counter at the end of predefined time interval?
At the moment, I subtract the counter content from the previous time step from the current content to get the position. By the end of the time interval, the counter is reset and this gives me then the final counter content for the particular time step. However, this is done always based on the sampling rate of the simulation (0.001 sec) and not only at the end of the time interval (0.5 sec). To send only the final speed at the end of the time interval to the comperator, I use a zero order hold but I'm not sure if this is the right solution.
Thanks Dan
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.