Microcontroller Implementation of a Small Robot Arm Controller
Functional Description
Our goal for our senior project is to design and develop assembly language for a small robot arm assembly controller using an enhanced 8051 microcontroller (80535). We will also design and construct the microcontroller interface circuitry, investigate adding safety features such as motor current limit protection, and motor disable hardware/software for excessive position displacements. The add-on keypad and LCD (Liquid Crystal Display) will be used to provide a user friendly interface for controller entry and status information.
A block diagram of the external input and output signals of the system is shown below in Figure 1. The external input signals consist of the position sensor signal, the signal received from the joystick, the motor current limit protection signal, and the keypad. The external output signals consist of the actuation signal to drive the system, the kill relay, and the LCD.
FIGURE 1:
External Input and Output Signals
INPUTS OUTPUTS
A
more detailed block diagram is shown in Figure 2. It includes the
microcontroller board, the DC motor assembly, someexternal gears, a position
sensor, and an antialiasing filter. The microcontroller board consists
of a keypad, a LCD display,A/D and D/A converters, and the 80535 microcontroller.
The microcontroller provides 24 bits of digital I/O, 4
counters/timers, and 10 external interrupts. The microcontroller
board is manufactured by EMAC Inc., which is located in
Carbondale, IL.
The D/A converter output drives the external power amplifier which is connected in a voltage-follower configuration. Theamplifier can supply a maximum of 3 Amps to a DC motor. The DC motor converts the control voltage to a mechanical position and velocity. The external gears provide a 70.5 reduction in motor rotor velocity for the external robot arm load. This arrangement is beneficial because the motor “sees” a small load; i.e., the gears step-up torque.
A
potentiometer is used for the position sensor. The pot arm is connected
to the robot arm via a 1:1 gear. A voltage supplyof +/- 5 volts is
used for the pot so that the arm position of zero degrees corresponds to
zero volts. This feedback voltagewhich will consist of power supply
noise is filtered with a capacitor shown in Figure 2 as the antialiasing
filter. The
combination of the potentiometer resistance and the capacitor is a
low-pass filter. The power amplifier, DC motor, gear
train, potentiometer, and the antialiasing filter is part of a system
manufactured by Quanser Consulting. The company also provides test
software and simple controller software for their system.
FIGURE 2:
Detailed Block Diagram
Complete System Level Block Diagram
There are also some internal signals that are important for us to evaluate
and test. The following signals will be
available on the D/A converter output channels. The control block
diagram is shown in Figure 3.
Command signal - Desired robot arm position.
Feed-forward signal - The output signal from the feed-forward compensator.
PID-type controller
- The output signal from the PID(proportional+integral+derivative)-type
signal
controller.
Filtered position
- The filtered actual position sensor signal.
Signal
Actuating signal
- Signal that drives the robot arm system, connected to power amplifier.
FIGURE 3 :
Control Block Diagram
The software flowchart is
shown in Figure 4. The software contains an interrupt service routine
as well as the main
program. The software will kill the motor if there is excessive
position displacement or if the current exceeds its limit. The software
also checks to see if the joystick is present. Timer 2 of the 80535
microcontroller will be used to generate the
interrupt for the PID controller calculations. Initially, the
timer will be set for a 5 millisecond interrupt (200 Hz sampling).
This fast sampling time will make the overall system look like a continuous-time
system instead of a discrete-time system.
Later, the interrupt time will be decreased, but this subject will
not covered until the second semester senior year (EE432
Control Theory II). Dr. Dempsey suggested 200 Hz sampling based
on previous research.
FIGURE 4:
Software Flowchart
Patents, Standards, & Bibliography
For our project it was suitable to investigate the microcontroller boards
that would be used for the control
system instead of a patent search. The minimum microcontroller
board would consist of an INTEL microcontroller, 4
channels of analog-to-digital converters, 4 channels of digital-to-analog
converters, external RAM for user programs,
program download capability from a personal computer (PC), a keypad,
and an LCD for displaying of status information.
The EMAC board meets these requirements, and was selected by our advisor,
Dr. Dempsey, for this senior project. Other
manufacturers that were evaluated were Advanced Education Systems (AES)
and Rigel Corporation. Over twenty hours
were required searching the World Wide Web for the appropriate vendor.
The board from EMAC Inc. was selected based
on the hardware features such as external keypad and 2-line LCD.
The debugging software system provided is poor,
however, this was also the case for the other vendors. Part of
our senior project time will be used to investigate a
professional debugging package that will work with the EMAC board.
There are no standards that apply to the project because the EMAC board
will be used in a standalone manner.
However, during development, the EMAC board will connect to an IBM
compatible computer. These standards for the
computer are shown below in Table 1.
TABLE 1:
List of Standards
1. IBM 486 compatible computer or higher with math CO-processor
2. DOS version 6.2
3. Windows 3.11 or WIN95
4. 1 COM port (RS232 standards)
Datasheet
The input signal to
the control system is shown in Figure 5. The final positions labeled
+CMD (command signal) and
-CMD are also known as the set points. The velocity is the slope
of the waveform. A velocity command of 100?/sec is
shown below.
FIGURE 5:
Input Signal to Control System
The numerical specifications for the input signal shown above are listed in Table 2.
TABLE 2:
Numerical Specifications for Step Input
1. | CMD | <= 90 degree
2. Velocity(max) = 45%/sec.
The outputs of the
control system are the position and velocity of the robot arm. The
numerical specifications shown in
Table 3 will be measured using a Tektronix TDS 340A Oscilloscope.
Since we are dealing with frequencies under 1 Hz,
measuring these specifications off of the oscilloscope takes hours.
The less time consuming measurements
are % O.S., Ts, and tp. The other measurements are measured by finding
the
Bode plot of the system, which again can take hours.
TABLE 3:
Measured Outputs of Control System
Approximate value of Position
% O.S. - Percent overshoot = 5(%).
tp - Time to first peak = 6(s).
Ts - Settling time =9(s).
Mp - Resonant peak = 1.1.
Wp - Resonant frequency =0.16(rad/sec).
BWc.l. - Closed loop bandwidth = 0.5(rad/sec).
PM - Phase margin =69.
GM - Gain margin =4.
ess < 2 degree.
VELOCITY
Tracking error < 2 degree.
The user interface
for this project is the keypad and the LCD. Since the LCD only has
two lines to display information,
there will be two modes for the LCD. The first mode will be for
the user input. This input will be entered through the
keypad. Table 4 lists the possible inputs from the user.
A help menu will be used to enter these parameters. For example,
push 1 on the keypad to turn the motor on or push 0 to turn the motor
off.
TABLE 4:
User Inputs
1. Motor ON/OFF.
2. kp gain.
3. Command set point.
4. Ramp velocity.
5. Command frequency.
The
second mode for the LCD will be to display the signals shown in Figure
3. From a help menu, the user will be
able to designate which signal should be displayed in real-time.
This will be helpful for system evaluation purposes.
Senior Project Demonstration
For demonstration,
the percent overshoot, time to first peak, and settling time will be measured
and compared with
simulation results from MATLAB. This will be the fastest method
to prove our controllerworks. Prediction equations can
then be used to calculate parameter values in the frequency domain
which can also be compared with simulation results.
The equipment needed to perform the demonstration is listed in Table
5.
TABLE 5:
Equipment List
1. Tektronix TDS 340A Oscilloscope
2. Hewlett Packard 33120A Waveform Generator