^{1}

^{*}

^{2}

^{1}

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 stability of the system can be evaluated prior to fabrication.

The recent rapid progress in robotic technologies has led to great expectations for robots to be applied in various fields such as industrial robots, guard robots and home robots [

A closed loop PID controller is being used to reduce the overshoot, rise time and the steady state error. A PID controller usually comprises of a Proportional, Integral and Derivative circuitry but here the whole PID controller is implemented through programming which greatly reduces the electronic circuitry as well as cost of the system. This approach also simplifies tuning of the proportional (K_{p}), integral (K_{i}) and derivative (K_{d}) gains. The computed voltage from the error signal is applied to the motor by Pulse Width Modulation (PWM) technique.

A Transfer function is a mathematical expression which relates the input and output variables by using Laplace transform. This can be modeled via MATLAB (SIMULINK) to obtain the various performance characteristics of the whole system which may be in the form of graphs. Here an approximate transfer function is derived considering the parameters such as damping, moment of inertia, gear ratio etc.

The first section gives insight into modeling of system using a suitable transfer function. It is followed by the concepts of Proportional Integral Derivative control. Then, the advantage of implementing a discrete PID controller is highlighted by using an atmega 16/32 bit microcontroller.

The transfer function of a single joint can be well approximated by Equation (1.1) using the following variables:

V_{a} = Armature voltage (Volts)

L_{a} = Armature inductance (Henry)

R_{a} = Armature resistance (Ohms)

θ_{m} = Angular displacement of thee motor shaft (Radians)

J_{eff} = (J_{m} + n2JL)

J_{m} = Moment of inertia of the motor referred to the motor shaft (oz.in.s2/rad)

J_{L} = Moment of inertia of the load referred to the load shaft (oz.in.s2/rad)

n = Gear reduction ratio f_{eff} = (f_{m} + n2fL)

f_{m} = Viscous friction coefficient referred to the motor shaft (oz.in.s/rad)

f_{L} = Viscous friction coefficient of the load referred to the load shaft (oz.in.s/rad)

n = Gear reduction ratio K_{a} = Motor torque proportional constant (oz.in/A)

K_{b} = Proportionality constant between ω (angular speed) and e_{b} (back emf)

K_{p} = Position feedback gain

θ_{d} = Desired angle e(t) = (θ_{d}(t) – θ(t)) the error in position

Since the electrical time constant of the motor is much smaller than the electrical time constant, the armature inductance (L_{a}) can be neglected.

Hence,

Since the output of the controller is the angular displacement of the joint (θ_{L}), therefore it can be written:

This is an open loop second order system, to improve the response of the system a closed loop Proportional, PD, PI or PID controller can be used. This helps in reducing the rise time and the steady state error. In case of a simple Proportional closed loop control the applied voltage is linearly proportional to the error between the desired and the actual angular displacement of the joint.

Taking Laplace transform:

Substituting the value of V_{a}(s) from Equation (1.5) to Equation (1.3) the following equation is obtained:

After some algebraic manipulation the following equation is obtained:

Equation (1.7) is a proportional controller for a single joint and is always stable is the system parameters are positive. To increase the system response time and reduce the steady state error an appropriate PD, PI or PID controller can be used.

In case of a PID controller:

In Equation (1.8) K_{p}, K_{i} and K_{d} are the position, integral and derivative feedback gain respectively.

Taking Laplace transform of Equation (1.8):

The closed loop transfer function is obtained by performing some algebraic manipulations after substituting the value of V_{a} from Equation (1.9) to Equation (1.3)

(1.10)

For implementing a PD control K_{i} should be 0;

And for a PI control K_{d} should be 0.

The values of K_{p}, K_{i} and K_{d} has to be determined accurately to get the best system performance. The ZieglerNichols method can be used to determine the “Best Fit” value of the three parameters. The Ziegler-Nichols tuning method is a heuristic method of tuning a PID controller. It is performed by setting the “I” (integral) and “D” (derivative) gains to zero. The “P” (proportional) gain, is then increased (from zero) until it reaches the ultimate gain K_{u}, at which the output of the control loop oscillates with a constant amplitude. K_{u} and the oscillation period T_{u} are used to set the P, I, and D gains depending on the type of controller used.

A discrete PID controller reads the error signal, calculates the output and controls the input given to the motor at a given time interval, at the sample period T. The sample time should always be less than the shortest time constant in the system.

Unlike simple control algorithms, the PID controller is capable of manipulating the system inputs based on the history and rate of change of the signal. This gives a more accurate and stable control method.

Considering Equation (1.8)

Here, e(t)dt can be approximated as where k varies from 0 to n andcan be approximated as , t = nT and n is the discreet step at time t.

Atmega 16/32 is a 16bit avr microcontroller that has inbuilt 8-bit and 16-bit timers. These timers are used to set a pre-specified time interval, and an Interrupt Service Routine (ISR) is executed after every such time interval.

The PID controller uses a structure to store its status and parameters. This structure is initialized in main(??), and only a pointer to it is passed to the Init_PID() and PID() functions.

The PID() function must be called for each time interval T. This is done by a timer which sets the PID_timer flag when the time interval has passed. When the PID_ timer flag is set the main routine reads the desired process value (setPoint) and system process value, calls PID() and gives the output to the control input.

Alternatively the timer interrupt can be activated and the PID() function can be called in that interrupt. After each time interval T the timer interrupt is executed and hence the PID() function is called.

In case the feedback component is an optical shaft encoder then the value of the encoder is taken as an external interrupt in the microcontroller. After that the angle is converted to an equivalent voltage and finally the error signal is computed.

To increase accuracy the P-factor, I-factor and D-factor arescaled with a factor 1:128. The result of the PID algorithm is later scaled back by dividing by 128. The value 128 is used to allow for optimizing in the compiler.

The computed voltage after the PID algorithm is executed is generated by using PWM (Pulse Width Modulation) technique, which can be very easily done using Atmega 16/32.

The paper has presented an alternative solution for controlling robotic arm using discrete PID controller technology. The PID controller presented here is a simplified example. The controller should work fine, but it might be necessary to make the controller even more robust (limit runaway/overflow) in certain applications. Adding saturation correction on the integral term, basing the proportional term on only the system process value can become necessary. In calculating the I-factor and D-factor the sample time T is a part of the equation. If the sample time T used is much smaller or larger than 1 second, accuracy for either I-factor or D-factor will be poor.

We thank The Institution of Engineers (India) for supporting this work through a grant-in-aid. We are also grateful to the Department of Production Engineering, BIT Mesra for providing the required infrastructure.