Electronics
To use a biological metaphor, the motor controller corresponds to
a spinal cord and peripheral nervous system. It receives movement
instructions from the host computer through the RS-232 serial cable,
and can return position, velocity, and other data back to the host.
Decisions about where, when, how much, and how fast to move are made
in the host. The desired actions are then executed by the controller.
The controller actually does quite a bit of real time processing.
|

|

|
|
As with many components, this one started
by cutting metal and drilling holes.
|
Controller shown with its Linux/Java companion
|
|

|
|
Controller in operation, showing line voltage,
camera power, video in and out, motor leads,
and RS-232 wiring
|
|

|
In order to reduce the possibility of tangling as the camera arm
moves up and down, the camera power and video line are carried in a
zip cord style video cable. The two wires move together as one. The
video line goes to a video monitor. To keep the cables neat, and to
keep strain off the connectors, a feed-thru is supplied on the
controller chassis. The top RCA connector goes to the video
monitor.
|

|
|
Control information from the host computer comes in on a
standard RS-232 serial cable. RS-232 can carry a conversation between
two devices. It was originally designed to connect modems to dumb
terminals. Later, its use spread to connecting modems, printers, and
other devices to PC's, but always as a line with only two endpoints.
Other methods of carrying serial communications were invented which can
carry data between multiple devices at more or less the same time. One
of these is RS-485. In order to "bus" multiple PicServo controller
boards onto one serial port of a PC, JRKerr provides a Serial Port
Converter Board (Z232-485). In addition to doing the serial port
protocol conversion, the converter board also provides the power supply
for the logic section of of all the PicServo controller boards through
the daisy-chained ribbon cables. In this case it takes 12 VDC from the
Logic and Camera Supply and converts it to 5 volts for the controller
chain. It is important to note that the power supply for actually
running the motors themselves is a separate matter.
|
|

|
|
The "spinal chord" of the controller unit is the PicServo
controller board, by JRKerr.com .
In terms of price and performance, the PicServo occupies a previously
unfilled niche in the motion control marketplace. It allows the small
user to implement a full-fledged closed-loop servo control system for
less than $200 per axis, plus motor. The PicServo implements the "PID"
control algorithm. PID stands for Proportional Integral Derivative. All
controllers need some error between the setpoint (where do I want to
be?) and actual (where am I now?) values for position and velocity, and
some idea of how the error is changing with time, to decide how much
power to give the motor. Proportional Integral Derivative controllers
do a lot of math to reach their output values, and the user has to
enter some parameters into the controller to work with the PID
algorithm. These values are referred to a "weights" and tell the
controller how much emphasis to put on respectively, the P, I, and D
values when doing the calculation for the next value of output.
Selecting the right values for the P, I, and D weights is called
"tuning the controller", and if you're lucky will only have to be done
once for a given combination of motor and load. Each PicServo board
performs its calculation loop and updates its output around 1,900 times
per second. New commands can be sent to a controller board at a maximum
of 1,000 times per second. Commands to make new position or velocity
moves come from the host computer. In this case, the software which
ultimately decides how the motors move is a Java application running on
a Linux box. To program move commands into the PicServo, library
commands are called in Java with parameters that tell the controller
how far and how fast to move. We are developing our own high level API
(Application Programmer's Interface) to make access to the PicServo
from Java as easy as possible.
|
As is the case with most servo motor systems, feedback to the
controller is provided through optical encoders. Feedback is what
allows the controller to make continual adjustments to the power
output, in order that the motor is always pulling accurately towards
its command position, velocity, or acceleration. A disc with usually
between 50 and 1000 lines cut through its edge and housed in the back
end of the motor, slices a tiny light beam shining on a detector as
the motor shaft turns. This setup is known as a photointerrupter,
shaft encoder, incremental encoder, or in the specific case where
there are two light detectors, the arrangement is called a quadrature
encoder. More lines on the encoder disk gives more resolution, and
higher cost. Quadrature encoders do two tricks in addition to ticking
off position counts. They can tell the controller what direction the
motor is turning, and they multiply the number of encoder counts per
revolution of the motor shaft by four. So an encoder with 100 lines
cut into its edge gives a resolution of 400 counts per revolution
when read in quadrature. The PicServo controller is designed to
attach to motors equipped with quadrature encoders. You may notice
that the cable going from the motor to the controller board is really
two cables tied together. Both are shielded to suppress electrical
noise. One cable is controlled current to power the motor. The other
is the encoder cable. As a rule, signal wiring should be kept
separate from power wiring.
|
|

|
This controller unit contains few active components.
- a 24 volt, 8 amp switching supply to run the motors
- a 12 volt 1 amp switching supply to power the PicServo logic and
the video camera
- a serial converter board
- fuses (one for each controller board plus one main fuse)
- a terminal strip to make interconnections on
- three PicServo control boards with heat sinks (one heat sink is
larger than the other two)
- a monitor LED for each power supply
- a power switch
User input to the host computer is through three pushbuttons.
Their functions are turn left, turn right, and go. Movement control
and response is similar to the game Asteroids. The pushbuttons
are read by an EZIO board and converted to RS-232 which connects to a
serial port on the computer, separate from the port serving the
PICServo chain. The EZIO has 10 digital inputs 10 digital outputs,
two PWM outputs, and eight 8-bit analog inputs. The digital lines are
bit or byte addressable.
|

|
|
Control buttons used during development, and EZIO
interface board
|
80-20 Aluminum Extrusion ---> Base ---> Brushes ---> Camera ---> Camera Arm ---> Connector Block ---> Electronics ---> Ground ---> Homing and Limits ---> Servomotors ---> Slip
Rings ---> What Comes Around Goes Around
|