yngndrw

03-25-2012, 03:10 PM

Hello,

I'm looking for general algorithms which can be used for motion control using an FPGA.

By this I mean the sub-system which would take a target position and generate the velocity (And hence step pulses) of each axis while keeping them in synchronisation. In addition to this, I'd like the option of using encoders to provide closed-loop position feedback.

There are a number of different algorithms and methods that I've seen but none of them seem to quite meet my requirements.

Bresenham's line algorithm is sometimes used but I fear that various rounding errors may allow the axes to fall out of sync in very long moves. This would correct itself when a second move is started because the position is kept track of but during the move it doesn't use the position as a feedback mechanic. As such, this also wouldn't work with the encoder feedback mentioned above.

I've also seem systems pre-calculate the acceleration and maximum speed for each axis and then allowing each axis to free-run but again that doesn't handle feedback in the way that I want.

It's a strange thing to do with acceleration because you almost have to say "The position must be at this point along the line" rather than saying "The axes must move towards this point a this speed ratio". I'm thinking you would calculate the move as a 1-dimensional translation, calculating the maximum acceleration and top speed given each axes' constraints and the ratio between them and then keep checking the position and moving the axes towards a virtual "moving" point on the translation line. If an axes gets too far out, you'd just speed it up - Essentially you'd have a PID loop for each axis which is driven by how far it is from this current command position.

Any ideas ? Thanks.

I'm looking for general algorithms which can be used for motion control using an FPGA.

By this I mean the sub-system which would take a target position and generate the velocity (And hence step pulses) of each axis while keeping them in synchronisation. In addition to this, I'd like the option of using encoders to provide closed-loop position feedback.

There are a number of different algorithms and methods that I've seen but none of them seem to quite meet my requirements.

Bresenham's line algorithm is sometimes used but I fear that various rounding errors may allow the axes to fall out of sync in very long moves. This would correct itself when a second move is started because the position is kept track of but during the move it doesn't use the position as a feedback mechanic. As such, this also wouldn't work with the encoder feedback mentioned above.

I've also seem systems pre-calculate the acceleration and maximum speed for each axis and then allowing each axis to free-run but again that doesn't handle feedback in the way that I want.

It's a strange thing to do with acceleration because you almost have to say "The position must be at this point along the line" rather than saying "The axes must move towards this point a this speed ratio". I'm thinking you would calculate the move as a 1-dimensional translation, calculating the maximum acceleration and top speed given each axes' constraints and the ratio between them and then keep checking the position and moving the axes towards a virtual "moving" point on the translation line. If an axes gets too far out, you'd just speed it up - Essentially you'd have a PID loop for each axis which is driven by how far it is from this current command position.

Any ideas ? Thanks.