X27 stepper driver with ATtiny85

From time to time I see people struggling to get an X27 instrument stepper motor nicely running.
I had these problems myself and found that driverboards often only increase the problems because they are not made for the low currents needed.

To solve this I made a program for the ATtiny85 to drive an X27 instrument stepper motor.
It's a simple solution that needs almost no hardware.
Basically, the ATtiny, the steppermotor and a capacitor on the 5V powersupply. The required current is so low the motor can be connected direct to the ATtiny.

The position of the motor can be controlled in one of three ways:

1- Analog 0-5V
2- PWM 0-100% duty cycle (3.3V and 5V accepted)
3- Servo PWM (3.3V and 5V accepted)

The phase difference between the coils can be set to 60 deg (X27 standard), but also other angles like 90 deg. are possible.

Max speed and acceleration can be set to avoid trouble with high-mass loads.

The program contains a lot more explanation. Read it carefully and answer your own questions as I don't spend much time on this forum.

https://create.arduino.cc/editor/gw66/e27f6067-090d-426e-8f41-b08f111492ee/preview

The main disadvantage is that you need to program an bare ATtiny chip with a programmer.
There are several solutions around for this. I used an Pololu USB Avr Programmer V2.1, but a lot of people use an (old) UNO to do the trick.

The program is written in assembler to get a good accuracy on measuring the PWM signal. Unfortanately this makes it difficult to adapt the program to other needs.

I hope this program makes life easier for people looking for a simple X27 solution.

1 Like

There is dedicated chip available that drives this smoothly , but I like the idea of being able to control acceleration - I’ve had problems driving “ heavy” gauge pointers, never managed to get it to run as fast as yours either !

The dedicated chip I found was the AX1201728SG. It has microstepping, but the processor still has to create the steps on 2 processor pins and do the calculations for speed and acceleration.

see also: SwitecX25 Quad Driver Tests

As my processor has a lot of other timing related things to do I wanted an independent driver that handles the positioning by itself.
In this setup the main processor only has to provide a PWM signal on a single pin and almost no software is needed and nothing is timing sensitive.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.