SMC1500 stepper motor controller
... or using only 2kB of the ATmega664P's flash.
Recently I bought a small CNC mill/hot wire foam cutter. Originally this thing
seems to be first made around 1989 in West-Germany, yes, its design is from the time
that there were still two Germanies :-).
The mill was connected via an amplifier box to an ISA plugin card. When I bought
the it the ISA card was gone but the owner had invested in a stepper motor controller
card and some software. He never found the time to put everything together to make
a working machine, so he decided to sell it.
I happily bought the machine, brought it home and started investigating the electronics.
The stepper motor controller card that came with the mill was a SMC1500 from Emis GmbH.
This card is a little bit non-standard compared with normal stepper motor controllers.
With this card you choose an axis to modify and configure the currents and the direction
of the currents of the motor coils. By doing this in the correct pattern you let the motor turn.
One drawback is that you must choose which motor signals you modify so you can't change
two motors at the same time. Another is that standard CNC software (EMC2 in my case)
expects a step/dir interface where you set a direction and spit out pulses to let the motor turn.
There is an additional board available (SMC1500z) with a microcontroller that converts
step/dir signals to signals for motor coils. Conrad sells these boards for about 50 euros,
which is a reasonable price, in my opinion. However, I'm an electronics engineer, I like hacking
and I should be able to make one myself.
The SMC1500 consists of a 5V regulator, six NJM3770AD3 H-bridge chips for the motors which
are controlled by three 74HC573 latches and a sort of address decoder in a GAL chip.
Latches and GAL removed
New electronics fitted
To be able to control all motors I decided to remove the latches and GAL and to build a simple circuit that controlled the motors.
A simple whole-step controller could be made with a four-step state machine. I designed a circuit
around a 4013 double D-flip flop and a 4070 quad-xor chip that would go through the four states
and generated the correct output for the motordriver chips, inspired by this page
Because I controlled the motor with full steps the motors weren't as strong as I expected, so I decided
to drop the discrete logic steppercontroller and designed a simple microcontroller circuit with an ATmega664P I had lying around.
These schematics are available under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported license.
The code for the microcontroller checks the input pins for a pulse on the step input of
every axis and then steps through a table with motorstates so that the motors make steps
in the indicated direction. After 10 seconds of no pulses for any axis the microcontroller
turns off the holding current to avoid unneccesary heating-up of the motors.
The definitive code uses only 2kB of the available 64,
so I could have used almost any microcontroller with enough pins.
This software is licensed under GNU GPL version 2.0.
That's it; everything works as expected, I can now control my mill with EMC2 and start to learn how to engrave and mill nice things.