Stepperino is a stepper motor controller based on arduino and cheap, commonly available components. This early version is capable of controlling an unipolar stepper motor (5, 6 or 8 wires) in half step mode and is the first step towards more sophisticated control to be achieved in firmware.
Here is the schematic [click to enlarge]:
The top left connector is for input from a microcontroller, which determines which coils are turned on. The rest is divided in four identical sections, each having a BC337 NPN transistor driving a TIP122 power darlington pair, which in turn is attached to the motor coil through the bottom right connector. Collectors of the power transistors are connected to a sense power resistor which allows fixed current to flow in the motor, independently of the voltage.
As for now the motor I am using is underpowered: its spec says 24v but I am giving this circuit a 18v supply, so speed and torque may be affected. For now I can reach a speed of about 10 revolutions per second of the stepper.
Here is how it came out on a breadboard, attached to an arduino and to a stepper motor [click to enlarge]:
The little trimmer in the picture has been added for controlling a delay in the firmware, so to test different speeds of the motor. In fact the speed can be raised until the motor reaches resonance, and just a tad before that point the motor is going at full speed. This is the code:
void setup() {
DDRB = DDRB | B11111111;
}
int sensorPin = 0;
int sensorValue = 10;
void loop()
{
sensorValue = analogRead(sensorPin);
PORTB = B00000001;
delayMicroseconds(sensorValue*10);
PORTB = B00000011;
delayMicroseconds(sensorValue*10);
PORTB = B00000010;
delayMicroseconds(sensorValue*10);
PORTB = B00000110;
delayMicroseconds(sensorValue*10);
PORTB = B00000100;
delayMicroseconds(sensorValue*10);
PORTB = B00001100;
delayMicroseconds(sensorValue*10);
PORTB = B00001000;
delayMicroseconds(sensorValue*10);
PORTB = B00001001;
delayMicroseconds(sensorValue*10);
}
As you can see the code is very simple: it just does a full step sequence delayed by the value read from the trimmer. It is good for testing different speeds and step sequences, to see which one is best for achieving maximum speed.
The next steps for beta version will be:
- add PWM to software
- port software to avr-gcc and optimize timings
- determine if BC337 are really necessary or not
- add filtering caps for PWM
- add diodes for coil protection



Recent Comments