2016
Robotics and Manufacturing Automation MN5552 1446800
Brunel University 12/02/2016 1
CONTENT 1.
Introduction .................................................................................................................................. 7 1.1.
Initial Assumptions ................................................................................................................ 7
2.
Objectives ..................................................................................................................................... 8
3.
Formulation .................................................................................................................................. 8 3.1. Type of the manipulator's work envelope ................................................................................. 8 3.2. Manipulator configuration ......................................................................................................... 9 3.2.1. Error measuring device and feedback signal ..................................................................... 10 3.2.2. Amplifier ........................................................................................................................... 11 3.2.3. Motor ................................................................................................................................ 12 3.2.4. Gear Train of the revolute joint......................................................................................... 13 3.2.5. Gear Train of the prismatic joint ....................................................................................... 14 3.3. Transfer Function of the revolute joint (Servo System 0)......................................................... 14 3.3.1. Inductance Analysis ........................................................................................................... 18 3.4. Transfer Function of the prismatic joint (Servo System 1) ....................................................... 20 3.5. Matlab Program ....................................................................................................................... 21 3.5.1. Revolute joint (Servo System 0) ........................................................................................ 24 3.5.2. Prismatic joint (Servo System 1) ........................................................................................ 26 3.6. Design a control system for the drives of the joints ................................................................. 28 3.6.1. Revolute Joint (Servo System 0) ........................................................................................ 28 3.6.2. Prismatic Joint (Servo System 1) ....................................................................................... 33 3.7. Arbitrary signals ....................................................................................................................... 36 3.7.1. Reference signal 1 ............................................................................................................. 36 3.7.2. Reference Signal 2 ............................................................................................................. 39 3.7.3. Reference Signal 3 ............................................................................................................. 42
Conclusion .......................................................................................................................................... 44 Appendix............................................................................................................................................. 45
2
INDEX OF FIGURES
Figure 1. Robotic Arm Scheme .............................................................................................................. 7 Figure 2. Hollow cylinder as the work envelope shape ......................................................................... 9 Figure 3. Manipulator with articulated arms ........................................................................................ 9 Figure 4. Schematic diagram for both drivers ..................................................................................... 10 Figure 5. Operational Amplifier noninverting ..................................................................................... 11 Figure 6. Gear train of the revolute joint ............................................................................................ 13 Figure 7. Gear train of the prismatic joint ........................................................................................... 14 Figure 8. Block diagram of the servo system 0 .................................................................................... 15 Figure 9. Armature Circuit of a servo motor ....................................................................................... 16 Figure 10. Transfer function for the servo system 0 ........................................................................... 17 Figure 11. Simplified Transfer Function for the servo system 0 .......................................................... 19 Figure 12. Transfer function for the servo system 1 ........................................................................... 20 Figure 13. Simplified Transfer Function for the servo system 1 .......................................................... 21 Figure 14. Step-Response for the revolute joint ................................................................................. 24 Figure 15. Poles and zeros of the revolute joint in closed-loop .......................................................... 25 Figure 16. . Step-Response for the prismatic joint .............................................................................. 26 Figure 17. Poles and zeros of the revolute joint in closed-loop .......................................................... 27 Figure 18. Graphic proof of the second conventional method of Z-N for the revolute joint .............. 28 Figure 19. Step response of the System 0 by applying custom parameters ........................................ 32 Figure 20. Graphic proof of the second conventional method of Z-N for the prismatic joint ............. 33 Figure 21. Step response of the System 1 by applying custom parameters ........................................ 35 Figure 22. Simulink model................................................................................................................... 36 Figure 23. Reference Signal 1 .............................................................................................................. 37 Figure 24. Response of the revolute joint to the reference signal 1 ................................................... 37 Figure 25. Error of the servo system 0 in steady state by applying the reference signal 1 ................. 38 Figure 26. Response of the prismatic joint to the reference signal 1 .................................................. 38 Figure 27. Error of the servo system 1 in steady state by applying the reference signal 1 ................. 39 Figure 28. Reference Signal 2 .............................................................................................................. 39 Figure 29. Response of the revolute joint to the reference signal 2 ................................................... 40 Figure 30. Error of the servo system 0 in steady state by applying the reference signal 2 ................. 40
3
Figure 31. Response of the prismatic joint to the reference signal 2 .................................................. 41 Figure 32. Error of the servo system 1 in steady state by applying the reference signal 2 ................. 41 Figure 33. Reference Signal 3 .............................................................................................................. 42 Figure 34. Response of the revolute joint to the reference signal 3 ................................................... 42 Figure 35. Error of the servo system 0 in steady state by applying the reference signal 3 ................. 43 Figure 36. Response of the prismatic joint to the reference signal 3 .................................................. 43 Figure 37. Error of the servo system 1 in steady state by applying the reference signal 3 ................. 44 Figure 38. Step-Response for the revolute joint ................................................................................. 47 Figure 39. Original system vs. System with Z-N PID ............................................................................ 47
4
INDEX OF TABLES
Table 1. Specification dc servo motor type M66CE-12 ....................................................................... 12 Table 2. Parameters of the servo systems .......................................................................................... 21 Table 3. Results of different tuning methods of controllers applied to the revolute joint .................. 30 Table 4. Results of different tuning methods of controllers applied to the prismatic joint ................ 34 Table 5. Original system vs. System with Z-N PID ............................................................................... 48
5
INDEX OF EQUATIONS
Equation 1. Error of position ............................................................................................................... 10 Equation 2. Relation between the error of voltage and the error of position .................................... 10 Equation 3. Gain of the operational amplifier noninverting ............................................................... 11 Equation 4. Relation between the position of the output shaft and the position of the motor shaft 13 Equation 5. Relation between the output shaft position and the vertical displacement .................... 14 Equation 6. Transfer function in open loop for the servo system 0 .................................................... 15 Equation 7. Relation between the position of the motor shaft and the voltage error. ....................... 17 Equation 8. Complex impedance of the servo motor ......................................................................... 18 Equation 9. Transfer function for the servo system 0 ......................................................................... 18 Equation 10. Variables J, B, and K ....................................................................................................... 19 Equation 11. Transfer function for the servo system 1 ....................................................................... 20 Equation 12. Variables J1, B1, and K1 ................................................................................................... 20 Equation 13. Transfer Function in closed loop of the servo system 0 ................................................. 24 Equation 14. Transfer Function in closed loop of the servo system 1 ................................................. 26 Equation 15. Transfer Function in open loop of the servo system 0 ................................................... 29 Equation 16. PID controller applied to the revolute joint ................................................................... 31 Equation 17. Transfer Function in open loop of the servo system 1 ................................................... 33 Equation 18. PID controller applied to the prismatic joint .................................................................. 34
6
1. Introduction
In this assignment, a robotic arm will be analysed. This robotic manipulator has a revolute and a prismatic joint, as shown in Figure 1. When the gripper is at the initial position; it is assumed that the end effector is at the same height with link1. Additionally, it is assumed that the tool tip can reach ground level. Therefore, the length of link2 is 450mm. Firstly, at Section 3.1 the type of the manipulator's work envelope will be described. Secondly, at Section 3.2 the configuration of the selected joint drives will be studied. Later, the transfer function of the revolute joint and prismatic joint will be developed in Section 3.3 and 3.4 respectively. Next, the step response of each joint driver will be analysed by using Matlab at Section 3.5. Afterwards, at Section 3.6 will perform a control system for each of the joint drivers by using Matlab and LabVIEW. Finally, at Section 3.7 will simulate the system response when applying the controller, by using the three reference signals.
Figure 1. Robotic Arm Scheme
1.1. Initial Assumptions
When the end effector is placed on the object it immediately grabs the object. Hence, this assignment does not take into account any delay due to gripper operation. This paper does not consider in controlling the gripping action for the gripper, only the 7
placement of the gripper to the desired position. The weights and inertia of the links are negligible, so all the force or torque generated by the drives is used for movement.
2. Objectives
Understand the criticality and importance of automation and robotics in the modern industrial environment Critically analyse automated manufacturing equipment and specify suitable approaches for control Evaluate and justify an automated system Understand the issues in modelling and controlling automated equipment Apply a suitable modelling tool (MATLAB) to model and control a system
3. Formulation
3.1. Type of the manipulator's work envelope
The system is composed of seven parts: Base = reference frame Link 1 Vertex 1 Link 2 Joint 0 = Revolute joint Joint 1 = Prismatic joint Gripper The base is connected to the Link 1 through the Joint 0. This joint allows the Link 1 to rotate 360º about the vertical axis of the base. Additionally, the Link 1 is composed of two parts: a horizontal stick and a vertical stick, both connected by means the Vertex 1 of 90º. However, unlike Joint 0, the Vertex 1 is static. In other words, neither angular nor linear movements are allowed. Consequently, 8
the system describes a circular movement about the z0 axis with 450mm of height and 300 mm of radio. This movement creates a hollow cylinder as the work envelope shape. As a result, there is a cylindrical dead zone around the robot structure which the end tool cannot reach, as shown in Figure 2. Furthermore, the Link 1 is connected to the Link 2 through a prismatic joint, Joint 1 allows the gripper to move up and down. The maximum vertical distance the end-tool can reach is the vertical length of Link 1 (450 mm). This linear motion enables the gripper tool to reach the ground level. The combined movement of the two joints allows performing a pick and placing operation. An example of application is the manipulator with articulated arms MaxiPartner MX of the Italian Company Dalmec S.p.A, as shown in Figure 3, which is equipped with special gripping tools, is suitable to handle heavy (max 900 kg) and also off-set loads, in any direction, allowing the operator to work with the minimum effort in good ergonomic and safety conditions (Dalmec S.p.A., 2016).
Figure 2. Hollow cylinder as the work envelope shape
Figure 3. Manipulator with articulated arms
3.2. Manipulator configuration
The aim of the project is to control the position in accordance with a reference. Figure 4 depicts the system for both drivers. Both joints are analysed using the same scheme. The only difference between the two systems appears in the gear train; since the prismatic joint employs a 9
rack and pinion driver to convert angular motion to linear displacement. In any case, the servo system has five parts: error measuring device, amplifier, motor and the gear train and the load (Ogata, 2010).
Figure 4. Schematic diagram for both drivers
3.2.1. Error measuring device and feedback signal
The error measuring device consists of two potentiometers; they convert the input and output positions into electric signals. The potentiometer ‘r’ is the input reference position to the system and the potentiometer ‘c’ is the output shaft position (from the feedback). The difference between ‘r’ and ‘c’ is the error of position ‘e’. The feedback signal comes from a rotary encoder (shaft encoder). Furthermore, it is assumed that the gain of the feedback is 1.
𝑒 =𝑟−𝑐
(1)
Equation 1. Error of position
The error of voltage is proportional to the error of position. 𝑒𝑣 = 𝐾0 (𝑟 − 𝑐) 𝑒𝑣 = 𝐾0 𝑒
(2)
Equation 2. Relation between the error of voltage and the error of position
10
Where: 𝑒𝑣 : Error of voltage 𝐾0 : Proportionality constant = 1
3.2.2. Amplifier
The chosen servo motor (M66CE-12 of Farnell) uses the MSE421 amplifier, which can be depicted by using operational amplifiers as displayed in Figure 5 and Equation 3. The output voltage of this amplifier 𝑒𝑎 is applied to the armature circuit of the servo motor. This paper will assume a gain of 5.
Figure 5. Operational Amplifier noninverting
𝑒𝑎 = 𝐾1 . 𝑒𝑣
(3)
Equation 3. Gain of the operational amplifier noninverting
Where: 𝑒𝑎 : Voltage of armature 𝐾1 : Gain of the amplifier = 5
11
3.2.3. Motor
The rotary actuator used is a servo-motor; it allows to control angular or linear position (servo motors also permit control of velocity and acceleration. However, this paper just considers the control of position). It consists of a motor coupled to a sensor for position feedback (shaft encoder). Choosing a servo motor as the actuator of the robotic arm is based on the next statements.
When 𝑒𝑣 ≠ 0; the motor rotates to bring the output shaft to the appropriate position in such a way as to reduce the error to zero.
Servo motors have three characteristics: strength, speed, and low inertia. For this reason, they are used in applications of robotic arms or CNC machines.
Although a stepper motor would have been the first option to control the position; normally they do not have feedback; this fact limits its applications to work with controllers. However, in recent years, some manufacturers as Fastech Company from Korea, have developed closed loop stepping systems having better performance than the servo systems (Fastech Co., Ltd., 2014). The servo motor selected is the M66CE-12 of Farnell that has a high performance and low inertia. Its characteristics are displayed in Table 1.
Table 1. Specification dc servo motor type M66CE-12
Source. (Farnell element14, 2013)
12
Where: J0: Moment of inertia referred to the motor shaft = 0.0214 Kg.m2 b0: Viscous-friction coefficient referred to the motor shaft = 0.1 N.m.s K2: Torque constant = 0.041
𝑁.𝑚 𝐴 𝑉
K3: Back emf constant = 0.041 𝑟𝑎𝑑
⁄𝑠
3.2.4. Gear Train of the revolute joint
It has been assumed that the gear ratio is such that the output shaft rotates 2 times for each revolution of the motor shaft, as depicted in the Equation 4. Figure 6 shows the revolute joint developed with spur gears.
𝑛=
𝐶 θ
=
𝑟𝑐 𝑟𝜃
(4)
Equation 4. Relation between the position of the output shaft and the position of the motor shaft
Where: c : Angular position of the output shaft θ : Angular position of the motor shaft 𝑟𝐶 : Ratio of the output shaft kgm2 𝑟𝜃 : Ratio of the motor shaft
Figure 6. Gear train of the revolute joint
13
3.2.5. Gear Train of the prismatic joint
To convert angular motion to linear displacement, a rack and pinion driver has been designed. It has been assumed that the ratio of the output shaft (𝑟𝑐 ) is 18 mm, as displayed in Figure 7.
Figure 7. Gear train of the prismatic joint
For instance, if the output shaft turns 19.44 radians, the gripper will reach a linear position of 350 mm as shown in the Equation 5. 𝑑 = 𝑐 × 𝑟𝑐 𝑑 = 19.44 × 18 𝑑 = 350 𝑚𝑚 Equation 5. Relation between the output shaft position and the vertical displacement
3.3. Transfer Function of the revolute joint (Servo System 0)
The aim of this section is to relate the input reference position to the output shaft position. Therefore, the cascaded procedure will be applied to obtain the TF. Figure 8 and Equation 6 represent the TF for the servo system 0.
14
Figure 8. Block diagram of the servo system 0
𝐺(𝑠) =
𝐶(𝑠) 𝜃(𝑠) 𝑒𝑣(𝑠) × × 𝜃(𝑠) 𝑒𝑣(𝑠) 𝑒(𝑠)
Equation 6. Transfer function in open loop for the servo system 0
The Equation 1 joins the error of position with the difference between the input reference position and the output shaft position. The Equation 2 relates the error of voltage and the error of position. Moreover, the Equation 4 links the position of the output shaft and the position of the motor shaft. Hence, the only relation missing is the position of the motor shaft with the error of voltage.
Figure 9 exhibits the armature circuit of a servo motor. When the armature is rotating, a proportional voltage to the product of the flux and angular velocity is induced in the armature. For a constant flux, the induced voltage 𝒆𝒃 is directly proportional to the angular velocity, as follows:
𝑒𝑏 = 𝐾3
𝑑𝜃 𝑑𝑡
(5)
Where: 𝑒𝑏 : back electromotive force (emf) 𝐾3 : back emf constant
15
Figure 9. Armature Circuit of a servo motor
Applying the Ohm law to the armature circuit: 𝐿𝑎
𝑑𝑖𝑎 𝑑𝑡
+ 𝑅𝑎 𝑖𝑎 + 𝑒𝑏 = 𝑒𝑎
(6)
(3) and (5) in (6) 𝐿𝑎
𝑑𝑖𝑎 𝑑𝑡
+ 𝑅𝑎 𝑖𝑎 + 𝐾3
𝑑𝜃 𝑑𝑡
= 𝐾1 𝑒𝑣
Applying the Laplace Transformation: ℒ (𝐿𝑎
𝑑𝑖𝑎 𝑑𝜃 + 𝑅𝑎 𝑖𝑎 + 𝐾3 = 𝐾1 𝑒𝑣 ) 𝑑𝑡 𝑑𝑡
𝐿𝑎 (𝑠𝑖𝑎(𝑠) − 𝑖𝑎(𝑠) ) + 𝑅𝑎 𝑖𝑎(𝑠) + 𝐾3 (𝑠𝜃(𝑠) − 𝜃(0) ) = 𝐾1 𝑒𝑣
Applying initial conditions: 𝑖𝑎(0) = 0 𝜃(0) = 0 𝑠𝐿𝑎 𝑖𝑎(𝑠) + 𝑅𝑎 𝑖𝑎(𝑠) + 𝑠𝐾3 𝜃(𝑠) = 𝐾1 𝑒𝑣(𝑆)
(7)
Additionally, the equation for the torque equilibrium is: 𝐽0
𝑑2 𝜃 + 𝑑𝑡 2
𝑏𝑜
𝑑𝜃 𝑑𝑡
=𝑇
(8)
For constant field current, the torque developed by the motor is:
16
𝑇 = 𝐾2 𝑖𝑎
(9)
(9) in (8) 𝐽0
𝑑2𝜃 𝑑𝜃 + 𝑏0 = 𝐾2 𝑖𝑎 2 𝑑𝑡 𝑑𝑡
Applying Laplace Transformation: 𝑑2𝜃 𝑑𝜃 ℒ (𝐽0 2 + 𝑏0 = 𝐾2 𝑖𝑎 ) 𝑑𝑡 𝑑𝑡 𝐽𝑜 (𝑠2 𝜃(𝑠) − 𝑠𝜃(0) − 𝜃(0) ) + 𝑏0 (𝑠𝜃(𝑠) − 𝜃(0) ) = 𝐾2 𝑖𝑎(𝑠) Applying initial conditions: 𝑠2 𝐽𝑜 𝜃(𝑠) + 𝑠𝑏0 𝜃(𝑠) = 𝐾2 𝑖𝑎(𝑠) 𝑖𝑎(𝑠) =
𝑠 2 𝐽0 𝜃(𝑠) +𝑠𝑏0 𝜃(𝑠) 𝐾2
(10)
(10) in (7) 𝜃(𝑠) 𝐾1 𝐾2 = )(𝑠𝐽 𝑒𝑣(𝑠) 𝑠(𝐿𝑎 𝑠 + 𝑅𝑎 0 + 𝑏0 ) + 𝑠𝐾2 𝐾3 Equation 7. Relation between the position of the motor shaft and the voltage error.
Figure 10 depicts the TF for the servo system 0
Figure 10. Transfer function for the servo system 0
17
3.3.1. Inductance Analysis
Considering Figure 9, the complex impedance can be expressed in polar form as follows: 𝑍 = |𝑍|𝑒 𝑗𝜑 Equation 8. Complex impedance of the servo motor
Where: |𝑍| = √𝑅𝑎 2 + 𝜔 2 𝐿𝑎 2 𝜑 = tan−1
𝜔𝐿𝑎 𝑅𝑎
Z: complex impedance ω: angular velocity = 2πf La: Inductance of armature = 0.00001 H Replacing values: |𝑍| = √1.92 + (2𝜋 × 50)2 × 0.000012 |𝑍| = 1.900003 Ω 𝜑=
2𝜋 × 50 × 0.00001 1.9 𝜑 = 0.0003°
By analysing the values, the complex impedance is equal to the resistance of armature. Consequently, the inductance of armature is very small and can be neglected. Thus, the TF is expressed as follows
𝐺(𝑠) =
𝐾0 𝐾1 𝐾2 𝑛 (𝐽 𝑠(𝑅𝑎 0 𝑠 + 𝑏0 ) + 𝐾2 𝐾3 )
Equation 9. Transfer function for the servo system 0
𝐺(𝑠) =
𝑛𝐾0 𝐾1 𝐾2 𝑅𝑎 𝑠 ((𝐽0 𝑠 + 𝑏0 ) +
𝐾2 𝐾3 ) 𝑅𝑎
18
𝐺(𝑠)
𝑛𝐾0 𝐾1 𝐾2 𝑅𝑎 = 𝐾𝐾 𝐽0 𝑠 2 + (𝑏0 + 2 3 ) 𝑠 𝑅𝑎
𝐺(𝑠)
𝐾0 𝐾1 𝐾2 𝑛𝑅𝑎 = 𝐾2 𝐾3 𝐽0 2 𝑏0 + 𝑅𝑎 𝑠 + 𝑠 𝑛2 𝑛2
If the new variables J, B, and K are defined as in the Equation 10; the TF is expressed as in Figure 11. 𝐽=
𝐽0 𝑛2 𝐾2 𝐾3 𝑅𝑎 2 𝑛
𝑏0 + 𝐵=
𝐾=
𝐾0 𝐾1 𝐾2 𝑛𝑅𝑎
Equation 10. Variables J, B, and K
Where: J: Moment of inertia referred to the to the output shaft B: Viscous friction coefficient referred to the output shaft
Figure 11. Simplified Transfer Function for the servo system 0
19
3.4. Transfer Function of the prismatic joint (Servo System 1)
The TF for the prismatic joint is very similar to the revolute joint. However, the output of the prismatic joint is not an angular position, but it is a linear displacement. The Equation 5 links the output shaft position with the vertical displacement of the gripper. Figure 12 and Equation 11 depict the TF for the servo system 1
Figure 12. Transfer function for the servo system 1
𝐺(𝑠) =
𝐾0 × 𝐾1 × 𝐾2 × 𝑛 × 𝑟𝑐 𝑠(𝑅𝑎 (𝐽0 𝑠 + 𝑏0 ) + 𝐾2 𝐾3 )
Equation 11. Transfer function for the servo system 1
If the new variables J1, B1, and K1 are defined as the Equation 12; the TF is expressed as in Figure 13. 𝐽1 =
𝐽0 2 𝑛 𝑟𝑐 2 𝐾2 𝐾3 𝑅𝑎 2 𝑛 𝑟𝑐 2
𝑏0 + 𝐵1 =
𝐾1 =
𝐾0 𝐾1 𝐾2 𝑛 × 𝑅𝑎 × 𝑟𝑐
Equation 12. Variables J1, B1, and K1
20
Figure 13. Simplified Transfer Function for the servo system 1
3.5. Matlab Program
This section will be performed stability analysis and transient response. Table 2 displays the parameters of both servo systems.
Table 2. Parameters of the servo systems
Servo System 0
Servo System 1
Parameters
Revolute Joint
Prismatic Joint
𝐽0
0.0214 Kg.m2
0.0214 Kg.m2
𝑏0
0.1 N.m.s
0.1 N.m.s
𝑅𝑎
1.9 Ω
1.9 Ω
𝐾0
1
1
𝐾1
5
5
𝐾2
𝑁. 𝑚 𝐴 𝑉 0.041 𝑟𝑎𝑑⁄ 𝑠
𝑁. 𝑚 𝐴 𝑉 0.041 𝑟𝑎𝑑⁄ 𝑠
𝑛
2
2
𝑟𝐶
_
17.9 mm
𝐾3
0.041
0.041
%1446800 %Robotic and Manufacturing Automation %Servo system M66CE-12 %Data v=input('press "p" for prismatic joint or "r" for revolute joint: ','s'); if v=='r' %revolute joint Jo=0.0214; bo=0.1; Ra=1.9;
%inertia of the motor referred to the motor shaft %viscous-friction referred to the motor shaft %Resistance of armature
21
ko=1; k1=5; k2=0.041; k3=0.041; n=2;
%constant of error %gain of the amplifier %motor torque constant %back emf constant of the motor %gear ratio
K=(ko*k1*k2)/(n*Ra); J=Jo/n^2; %moment of inertia referred to the output shaft B=(bo+(k2*k3)/Ra)/n^2; %viscous-friction referred to the output shaft %TF num=[K]; den=[J B 0]; Gp=tf(num,den); H=1; Sys=feedback(Gp,H) figure (1) step(Sys) grid title ('Step-Response xlabel('t Sec') ylabel('Output')
%open loop TF %feedback %closed-loop TF %unit step response for the revolute joint')
%Transient response Z=B/(2*sqrt(J*K)); Wn=sqrt(K/J); Wd=Wn*sqrt(1-(Z^2));
%damping ratio %undamped natural frequency %damped natural frequency
tr=(pi-atan(Wd/(Z*Wn)))/Wd; tp=pi/Wd; Mp=exp(-(Z/sqrt(1-Z^2))*pi); ts=4/(Z*Wn);
%rise time %peak time %maximum overshoot %settling time 2% criterion
%Stability analysis if Z>1 dynamic_behavior='Overdamped case'; end if Z==1 dynamic_behavior='Critically damped case'; end if Z<1 dynamic_behavior='Underdamped case'; end figure(2) pzmap(Sys) %poles and zeros map in closed-loop title('poles and zeros of revolute joint in closed-loop') grid gtext(dynamic_behavior) end if v=='p' Jo=0.0214; bo=0.1; Ra=1.9;
%prismatic joint %inertia of the motor referred to the motor shaft %viscous-friction referred to the motor shaft %Resistance of armature
22
ko=1; k1=5; k2=0.041; k3=0.041; n=2; rc=112.5/(2*pi);
%constant of error %gain of the amplifier %motor torque constant %back emf constant of the motor %gear ratio %ratio of the output shaft
K=(ko*k1*k2)/(n*rc*Ra); J=Jo/(n*rc)^2; B=(bo+(k2*k3)/Ra)/(n*rc)^2;
%inertia referred to the output shaft %viscous referred to the output shaft
%TF num=[K]; den=[J B 0]; Gp=tf(num,den); H=1; Sys=feedback(Gp,H) figure (1) step(Sys) grid title ('Step-Response xlabel('t Sec') ylabel('Output')
%open loop TF %feedback %closed-loop TF %unit step response for the prismatic joint')
%Transient response Z=B/(2*sqrt(J*K)); Wn=sqrt(K/J); Wd=Wn*sqrt(1-(Z^2));
%damping ratio %undamped natural frequency %damped natural frequency
tr=(pi-atan(Wd/(Z*Wn)))/Wd; tp=pi/Wd; Mp=exp(-(Z/sqrt(1-Z^2))*pi); ts=4/(Z*Wn);
%rise time %peak time %maximum overshoot %settling time 2% criterion
%Stability analysis if Z>1 dynamic_behavior='Overdamped case'; end if Z==1 dynamic_behavior='Critically damped case'; end if Z<1 dynamic_behavior='Underdamped case'; end figure(2) pzmap(Sys) %poles and zeros map in closed-loop title('poles and zeros of the prismatic joint in closed-loop') grid gtext(dynamic_behavior) end
23
3.5.1. Revolute joint (Servo System 0)
The Equation 13 represents the TF in closed loop with feedback equal to 1.
𝑆𝑦𝑠 =
0.05395 0.00535𝑠2 + 0.02522𝑠 + 0.05395
Equation 13. Transfer Function in closed loop of the servo system 0
3.5.1.1. Transient Response
The system is underdamped, as the damping ratio ζ = 0.7423. Consequently, the transient response is oscillatory. Additionally, this type of systems gets close to the final value more rapidly than a critically damped or overdamped system. Figure 14 exhibits the response curve when a unit step is applied to the TF in close loop.
Figure 14. Step-Response for the revolute joint
Based on Figure 14, the system requires 0.712 seconds to rise from 10% to 90% of its final value. Additionally, it takes 1.83 seconds to reach and stay within about 2% of its final value. Finally,
24
the maximum overshoot (𝑀𝑝 ) occurs within 1.48 seconds, with a value of 3.08%. It can be concluded that not only the system is too slow in reaching the steady state (3 seconds approximately), but also 𝑀𝑝 will generate problems for a robotic arm application. Therefore, a controller needs to be implemented to enhance the transient response.
3.5.1.2. Stability Analysis
According to the Figure 15, the closed-loop poles are complex conjugates and lie in the left-half s plane. 𝑝1 = −2.3571 + 𝑗2.1278 𝑝2 = −2.3571 + 𝑗2.1278
Figure 15. Poles and zeros of the revolute joint in closed-loop
Applying the criterion of the location of the closed-loop poles in the s plane; since all closedloop poles lie to the left of the axis jω, the transient response eventually reaches equilibrium (3 seconds). Consequently, the servo motor 0 represents a stable system.
25
A further analysis can be carried out by applying The Linear System Analyzer Tool in Matlab. This tool not only permits to study the Root-Locus Method but also Nyquist Stability Criterion, by typing >> ltiview in the command window.
3.5.2. Prismatic joint (Servo System 1)
The Equation 14 represents the TF in closed loop with feedback equal to 1.
𝑆𝑦𝑠 =
1.669
× 10−5 𝑠2
0.003013 + 7.867 × 10−5 𝑠 + 0.003013
Equation 14. Transfer Function in closed loop of the servo system 1
3.5.2.1. Transient Response
The system is underdamped, as the damping ratio ζ = 0.1754. Consequently, the transient response is oscillatory. Figure 16 exhibits the response curve when a unit step is applied to the TF in close loop.
Figure 16. . Step-Response for the prismatic joint
26
Based on Figure 16, the system requires 0.089 seconds to rise from 10% to 90% of its final value. Additionally, it takes 1.5 seconds to reach and stay within about 2% of its final value. Finally, 𝑀𝑝 occurs within 0.234 seconds, with amplitude of 57.1%. In the same manner of the revolute joint, not only the system is too slow in reaching the steady state (2.5 seconds approximately), but also 𝑀𝑝 is unacceptable.
3.5.2.2. Stability Analysis
According to the Figure 17, the closed-loop poles are complex conjugates and lie in the left-half s plane. 𝑝1 = −2.3571 + 𝑗13.2284 𝑝2 = −2.3571 − 𝑗13.2284
Figure 17. Poles and zeros of the revolute joint in closed-loop
Applying the criterion of the location of the closed-loop poles in the s plane; since all closedloop poles lie to the left of the axis jω, the transient response eventually reaches equilibrium (2.5 seconds). Consequently, the servo motor 1 represents a stable system.
27
3.6. Design a control system for the drives of the joints
In this section the classic Ziegler-Nichols (Z-N) method for tuning PID will be analysed. This procedure has two ways to be applied; the first way is used if the plant involves neither integrator nor dominant complex-conjugate poles. Besides, the second way can be employed if the output exhibits sustained oscillations for whatever value of proportional gain (Kp) may take (Åström & Hägglund, 2004).
3.6.1. Revolute Joint (Servo System 0)
The plant has an integrator, as shown in the Equation 15. Additionally, the plant contents dominant complex-conjugate poles. As a result, the first conventional method cannot be used. Figure 18 illustrates the output signals by applying Kp = [2, 4, 6, 8, 10, 12]. Regardless of the values of Kp; the amplitude decreases over time. In other words, the output does not exhibits sustained oscillations, as there are not closed-loop poles on the jω axis. Consequently, the revolute joint (Servo System 0) satisfies neither the requirements for the first conventional method nor the conditions for the second conventional method
Figure 18. Graphic proof of the second conventional method of Z-N for the revolute joint
28
Note:
A Matlab code has been developed in the Appendix A to show the results if the first classic method is applied to the servo system 0. Although was proofed that the classic Z-N procedures should not be used.
3.6.1.1. The Control and Estimation tool Manager in Matlab
The classic Z-N method is not the only way to tune controllers; Matlab offers the Control and Estimation tool Manager, which contains four well-known methods to tune controllers (MathWorks, 2015) Robust Approximate MIGO Chien, Hrones & Reswick Skogestad IMC (Skogestad, 2002) According to the transient response, the system is too slow and the level of Mp (3.08%) is unacceptable in applications of robotics and fine movements. For these reasons, the Control and Estimation tool Manager will be run to enhance those parameters; by typing >> sisotool(G0) in the command window, where:
𝐺0 =
0.05395 𝑠(0.00535𝑠 + 0.02522)
Equation 15. Transfer Function in open loop of the servo system 0
Within the Automated Tuning option is possible to select any design method of controllers. Moreover, Table 3 shows the results of the four tuning methods, applied to the revolute joint.
29
Table 3. Results of different tuning methods of controllers applied to the revolute joint Tuning method
Type of Rise time Peak time Overshoot Settling time Steady State controller seconds seconds % seconds seconds
Original system
Robust
Approximate MIGO Chien Hrones Reswick Skogestad IMC Custom Parameters
0.71
1.48
3.08
1.83
3
P
0.49
1.04
8.77
1.55
2.5
PI
0.55
1.18
8.08
1.91
2.5
PD
0.16
0.34
9.21
0.53
0.7
PID
0.16
0.34
9.08
0.52
0.7
P
1.14
2.99
0.09
1.87
3
PI
0.74
1.96
18.1
6.81
10
PID
1.85
4.75
38.7
19.4
30
P
1.14
2.99
0.09
1.87
3
PI
0.4
1.08
43.5
2.96
4
PID
0.32
0.82
39.2
3.1
4.5
P
34.1
> 90
0
60.9
90
PI
0.18
0.47
44.6
2.4
3.5
PID
0.19
0.44
13.3
1.72
6
PID
0.1
0.32
0.56
0.17
0.32
Gain Kp
Ki
1.271
0.05378
10.271
0.05378
Kd
2
By analysing the Table 3, there are two tuning methods providing 𝑀𝑝 almost zero; the AMIGO and Chien-Hrones-Reswick proportional controllers. However, they take almost 3 second to reach the steady stable. Thus, the best method is a PI robust control, resulting: 𝑀𝑝 = 8.08% Steady state time (SST) = 2.5 s However, by applying a PI robust control, 𝑀𝑝 is still high and the new system is only 0.5 seconds faster than previous one. Consequently, custom parameters will be configured to enhance the system response, using LabVIEW.
3.6.1.2. Bonus (LabVIEW)
Based on the responses obtained by applying the robust PI controller, the system can be further improved by modifying the controller variables. There are three enhancement methods Root-Locus approach
30
Frequency response approach Controller gains approach At this paper, the controller gains have been modified manually by using LabVIEW, as presented in Figure 19. Additionally, the last row of Table 3 presents the result by applying custom parameters to the servo system 0. In this case, the system is overdamped, in other words, it will not oscillate. Thus, the peak time (𝑡𝑝 ) is equal to the SST. In conclusion, by applying the parameters computed in LabVIEW; 𝑀𝑝 was reduced near 14 times and SST was narrowed about 8 times. Finally, the Equation 16 represents the applied controller to the revolute joint. 𝑀𝑝 = 0.56% SST = 0.32 s 𝐾𝑑 𝑠2 + 𝐾𝑝 𝑠 + 𝐾𝑖 𝐶0 = 𝑠 𝐶0 =
2𝑠2 + 10.271𝑠 + 0.05378 𝑠
Equation 16. PID controller applied to the revolute joint
31
Figure 19. Step response of the System 0 by applying custom parameters
32
3.6.2. Prismatic Joint (Servo System 1)
Like the previous case, the servo system 1 does not meet the classic Z-N method requirements, since the plant has an integrator, as shown in the Equation 17. Moreover, the output does not exhibit sustained oscillations for any value that Kp may take as shown in Figure 20. Therefore, the conventional Z-N procedure cannot be applied.
Figure 20. Graphic proof of the second conventional method of Z-N for the prismatic joint
As not only the system is too slow in reaching the steady state, but also 𝑀𝑝 is unacceptable (57.1%); the effects of some controllers has been studied by applying The Control and Estimation tool Manager, whose characteristics are presented in the Table 4.
𝐺1 =
0.003013 𝑠(1.669 × 10−5 𝑠 + 7.867 × 10−5 )
Equation 17. Transfer Function in open loop of the servo system 1
33
Table 4. Results of different tuning methods of controllers applied to the prismatic joint Tuning method Original system
Robust
Approximate MIGO Chien Hrones Reswick Skogestad IMC Custom Parameters
Gain
Type of Rise time Peak time Overshoot Settling time Steady State controller seconds seconds % seconds seconds 0.09
0.23
57.1
1.5
2.5
P
0.49
1.04
8.77
1.55
2.5
PI
0.55
1.18
8.08
1.91
2.5
PD
0.16
0.34
9.21
0.53
0.7
PID
0.16
0.34
9.08
0.52
0.7
P
1.14
2.99
0.09
1.87
3
PI
0.74
1.96
18.1
6.81
10
PID
1.85
4.75
38.7
19.4
30
P
1.14
3
0.09
1.87
3
PI
0.4
1.08
43.5
2.96
4
PID
0.32
0.82
39.2
3.1
4.5
P
34.1
> 90
0
60.9
90
PI
0.18
0.47
44.6
2.4
3.5
PID
0.19
0.44
13.3
1.72
6
PID
0.01
0.02
0.08
0.01
0.02
Kp
Ki
0.07096
0.003004
10.07096
0.003004
Kd
2
It can be seen that the most favourable outcome is achieved by applying a proportionalintegrative robust control. However, 𝑀𝑝 and SST are still out of control 𝑀𝑝 = 8.08% SST = 2.5 s Thus, the response has been improved by using LabVIEW, as displayed in Figure 21. In addition, the last row of Table 4 contains the result by applying custom parameters to the servo system 1. 𝑀𝑝 = 0.08% SST = 0.02 s In brief, 𝑀𝑝 has been lessened near 101 times and SST has been diminished close 125 times. Finally, the Equation 18 represents the applied controller to the prismatic joint.
𝐶1 =
2𝑠2 + 10.071𝑠 + 0.003004 𝑠
Equation 18. PID controller applied to the prismatic joint
34
Figure 21. Step response of the System 1 by applying custom parameters
35
3.7. Arbitrary signals
In this section, the system response will be simulated in Simulink by applying three reference signals. The signals were built by using the Signal Builder Block, as presented in Figure 22.
Figure 22. Simulink model
3.7.1. Reference signal 1
The first reference signal (RS1) consists of eight steps detailed in Figure 23. The revolute joint moves 0.785 rad, -0.873 rad and comes back to the initial position. Besides, the prismatic joint moves 350 mm.
36
Figure 23. Reference Signal 1
3.7.1.1. Revolute Joint (Servo System 0)
The simulation is presented in Figure 24. The yellow and purple lines represent the reference signal and system response respectively. As can be observed, the output eventually comes back to its equilibrium state when the system is subjected to a disturbance. Consequently, the system error in steady state is zero, as shown in Figure 25.
Figure 24. Response of the revolute joint to the reference signal 1
37
Figure 25. Error of the servo system 0 in steady state by applying the reference signal 1
3.7.1.2. Prismatic Joint (Servo System 1)
The simulation is presented in Figure 26. Like the previous case, the system response is flat, snapshot and without overshoot. Additionally, the Figure 27 shows that the steady-state error is zero
Figure 26. Response of the prismatic joint to the reference signal 1
38
Figure 27. Error of the servo system 1 in steady state by applying the reference signal 1
3.7.2. Reference Signal 2
The RS2 consists of 14 steps displayed in Figure 28. The revolute joint moves 0.524 rad, 0.619 rad, 1.047 rad, -0.952 rad and returns to the original position. Moreover, the prismatic joint moves 350 mm.
Figure 28. Reference Signal 2
39
3.7.2.1. Revolute Joint (Servo System 0)
The simulation is presented in Figure 29. As can be observed, the output (purple line) follows closely to the reference signal (yellow line). Finally, Figure 30 shows that the steady-state error is zero.
Figure 29. Response of the revolute joint to the reference signal 2
Figure 30. Error of the servo system 0 in steady state by applying the reference signal 2
40
3.7.2.2. Prismatic Joint (Servo System 1)
The simulation is presented in the. Like the previous cases, the system response is flat, snapshot and without overshoot. Additionally, the Figure 32 shows that the steady-state error is zero.
Figure 31. Response of the prismatic joint to the reference signal 2
Figure 32. Error of the servo system 1 in steady state by applying the reference signal 2
41
3.7.3. Reference Signal 3
The RS3 consists of 20 steps displayed in Figure 33. The revolute joint moves 0.524 rad, 0.357 rad, 0.698 rad, -0.69 rad, 0.873 rad, -0.524 rad and returns to the original position. Moreover, the prismatic joint moves 250mm, 350 mm and comes back to the initial position.
Figure 33. Reference Signal 3
3.7.3.1. Revolute Joint (Servo System 0)
Figure 34. Response of the revolute joint to the reference signal 3
42
Figure 35. Error of the servo system 0 in steady state by applying the reference signal 3
3.7.3.2. Prismatic Joint (Servo System 1)
Figure 36. Response of the prismatic joint to the reference signal 3
43
Figure 37. Error of the servo system 1 in steady state by applying the reference signal 3
Conclusion
These types of robots are not widely used in industry since the lack of flexibility and grades of freedom limit their applications. However, some few applications are used for handling heavy. The rotary actuator used is a servo motor as it presents various advantages over step and DC motors. The transfer function of the servo motor considers all basic things like Error measuring device, amplifiers, motor, gear train and the feedback signal. The only difference between the rack and pinion drivers used to convert angular motion to linear displacement. Additionally, the transfer function considers that the inductance of armature can be neglected since its value is very small. By studying the results of Transient Response and Stability Analysis, can be concluded that the Z-N method cannot be applied since does meet neither the conditions for the first method nor the conditions for the second method. For this reason, other procedures like Robust, Approximate MIGO, Chien-Hrones-Reswick and Skogestad have been applied by using The Control and Estimation tool Manager in Matlab. However, the Z-N method was built in the Appendix a and B to prove that the results are even worse than the original system. The system was further improved by developing a Virtual Instrument in LabVIEW by means the controller gains approach. As a result, the custom PID eliminated the overshoot and reduced the settling time about zero.
44
The advantages of adding a derivative control action are: Anticipate the actuating error, Initiate an early corrective action, Increase the stability of the system. The advantages of adding an integral control action are: Eliminate the steady-state error Reduce the overshoot Reduce the settling time In conclusion, the proportional control action plus derivative and integral control actions eliminate the steady-state error, reduce the overshoot and reduce the settling time. The stability of the system was proved by building arbitrary signals in Simulink. The plant is in equilibrium since in the absence of any disturbance or input; the output stays in the same state. Consequently, the steady error is zero.
45
Appendix A (Revolute joint)
%1446800 %Robotic and Manufacturing Automation %Servo system M66CE-12 %Data Servo System 0 close all clear all clc Jo=0.0214; bo=0.1; Ra=1.9; ko=1; k1=5; k2=0.041; k3=0.041; n=2;
%inertia of the motor referred to the motor shaft %viscous-friction referred to the motor shaft %Resistance of armature %constant of error %gain of the amplifier %motor torque constant %back emf constant of the motor %gear ratio
K1=(ko*k1*k2)/(n*Ra); J1=Jo/n^2; %moment of inertia referred to the output shaft B1=(bo+(k2*k3)/Ra)/n^2; %viscous-friction referred to the output shaft num1=[K1]; den1=[J1 B1 0]; G1=tf(num1,den1); H=1; G2=feedback(G1,H); dt=0.01; t=0:dt:3; y1=step(G2,t)'; dy1=diff(y1)/dt; d2y1=diff(dy1)/dt; [m1,p1]=max(dy1);
%transfer function %feedback %closed-loop transfer function %time vector %don't use [y,t]=step(G2,t) because 't' was already defined %difference and approximate derivative %second derivative %returns the indices of the maximum values in vector p %inflection point position %inflection point time
yi1=y1(p1); ti1=t(p1); plot(ti1,yi1,'*r') hold on L1=ti1-yi1/m1; %delay time T1=(y1(end)-yi1)/m1+ti1-L1; %time constant figure(1) plot(t,y1,'b',[0 L1 L1+T1 t(end)],[0 0 y1(end) y1(end)],'k') title('Step response of the original system 0') grid ylabel('Amplitude') xlabel('Time (sec)') legend('Inflection point','Step response','Tangent line at inflection point') % Ziegler–Nichols Rules for Tuning PID Controllers, First Method Kp1=1.2*T1/L1; %proportional gain Ti1=2*L1; %integral time Td1=0.5*L1; %derivative time
46
Ki1=Kp1/Ti1; Kd1=Kp1*Td1; C1=tf(pid(Kp1,Ki1,Kd1)); G3=feedback(C1*G1,H);
%integration gain %derivation gain
figure (2) step(G2,G3) title('Step response of the controlled system 0') legend('Original System 0','System 0 with PID') grid
Figure 38. Step-Response for the revolute joint
Figure 39. Original system vs. System with Z-N PID
47
Table 5. Original system vs. System with Z-N PID
Original System
System with Z-N PID
Settling time
1.8278
2.7154
Overshoot %
3.0792
56.9358
Steady state time
3
4
Figure 38 shows the inflection point and tangent line. Moreover, Figure 39 shows the results of the original system and the system with Z-N PID. By applying a Z-N PID controller, the settling time increased 1.5 times approximately, the overshoot boosted 18.5 times and SST augmented 1.3 times, as illustrated in Table 5. Therefore, Z-N controller should not be used, if the system does not meet the method conditions.
Appendix B (Prismatic Joint)
%1446800 %Robotic and Manufacturing Automation %Servo system M66CE-12 %Data Servo System 1 close all clear all clc Jo=0.0214; %inertia of the combination of the motor, load, and gear train referred to the motor shaft bo=0.1; %viscous-friction coefficient of the combination of the motor, load, and gear train referred to the motor shaft Ra=1.9; %Resistance of armature ko=1; %constant of error k1=5; %gain of the amplifier k2=0.041; %motor torque constant k3=0.041; %back emf constant of the motor n=2; %gear ratio rc=112.5/(2*pi); %ratio of the output shaft K2=(ko*k1*k2)/(n*rc*Ra); J2=Jo/(n*rc)^2; shaft B2=(bo+(k2*k3)/Ra)/(n*rc)^2; the output shaft
%moment of inertia referred to the output %viscous-friction coefficient referred to
48
num2=[K2]; den2=[J2 B2 0]; G4=tf(num2,den2); %transfer function H=1; %feedback G5=feedback(G4,H); %closed-loop transfer function dt=0.01; %time vector t=0:dt:3; y2=step(G5,t)'; %don't use [y,t]=step(G5,t) because 't' was already defined dy2=diff(y2)/dt; %difference and approximate derivative d2y2=diff(dy2)/dt; %second derivative [m2,p2]=max(dy2); %returns the indices of the maximum values in vector p yi2=y2(p2); %inflection point position ti2=t(p2); %inflection point time plot(ti2,yi2,'*r') hold on L2=ti2-yi2/m2; %delay time T2=(y2(end)-yi2)/m2+ti2-L2; %time constant figure(1) plot(t,y2,'b',[0 L2 L2+T2 t(end)],[0 0 y2(end) y2(end)],'k') title('Step response of the original system 1') grid ylabel('Amplitude') xlabel('Time (sec)') legend('Inflection point','Step response','Tangent line at inflection point') % Ziegler–Nichols Rules for Tuning PID Controllers, First Method Kp2=1.2*T2/L2; %proportional gain Ti2=2*L2; %integral time Td2=0.5*L2; %derivative time Ki2=Kp2/Ti2; %integration gain Kd2=Kp2*Td2; %derivation gain C2=tf(pid(Kp2,Ki2,Kd2)); G6=feedback(C2*G4,H); figure (2) step(G5,G6) title('Step response of the controlled system 1') legend('Original System 1','System 1 with PID') grid
Figure 40 shows the inflection point and tangent line. Moreover, Figure 41 shows the results of the original system and the system with Z-N PID. By applying a Z-N PID controller, the settling time increased 5.7 times approximately, the overshoot boosted 1.4 times and SST augmented 4.8 times, as illustrated in Table 6. Therefore, Z-N controller should not be used, if the system does not meet the method conditions.
49
Figure 40. Step-Response of the prismatic joint
Figure 41. Original system vs. System with Z-N PID
Table 6. Original system vs. System with Z-N PID
Original System
System with Z-N PID
Settling time
1.5006
8.4829
Overshoot %
57.0850
80.0837
Steady state time
2.5
12
50
REFERENCES
Åström, K. & Hägglund, T., 2004. Revisiting the Ziegler–Nichols step response method for PID control. Journal of Process Control, 14(1), pp. 635 - 650. Dalmec S.p.A., 2016. Technical characteristics of pneumatic manipulators MaxiPartner. [Online] Available at: http://www.dalmec.com/ing/manipulators/industrial_manipulators_Maxipartner.html [Accessed 10 04 2016]. Farnell element14, 2013. Low inertia dc servo motors. [Online] Available at: http://uk.farnell.com/mclennan/m66ce-12/motor-servo-12vdc2700rpm/dp/1784823?ost=M66CE12&selectedCategoryId=&categoryName=All+Categories&categoryNameResp=All%2BCatego ries [Accessed 02 02 2016]. Fastech Co., Ltd., 2014. Cloosing Loop Steepping System. [Online] Available at: http://www.fastech.co.kr/bbs/eng/motor.php [Accessed 2016 02 08]. MathWorks, 2015. Control System Toolbox™ User's Guide. 26 ed. Natick(Massachusetts): The MathWorks, Inc.. Ogata, K., 2010. Modern Control Engineering. 5 ed. Upper Saddle River(New Jersey): Pearson Education, Inc. Skogestad, S., 2002. Simple analytic rules for model reduction and PID controller tuning. Journal of Process Control, I(13), p. 291–309.
51