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


Adds support for a Pololu A4983 stepper motor controller.
Pololu A4983.jpg
This powerful controller can supply up to 2A per coil and contains a chopper circuit with a potentiometer to limit the current. Make sure you read the manual as to how to use this as its too complex for me to describe here.
You can either power the board from your micro controller regulated supply or you can power it from the same battery as you are using to power the motor.
To power it from your micro controller then attach one of the Vdd pins to the regulated supply on your micro controller. This should be the same voltage that is used by the micro controller. For example: the Axon has both a 5V regulated supply and a 3.3V regulated supply but, since the ATMega640 is powered from the 5V supply then you must connect Vdd to the 5V supply.
To power it from the motor battery then leave Vdd unconnected and instead you will need to short out one of the solder jumpers on the board. For example: the ATMega640 on an Axon uses 5V so you should short out the 5V jumper on the A4983 board.
See _stepper_common.h for a description of the commands to control the motor.




POLOLU_A4983 MAKE_POLOLU_A4983(inverted, steps, accel, every, direction,pulse,reset,enable)

Create a Pololu A4983 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 A983 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.
POLOLU_A4983 motor = MAKE_POLOLU_A4983( FALSE, 400, 10, 2, A0, A1, null, null);

Valid XHTML 1.0 Transitional