velocity estimation from position measurement for speed control

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

Reply to
dr5417
Loading thread data ...

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.

Reply to
Tim Wescott

Fine, but that doesn't answer his sample-period question. The period is the reciprocal of the sample rate. Surely, that is a constant?

Jerry

Reply to
Jerry Avins

=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF

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

Reply to
dr5417

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.