Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Trapezoidal motion profile with fixed-point math (http://www.chiefdelphi.com/forums/showthread.php?t=117321)

bigar 15-06-2013 11:05

Trapezoidal motion profile with fixed-point math
 
Hello friends,

I'd like to introduce myself. My name is Gabriel, I live in Argentina (excuse me please if my english isn't good), I study electronics engineering, and my hobby is embedded systems designing and programming.
Recently I've been working with a DC motor servo control. Finished PID loop, and now working with motion profile.

Architecture is based on LM628, but implemented with dsPIC33FJ microcontroller. Because it is a fixed-point processor, I am doing all math that way. No problems with PID loop. But with motion profile I find quite difficult to manage "discretization accumulated error". I mean, when doing these integrations:
position1 = position0 + velocity0 + acceleration/2;
velocity1 = velocity0 + acceleration;

discretization error (large enough with Q15.16 fixed-point) integrates too, and the final position isn't correct.
Michrochip 0718 appnote deals with this, just commanding final position when trapezoidal profile finished; but obviously this produces a little jerk because of the error.

I taked a look a this thread:
http://www.chiefdelphi.com/forums/sh...=trapezoida l

and learned a lot; but people uses floating-point here and that's not exactly what I'm looking for.

Any help is appreciated. Have a nice weekend.:)

Gabriel


All times are GMT -5. The time now is 03:10.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi