Back in 1993 I decided to build myself a PC based CNC controlled milling machine Because someone had given me a Galil DMC620 2 axis motion control card. While the card was awesome at moving motors very accurately from point A to point B, I had problems
getting it to work in a CNC type application. By now I was hooked and
had to have a CNC machine but was poor, I decided to design my own.
After much research I decided that the my design would depend on two
main things, choice of motor and the communication method used to talk to the controller.
I decided that I liked the concept of the computer doing the position
calculations as opposed to a special plug in motion control board. Why
not take advantage of the power of an old PC which you can get for next
to nothing or free?. I also liked the idea of a truly open architecture
using the computers printer port to communicate with the controllers by
means of step and direction pulses. To me using step and direction
pulses to control the motors seems to make more sense than using
proprietary hardware and software for control. Another reason for going
the step and direction route is the fact that you have a lot more
choices when it comes to software that can read industry standard gcode and interface with the controller.
I call the design I came up with Servo Lite and the circuit description
is as follows. Two synchronous 8 bit binary up down counters, one
fed by the computer the other from the incremental encoder mounted on
the shaft of the motor, feed into a digital subtracter that takes the
difference between the counters and generates an error signal. To
improve performance the error signal is processed with a analogue PID
filter and then sent to a comparator that compares the error signal
with a triangle wave. The output of the comparator is a square
wave of varying duty cycle and is the drive signal for a PWM amp that
drives the motor. In other words the computer sends out a control
signal, in the form of step and direction pulses, and the
encoders on the motors provide the feedback signal for the servo
controller. One area that my controller falls short of the more
expensive control boards is it only has an 8 bit counter, compared to
24 or 32 bits of an expensive servo board. This has the effect of
only being able to control position error up to +/- 127 encoder or
computer pulses. When pushed past these limits the motor slips
like a stepper motor does when under load except instead of 1.8 deg.
slip there will be a slip in multiples of 127 encoder pulses. This
means that the amount the motor slips, or cogs, is a bit bigger step
than a stepper depending on the resolution of the encoder mounted
on the motor. This motor slipping I speak of is no problem under
normal operating conditions, this is because the error should
never get close to being that big. If it does it means you are asking
to much from the system and need to get bigger motors and amps or
slow the thing down. Although my servo controller is not as
sophisticated as a full blown motion control card, it is more than the
average hobbyist needs, and cost only as much as a stepper system that
has no position feedback, if you take into account the fact that
stepper motors will cost more.
Highlights
1. Made with common off the shelf components 2. Can be used to enhance more sophisticated cards
3. Can be used to distribute processing tasks 4. Simple easy to understand and very reliable 5. Can upgrade affordable open loop control software to closed loop.
Deficiencies
The
main difference between traditional industrial controllers and Servo
Lite is the fact that at low speed the industrial controllers run
smoother due to the fact that they have tach feedback. Depending
on your encoder resolution this may present itself as stair stepping in
a long shallow taper. The other difference is that the industrial
controllers have 32 bit counters as opposed to the 8 bit that Servo
Lite has.
|