WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation


Adds support for a generic L297 stepper motor controller.
See _stepper_common.h for a description of the commands to control the motor.




L297 MAKE_L297(inverted, steps, accel, every, direction,pulse,reset,enable)

Create an L297 stepper motor controller.
The parameters are as follows:
Let's assume that we have a stepper motor with 200 steps per revolution and that we have configured the L297 to use half stepping to achieve 400 steps per revolution. Also assume we configure the driver to produce a maximum of 300 pulses per second. This means that the maximum speed of the motor will be 0.75 revolutions per second (ie 45 rpm).
If we used 'accel = 10' and 'every = 2' then this means the motor speed will increase by 10 units every 150th of a second (300 pulses per second divided by 2) until it reaches the requested speed. Note that values of 'accel = DRIVE_SPEED_MAX' and 'every = 1' will effectively give infinite acceleration.
We will use pins A0 and A1 for direction and pulse and leave the reset and enable unused.
L297 motor = MAKE_L297( FALSE, 400, 10, 2, A0, A1, null, null);

Valid XHTML 1.0 Transitional