Modeling A Controller For An Articulated Robotic A
Modeling A Controller For An Articulated Robotic A
Received December 1, 2011; revised May 7, 2012; accepted May 15, 2012
ABSTRACT
The precise control upon each degree of freedom of a robotic arm is a great challenge in implementing industrial work.
This paper aims to design a novel controller for an automated robotic arm. A discrete Proportional Integral Derivative
(PID) control technique is being used to replace the complex electronic circuitry, which would greatly reduce the cost
and size of the controller. DC motors will be controlled on the basis of Closed-Loop System using an avr (Atmega 16/32)
microcontroller. Transfer functions have been derived for mathematical modeling of the system through which the sta-
bility of the system can be evaluated prior to fabrication.
Keywords: Robotic Arm; Proportional Integral Derivative (PID) Controller; Transfer Function; Computed Torque
Technique; Atmega 16/32
2. Transfer Function K p e t
Va t (1.4)
The transfer function of a single joint can be well ap- n
proximated by Equation (1.1) using the following vari- Taking Laplace transform:
ables:
K p E s
Va = Armature voltage (Volts) Va s (1.5)
La = Armature inductance (Henry) n
Ra = Armature resistance (Ohms) Substituting the value of Va(s) from Equation (1.5) to
θm = Angular displacement of thee motor shaft (Radi- Equation (1.3) the following equation is obtained:
ans) L s Ka K p
Jeff = (Jm + n2JL) G s (1.6)
Jm = Moment of inertia of the motor referred to the
E s s sRa J eff Ra f eff K a K b
motor shaft (oz.in.s2/rad) After some algebraic manipulation the following equa-
JL = Moment of inertia of the load referred to the load tion is obtained:
shaft (oz.in.s2/rad)
n = Gear reduction ratio
L s G s
feff = (fm + n2fL) d s 1 G s
fm = Viscous friction coefficient referred to the motor Ka K p
shaft (oz.in.s/rad) (1.7)
Ra J eff
fL = Viscous friction coefficient of the load referred to
the load shaft (oz.in.s/rad) 2 Ra f eff K a K b Ka K p
n = Gear reduction ratio s s
Ra J eff Ra J eff
Ka = Motor torque proportional constant (oz.in/A)
Kb = Proportionality constant between ω (angular speed) Equation (1.7) is a proportional controller for a single
and eb (back emf) joint and is always stable is the system parameters are
Kp = Position feedback gain positive. To increase the system response time and re-
θd = Desired angle duce the steady state error an appropriate PD, PI or PID
e(t) = (θd(t) – θ(t)) the error in position controller can be used.
In case of a PID controller:
m s
Va s
K p e t Ki e t dt K d
d
e t
Va t
(1.1) dt
Ka (1.8)
n
s s 2 J eff La La f eff s Ra f eff K a K b
In Equation (1.8) Kp, Ki and Kd are the position, inte-
gral and derivative feedback gain respectively.
Since the electrical time constant of the motor is much
Taking Laplace transform of Equation (1.8):
smaller than the electrical time constant, the armature
E s
inductance (La) can be neglected. K p E s Ki
s
Kd s E s
Hence, Va s (1.9)
m s n
Ka
(1.2)
Va s s sRa J eff Ra f eff K a Kb
The closed loop transfer function is obtained by per-
forming some algebraic manipulations after substituting
Since the output of the controller is the angular dis- the value of Va from Equation (1.9) to Equation (1.3)
placement of the joint (θL), therefore it can be written: L s
L s nK a d s
(1.3)
s sRa J eff Ra f eff K a K b
Va s Ka Kd 2 Ka K p K a Ki
s s
This is an open loop second order system, to improve Ra J eff Ra J eff Ra J eff
the response of the system a closed loop Proportional, Ra f eff K a K b K a K d K a K p K a Ki
PD, PI or PID controller can be used. This helps in re- s3 s 2 s
Ra J eff Ra J eff Ra J eff
ducing the rise time and the steady state error. In case of
a simple Proportional closed loop control the applied (1.10)
voltage is linearly proportional to the error between the For implementing a PD control Ki should be 0;
desired and the actual angular displacement of the joint. And for a PI control Kd should be 0.
The values of Kp, Ki and Kd has to be determined ac- Alternatively the timer interrupt can be activated and
curately to get the best system performance. The Ziegler- the PID() function can be called in that interrupt. After
Nichols method can be used to determine the “Best Fit” each time interval T the timer interrupt is executed and
value of the three parameters. The Ziegler-Nichols tun- hence the PID() function is called.
ing method is a heuristic method of tuning a PID con- In case the feedback component is an optical shaft en-
troller. It is performed by setting the “I” (integral) and coder then the value of the encoder is taken as an exter-
“D” (derivative) gains to zero. The “P” (proportional) nal interrupt in the microcontroller. After that the angle is
gain, is then increased (from zero) until it reaches the converted to an equivalent voltage and finally the error
ultimate gain Ku, at which the output of the control loop signal is computed.
oscillates with a constant amplitude. Ku and the oscilla- To increase accuracy the P-factor, I-factor and D-factor
tion period Tu are used to set the P, I, and D gains de- arescaled with a factor 1:128. The result of the PID algo-
pending on the type of controller used. rithm is later scaled back by dividing by 128. The value
128 is used to allow for optimizing in the compiler.
3. Discrete PID Controller The computed voltage after the PID algorithm is exe-
A discrete PID controller reads the error signal, calcu- cuted is generated by using PWM (Pulse Width Modula-
lates the output and controls the input given to the motor tion) technique, which can be very easily done using
at a given time interval, at the sample period T. The sam- Atmega 16/32.
ple time should always be less than the shortest time
constant in the system. 6. Conclusion
The paper has presented an alternative solution for con-
4. Algorithm for the Discrete PID Controller trolling robotic arm using discrete PID controller tech-
Unlike simple control algorithms, the PID controller is nology. The PID controller presented here is a simplified
capable of manipulating the system inputs based on the example. The controller should work fine, but it might be
history and rate of change of the signal. This gives a necessary to make the controller even more robust (limit
more accurate and stable control method. runaway/overflow) in certain applications. Adding satu-
Considering Equation (1.8) ration correction on the integral term, basing the propor-
tional term on only the system process value can become
K p e t Ki e t dt K d
d
e t necessary. In calculating the I-factor and D-factor the
Va t
dt sample time T is a part of the equation. If the sample time
n T used is much smaller or larger than 1 second, accuracy
Here, e(t)dt can be approximated as T e k where k for either I-factor or D-factor will be poor.
Robot,” World Academy of Science, Engineering and Tech- “Neural-Networks-Based Adaptive Control of Flexible Ro-
nology, Vol. 32, 2007, pp. 299-306. botic Arms,” Neurocomputing, Vol. 17, No. 3-4, 1997, pp.
[5] C. W. de Silva, “Applications of Fuzzy Logic in the Con- 141-157. doi:10.1016/S0925-2312(97)00037-4
trol of Robotic Manipulators,” Fuzzy Sets and Systems, [8] K. J. Tseng, “DSP-Based Control of Brushless DC Drives
Vol. 70, No. 2-3, 1995, pp. 223-234. for Direct-Driven Robotic Arms,” Microprocessors and
doi:10.1016/0165-0114(94)00219-W Microsystems, Vol. 19, No. 10, 1995, pp. 581-589.
[6] S. Ali, A. Moosavian and E. Papadopoulos, “Modified doi:10.1016/0141-9331(96)84159-7
Transpose Jacobian Control of Robotic Systems,” Auto- [9] J. R. Rogers, “Low-Cost Teleoperable Robotic Arm,” Me-
matica, Vol. 43, No. 7, 2007, pp. 1226-1233. chatronics, Vol. 19, No. 5, 2009, pp. 774-779.
doi:10.1016/j.automatica.2006.12.029 doi:10.1016/j.mechatronics.2009.03.004
[7] I. Arciniegasjorge, H. Eltimsahyadel and J. Cioskrzysztof,