Implementation
5.3 PLIR control system
In order to build the Simulink model of the PLIR for simulation purposes, the control structure of the robot must be modelled as well as the plant itself. This section covers the control system configuration, system identification of the actuator plant, verification of the Simulink model and finally, tuning of the robot controller using the Simulink model.
5.3.1 Control system configuration
The control setup for a single robot joint actuator is a closed-loop proportional-integral-derivative (PID) control system. Each joint actuator has been set up for closed-loop position control so that the robot joints can follow joint angle trajectories. Five control structure instances exist, one for each joint actuator of the robot. A simplified schematic of the control system configuration is given in Figure 5.9.
The control structure is made up of two control loops; an outer position control loop, and an inner current control loop. The PID controller is implemented in discrete form in the outer position control loop on the robot’s on-board computer. A trajectory is transmitted from the base station via
Wi-Fi, and stored in the on-board computer. This trajectory is used as the controller reference for each joint. The angular position of each actuator (feedback signal) is provided by a potentiometer voltage that is measured by the microcontroller associated with the specific joint and transmitted via UART to the on-board computer. The PID controller has an input error of radians, and the controller output is a current command in units of Amperes. This output is transmitted to the microcontroller board as a reference set-point for the inner current control loop.
The inner current control loop is a simple proportional controller with saturation on the output, operating at a frequency of 14 kHz. The controller feedback is a 10-bit number from microcontroller ADC, measuring the current transducer’s output voltage. Each current transducer is connected in series with the corresponding actuator armature winding. The feedback together with the set-point are used to create the output 8-bit PWM (pulse-width modulation) signal to drive the actuators using the H-bridges.
5.3.2 Simulink model
In order to create the Simulink model, the system parameters had to be determined. Some of the parameters such as armature resistance, armature inductance and motor torque constant were obtained from the datasheet. Other parameters such as friction coefficients needed to be measured experimentally. The parameter measurement procedures are not within the scope of this dissertation and are therefore not reported. The model parameters are provided in Appendix A.1. The model itself can be found in Appendix B.2.
With the correct parameters, the PLIR can be modelled using simple first order transfer functions to describe the physical components of the system. For example, the DC motor of the actuator can be modelled using two coupled first order differential equations; one to describe the electrical
Figure 5.9: Simplified control system configuration.
characteristics of the system and another for the mechanical characteristics. All of these components are assembled in a Simulink model and this model is used to simulate the real system. The Simulink model takes into account some important system aspects:
• Discrete time controller including system delays
• Microcontroller and computer control characteristics
• Static, Coulomb and viscous friction
• Gearbox backlash (model adapted from Jukic and Peric (2001))
• Sensor noise and quantisation
• Static load torque coupling between joints
In order to verify all of the parameters, and ultimately the Simulink model, experiments were conducted to compare the performance of the actual and modelled systems. The Bode plot of the open-loop input (current command from the controller output) to output (robot joint position) transfer function of the plant was generated. This was then compared with the Bode plot of the linearised Simulink plant model at the same analysis points. The plant in this case comprises all components from the input of the microcontroller main board to the actuator position output as shown in Figure 5.9.
In order to obtain the input to output transfer function behaviour of the plant, sinusoidal signals of varying frequencies were applied to the position reference input of the entire closed-loop system at the PID controller summing junction input, and the plant position output was measured. The sinusoidal excitation frequency range was from 2.2 rad/s to 22 rad/s. The Ziegler-Nichols closed-loop PID tuning rule was used to achieve stable system behaviour before this test. The magnitude and phase relationship between the input and output was used to generate the Bode plots given in Figure 5.10.
The Bode plot shows that the Simulink model’s behaviour is close to the physical system’s behaviour, which means the Simulink model is sufficiently accurate to be used for controller design and system simulation (behaviour prediction). The slight difference between the physical system and the model in terms of phase shows that there is a small delay in the real system that has not been accounted for in the model.
5.3.3 PID controller tuning
Once a verified model of the robot has been created, a linearised version can be used to tune the PID controller using MATLAB’s SISOTool. SISOTool (single-input-single-output tool) can be used to create controllers and filters for a given system using graphical techniques. In the case of the PLIR, the graphical tuning tools of interest were:
• Nichols chart - stability analysis
• Bode plot - input/output relationship
• Step response - system performance
The PID controller parameters were designed so that the system had satisfactory gain and phase margins, with sufficient performance. The open-loop Nichols chart, closed-loop Bode plot, and
Figure 5.10: Bode response of physical and modelled systems.
closed-loop step response of the system are given in Figure 5.11, Figure 5.12 and Figure 5.13 respectively. The frequency labels in Figure 5.11 are in rad/s. The PID controller parameters can be found in Appendix A.2. The transfer function of the PID controller is given in series form in (5.1) and is implemented in discrete-time form on the robot’s on-board PC. Ti is the integrator time constant, Tdis the derivative time constant and kp is the proportional controller gain.
G(s) = kp
sTi+ 1 sTi
sTd+ 1 sTdα+ 1
(5.1) As shown in Figure 5.12, a prefilter was used to remove unnecessary high frequency gain to reduce the likelihood of exciting any mechanical/electronic resonant frequencies. The prefilter is placed before the summing junction input, as shown in Figure 5.14. It is a first order low pass filter with a corner frequency of 40 rad/s. The transfer function of the filter is given by Fpre(s) = s+4040 . The controller design provides good system performance and stability as shown in Figure 5.13.