2 thoughts on “Primus gets moving

  1. Patrick

    how did u control the acceleration? I am real puzzled about that, adding on the fact that that im using dc motors, im am really really confused.

  2. peteh

    If you look in the other Primus sections, you should find the code for the mouse. There is also a description of how the stepper acceleration can be achieved.

    For a DC mouse, the same process can be used. Generally, this is done by creating a series of positins and feeding these to a controller. That controller’s only job is to maintain the mouse at a fixed position.

    On every control cycle tick, we do sums like this:


    currentSpeed = currentSpeed + acceleration;
    currentPosition = currentPosition + currentSpeed

    You can find quite a good writeup of how this is done here:

    http://www.barello.net/Papers/Motion_Control/index.htm

Leave a Reply