A Flexible Real-Time Motor Control System For Robot Joints

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

A FLEXIBLE REAL-TIME MOTOR CONTROL SYSTEM FOR ROBOT JOINTS

Li Liu and Andrew B. Wright

Applied Science Department


University of Arkansas at Little Rock
Little Rock, AR 72204

Abstract--A flexible, real-time motor control system consisting of a DC motor and an


incremental optical encoder is proposed. The system allows complex real-time control
algorithms to be implemented with hardware control excepting PC-based software
simulation. A motion control processor is used to bridge the Target PC and the robot joint
through I/O devices. Simulink/Real Time Workshop (RTW) are the software interface
loaded in the Workstation PC which generates the control codes and stand-alone program
for various control algorithms.

I. INTRODUCTION simulation using Simulink/RTW, which graphically


develop and generate the codes effectively. The
A robot is a set of linkages connected by joints that basic development process for the robot joint
are governed by specific control algorithms. The task controller using the system proposed here is shown in
of control algorithms is to regulate the actuator to Figure1.
control the joint parameters. Although the recent
research shows the artificial muscle-based joint has Design, prototype the model
great potentials for the contributions of biologically graphically in Matlab/Simulink
inspired robots (Jacobs, 1999), the motor-encoder
based joint coupling still is the most popular and Redesign the
classic configuration in robotics. At present, Off-line simulation model or
Scopes, animation, etc. Tune up the
numerous control algorithms have been developed
parameters
for robot manipulators according to this kind of joint
configuration (Baines and Mills, 1998; Niemeyer and
Slotine, 1991; Kelly and Ricardo, 1996). Many of No
Satisfy?
them, however, are proposed based on software
simulation because developing and implementing
these sophisticated control strategies are difficult and
Yes
time consuming, especially implementing them into
the real-time hardware control. A user-friendly RTW generates the program
Download to target PC
programming environment is essential for the
development of the controller. The robot control
system must have enough flexibility to meet the
Hardware-in-the-loop
change of the algorithms or the modifications of prototyping testing
physical structures. Furthermore, the system should
meet the real-time requirements of various
algorithms. Generally, to implement a real-time robot
No
control, a 10ms-20ms sampling time is basically Satisfy?
required. According to the traditional prototyping
method, system and design engineers have to be both
control specialists and computer specialists. They
need to spend a lot of time on high level design, Yes

analysis, testing, and tuning as well as programming Final codes used in


the algorithms into the hardware. This paper presents production system.
an innovative joint control system that automatically
integrates design, testing, hardware-in-the-loop (HIL)
Figure1. The interactive design-prototype-test
development process for the robot joint control.

(c) 2000 Elsevier Science Ltd. All rights reserved.


The user develops a model in Simulink. In robot put between target PC and joint processor to finish
control, this involves modeling plant dynamics. The the communication. The Host PC is a workstation
user can use Matlab, Simulink, and toolboxes to where the user designs and simulates the control
develop algorithms and analyze the results. Then, the algorithms using Matlab/Simulink and then builds
model is run in Simulink with off-line simulation. If them into DOS-based stand-alone program using
the results are not satisfactory, the user can iterate the Real Time Workshop. The files are downloaded to
modeling /analyses process until results are target PC through the Ethernet with the TCP/IP
acceptable. protocol.

Once have achieved the desired results, the user can Ethernet
Host PC.Loading
Matlab/Simulink/RTW
generate downloadable C code and executable TCP/IP and Watcom C/C++.
program using Real Time Workshop and Watcom Runing at Windows98
C/C++. With the HIL simulation, the user can tune
parameters and further refine the model, again
rapidly iterating to achieve required results. Finally, 8/6 PWM 2
BUS
the codes are ready for use in production systems. I/O
HCTL1100 AMP
Boards

Encoder
II. SYSTEM CONFIGURATION
Target PC. DOS
Executing real-time Joint processor Motor
Generally, there are two methods to configure the program.
control circuit for robot joints (Enriquez et al., 1995).
The first approach is to use the Personal Computer
(PC) to control the joints through serial or parallel Figure 2. Hardware architecture of the flexible real-
ports, or through PC-bus (Mauer et al., 1989). The time motor control system.
Host PC has to take care of all the tasks such as
algorithm design, control implementing, data
collection and processing. This approach is
completely flexible and any control algorithms can III. SYSTEM HARDWARE
be generated and run at the Host PC. However, it
suffers some disadvantages in real-time applications. The Workstation runs windows98 with Matlab,
The reason is the complex control algorithms and Simulink, and Real Time Workshop. It is the Host
other tasks will occupy lots of PC resource so that it where the control algorithms are designed, modeled,
degrades the sample frequency that is important for simulated, and the real-time programs are built. For
real-time control. This is an extreme approach, which best performances, larger memory and fast CPU are
uses the PC to execute whole tasks, and is used in recommended for the Host PC.
few practical applications. Another method is to use
the microcontroller to control the joint directly. A PC-AT (486 or Pentium) severs as the Target PC
According to the different situation, the user can and runs DOS for real-time programs. It executes
customize the hardware and circuit to meet the real- real-time control algorithms and sends or receives
time requirements for specific control. This method data to or from the joint processor. Since DOS is a
may meet the real-time application but it is not easy single tasking operating system where only one
to change the control algorithms and afford process can exist at any given time, so it guarantees
sophisticated computation due to the limitations of that the program can execute in real-time by interrupt
microcontroller. The user has to design the service routine.
algorithms somewhere and then program the model
into the hardware using the low-level language to I/O broads provide the communication between the
verify the results. Because the controller design is an Target PC and external hardware. In this case, the
interactive design-prototype-test development robot joint is controlled by Target PC through
process, using this method will cost much time on HCTL1100. That means that the digital I/O boards
programming other than dedicated controller design. are enough for this application. The 24 bit parallel
Importantly, It may not be flexible enough when the digital I/O board, PIO12, provides three ports that
user wants to change the algorithms and hardware can interface two joint processors at same time. Other
structures. TTL/DTL compatible digital I/O boards, like CIO-
DDA06, can also be used in this system with small
A compromise is considered in this paper. Through modifications of programming.
combining the advantages of first and second
approaches, a new flexible motor control system is The traditional robot joint control method is to use
constructed. Figure 2 is the computer architecture of the target PC to control the joint directly. This
the flexible real-time motor control system. Where, configuration gains flexibility but increases the
the Target PC and joint processor (HCTL1100) carry processing time, which is very important for real-
out the motor control in union. A digital I/O board is time control. As mentioned before, a general-purpose

(c) 2000 Elsevier Science Ltd. All rights reserved.


motion control IC HCTL1100 is added between the The device driver is written in C language in the form
Target PC and joint serving as the joint processor. of an S-function. S-functions are sections of codes,
The HCTL1100 is a high performance motion control written in a specific format in C or Matlab
IC, which frees the target PC for other tasks by programming language. The standard S-function
performing the time intensive functions of digital samples can be found in Matlab package. Here, three
motion control. The chip receives control command principle functions involved in I/O device drivers
from the Target PC and independently process a will be discussed. They are modified specifically for
given task through an 8-bit bi-directional multiplexed the application at hand.
address. Also, the joint information, like position,
velocity and acceleration can be fed back to the 1)mdlInitializeConditions: This function is called
Target PC for updating the control parameters. The only once at the logging of each simulation. It is used
user can then program the joint processor for one of to initiate the device and software-reset the device.
the four control modes: Position control; Proportional Also, the user can set the sample time, initial
velocity control; Trapezoidal profile control; Integral position, etc. for the joint processor.
velocity control. These four built-in control modes
correspond to four control strategies, which can 2) mdlOutput: This function is called at each step of
satisfy the major control requirements for robots. For simulation. There are five arguments in this function.
example, at the Trapezoid profile mode, the user Y: the output vector.
specifies only the desired final position, acceleration X; the state vector.
and maximum velocity then the joint processor will U: the input vector.
compute the necessary profile to generate the motor S: the Simstruct for this block.
command. Tid: The task ID.

However, one of appealing specifications is that the Design the model in Simulink/RTW
HCTL1100 can be set to Initialization /Idle mode and
then the joint can be controlled by control algorithms
generated by the Target PC. In this case, the joint Generate the desired joint
. ..
processor is just like a bank of registers and the trajectories. (Q Q Q )
Target PC can send the command to motor command
register directly. This gives the user another approach
to control the joint as well as use the control modes
of HCTL1100. Even when the user uses Initialization No
/Idle mode, the actual position registers can be Use the HCTL1100
control modes
always read to get the current encoder count for the
Target PC. This compensates the shortcoming of the
joint processor with its only four control modes. Yes
Theoretically, any flexible control algorithms can be
implemented in real-time at this configuration. Write the joint Generate the
parameters to motor command
registers. /PWM

IV. SOFTWARE IMPLEMENTATION


Set HCTL1100
To actualize flexible real-time motor controller, Select control to Init/Idel mode
software integration is necessary. Simulink is easy to mode. and write the
motor command
use for generating the joint trajectory and modeling port
the control algorithms due to its graphical interface. . ..
Real Time Workshop creates the stand-alone q, q, q
executable program for the model. However, the I/O Robot joints
device driver must be developed before using RTW
so that the external hardware can be treated as a
Simulink block. When the user simulates the model
with the I/O device, the output module will behave
like a terminator block. After getting the satisfied Figure 3. Software flowchart of controlling the robot
joints using flexible real-time motor controller.
simulation, the user can use the RTW to compile and
link the Simulink model with the device driver,
which contains the code that handles joint processor, The user can put each input (U) to the specific
timing, interrupt, data logging, and background tasks. function, which represents the control algorithm or
Here, the Watcom C/C++ is used for developing the control mode. Output vector Y can be used to check
high efficient 32-bit DOS-executable program. the output results of I/O device block.
Figure 3 illustrates the software control process of a
real-time motor controller. 3)mdlTerminate: This function is called once at the
end of the simulation. It is used to reconfigure all

(c) 2000 Elsevier Science Ltd. All rights reserved.


ports of digital I/O board as input ports as a Target PC, joint processor, or both depending on
precaution and set back the HCTL1100 to the different control schemes. It shortens development
Initialization /Idle mode. cycles and reduces costs by implementing hardware-
in-the-loop simulations for robot joints. Compared to
The joint processor, HCTL1100, also needs the large and costly real-time distribution system, this
programming so that the corresponding control economic motor control device is very useful in
algorithms can be integrated into the device driver. academic research. This fast design-prototype-test
Using ANSI C to develop the program for tool has been used in UALR for working robot
HCTL1100 guarantees that it can be seamlessly research.
incorporated into the device driver, which is
developed in S-functions. Programming of the joint
processor is straightforward. A head file (hctl.h) REFERENCE
includes all macro definitions that are easy for the
joint processor to access registers. Two basic read Baines, P.J., J.K. Mills (1998) Feedback linearized
and write functions are called by all macros. For joint torque control of a geared, DC motor driven
example, use following definition to get and set the industrial robot. International Journal of
motor command register. Robotics Research. 17, 169-92.
Enriquez, A.L., A. H Eltimsahy and M. M. Jamali.
#define get_motor_command read_hctl(0x08) (1995). Flexible control for robot manipulators.
#define set_motor_command(value) write_hctl(0x08,value) IEEE Micro. 15, 55-60.
Jacobs, R. (1999). Biologically inspired legged
Another, the four control modes of HCTL1100 are robots for space operations. Final report NIAC
written into four functions so that it is easy to call Phase1. 6-8.
them whenever the control strategy need them. The Kelly, R., R. Carelli (1996). A class of nonlinear
simple position control function for position control PD-type controllers for robot manipulators.
mode is shown in figure4. Journal of Robotics System. 13, 793-802.
Mauer, G.F., J. Skaggs and R.M. Turner (1989). A
Flexible PC_Based Robot Controller.
void position_control(int Zero,int Pole,int Proceedings Robots 13 Conference. Society. Of
Gain,int Time, float position) Manufacturing Engineer. 23-31.
Niemeyer, G., Jean-Jacques E. Slotine (1991).
{ Performance in adaptive manipulator Control.
... The International Journal of Robotics Research.
/*program digital filter with zero, pole and 10, 149-161.
gain*/
set_filter_zero (Zero);
set_filter_pole(Pole);
set_filter_gain(Gain);
set_sample_time(Time);
/* Set Position Mode */
write_hctl (0x05,0x03);
/* Command Desired Position */
set_com_position ((position)^0xFFFFFF+1);
/*2's complement */
}

Figure 4. Code sections for programming


HCTL1100 to position control mode. This
function can be called by mdlOutput.

V. CONCLUSION

In this paper, an innovative flexible real-time motor


control system for robot joints is proposed. It extends
the controller design from software simulation to
real-time experiment. Various control algorithms
generated by the Host PC can be downloaded, run,
and validated on the Target PC. The joint processor
can afford the tasks of data collection and
computation as well as support built-in four motion
control modes. The robot joint can be controlled by

(c) 2000 Elsevier Science Ltd. All rights reserved.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy