Towards a Model-Based Motion Control Design for a 7-Axis Robotic Arm LWA4D by Schunk
Total Page:16
File Type:pdf, Size:1020Kb
UMEÅ UNIVERSITY MASTER THESIS Towards a Model-Based Motion Control Design for a 7-axis Robotic Arm LWA4D by Schunk Author: Roger Vila Cano January 10, 2017 ii Supervisors: Leonid Friedovich and Szabolcs Fodor Examiner: Sven Rönnbäck Opponent: Mattia Picchio Defended: November 29, 2016 iii “The apple cannot be stuck back on the Tree of Knowledge; once we begin to see, we are doomed and challenged to seek the strength to see more, not less. ” Arthur Miller v Abstract This thesis presents an overview and realization of several steps to- wards system integration and the control design for the robot arm LWA4D by Schunk using MATLAB/Simulink blocks through the adopted hardware and software from dSpace company. The dynamical equations for the manipulator using three and seven degrees- of-freedom will be derived and implemented using MATLAB/Simulink blocks. Moreover, the implementation of model-based controllers based on the system dynamics is implemented and tested both in ideal conditions and under the delays related to CAN communication protocol. In addition, in order to visualize the motion of the manipulator under the model-based controllers, SimMechanics is used alongside plots showing the end-effector position and the generated torques. Information regarding the first steps on how the hardware and software should be set up in or- der to establish communication between the manipulator and the Simulink blocks is provided as well. Finally, the problems that appeared during the implementation steps and the results obtained are discussed in the last section. vii Acknowledgements I would like to start thanking one of my supervisors, Leonid Friedovich who gave me very good advices to improve the quality of this thesis, I highly appreciate his predisposition for discussion during all the thesis pe- riod. Also, I would like not only to thank Szabolcs Fodor about all the support and the patience he had with me during the thesis period but also during all my master studies. Thanks to all the friends that I have met during this period which we have shared experiences that I will remember all my life. And last but not least to my family, for all their support during this pe- riod and specially to my grandma who have been and will be a source of inspiration to all my future projects. Roger Vila Cano Umeå, 2016 ix Contents Abstractv Acknowledgements vii Contents ix List of Figures xiii List of Tables xv 1 Introduction1 1.1 Motivation and Preview.....................1 1.2 Goals and proposed solutions..................2 1.3 System Integration........................2 1.4 The LWA4D by Schunk......................3 1.4.1 Hardware for the LWA4D by Schunk.........3 1.5 The MicroAutoBox II.......................3 1.5.1 Hardware for the MicroAutobox II...........4 1.5.2 Software for the MicroAutobox II............5 MATLAB Software....................5 dSPACE Software.....................5 1.6 System Set Up Overview.....................5 2 Literature Review7 2.1 Robot Manipulators........................7 2.2 Communication protocols....................7 2.3 Embedded Control Systems...................8 2.4 Calibration for Industrial Robots................8 3 CANopen Communication Protocol 11 3.1 CANopen Elements........................ 11 3.1.1 Device Profiles...................... 12 3.1.2 Object Dictionary..................... 12 3.1.3 Service Data Objects................... 13 3.1.4 Process Data Objects................... 13 3.1.5 Transmission methods.................. 13 3.1.6 Mapping Parameters................... 13 3.1.7 Network Management.................. 15 3.2 Device Profiles for Robot Applications............. 15 3.2.1 Device Profile for Drives and Motion Control DS402. 16 3.2.2 Robot Control according to DS402........... 18 x 4 Dynamic Modeling and Motion Control 21 4.1 Kinematic analysis........................ 21 4.1.1 General Kinematics Expressions............ 21 Forward Kinematics................... 21 Velocity Kinematics.................... 22 4.1.2 Reduced Model Kinematics............... 22 Direct kinematics for the reduced system....... 23 Inverse kinematics for the reduced system...... 23 4.1.3 Complete Model Kinematics.............. 24 Direct kinematics for the complete system...... 24 4.2 Dynamic Robot Modelling.................... 25 4.2.1 Computation of the Inertia Matrix........... 25 4.2.2 Computation of the Coriolis Matrix.......... 25 4.2.3 Computation of the Gravity Vector........... 26 4.3 Motion Control.......................... 26 4.3.1 PD Control with Gravity Compensation........ 26 PD Control with Gravity Compensation in task space 28 4.3.2 Computed torque method................ 28 Computed torque method in task space........ 29 4.3.3 Linear Trajectory with Fifth Order Polynomial.... 30 4.3.4 Parameter Identification................. 31 Parameter Estimation through Shape Approximation 31 Dynamic Parameter Identification........... 31 5 Results and Simulations 33 5.1 Dynamic Parameter Identification for a 2DOF Planar Robot. 34 5.1.1 Parameters for the 2DOF Planar Robot........ 34 5.1.2 Building the System Regressor............. 35 5.1.3 Parameter Identification under Finite Fourier series trajectories......................... 36 5.2 Data Transmission of LWA4D.................. 38 5.3 Results for the 3DOF Model................... 39 5.3.1 Parameters for the 3DOF Model............ 39 5.3.2 Dynamical Model for the 3DOF Model........ 40 5.3.3 SimMechanics for the 3DOF Model.......... 41 5.3.4 Motion Control for the 3DOF Model.......... 42 PD+G Control in Joint Space for 3DOF........ 43 PD+G Control in Task Space for 3DOF......... 45 CTM Control in Joint Space for 3DOF......... 48 CTM Control in Task Space for 3DOF......... 50 5.4 Results for the 7DOF Model................... 52 5.4.1 Parameters for the 7DOF Model............ 53 5.4.2 Dynamical Model for the 7DOF Model........ 53 5.4.3 SimMechanics for the 7DOF Model.......... 55 5.4.4 Motion Control for the 7DOF Model.......... 55 PD+G Control in Joint Space for 7DOF........ 56 PD+G Control in Task Space for 7DOF......... 56 CTM Control in Joint Space for 7DOF......... 57 CTM Control in Task Space for 7DOF......... 58 xi 6 Hardware and Software Set Up 61 6.1 Set Up LWA 4D.......................... 61 6.1.1 Power Supply....................... 61 6.1.2 Initial Set Up....................... 62 6.1.3 CANopen Connections to LWA 4D........... 65 6.2 Set Up MicroAutobox II..................... 66 6.2.1 Software Installation................... 66 6.2.2 Ethernet Configuration................. 66 Set Up the TCP/IP Protocol............... 66 Change the IP Address of MicroAutoBox II...... 67 Set Up a Peer-to-Peer Connection............ 67 6.3 Build the CANopen Blockset.................. 68 7 Conclusions 71 7.1 General Conclusions....................... 71 7.2 Achieved Goals.......................... 72 7.2.1 Additional Achieved Goals............... 72 7.3 Ethical, Moral and Social Implications............. 72 7.4 Applications and Further Work................. 73 Bibliography 75 xiii List of Figures 1.1 System Integration Schematic..................2 1.2 The LWA4D by Schunk (from the laboratory at Umeå Uni- versity)...............................4 1.3 MicroAutobox II (from the laboratory at Umeå University).4 2.1 CANopen Network Example..................8 2.2 Schematic diagram of a calibration system...........9 3.1 ISO 7-Layer Reference Model for CANopen.......... 11 3.2 CANopen Reference Model................... 12 3.3 Communication State Machine operation........... 15 3.4 State Machine in System Context................ 16 3.5 State Machine Block Diagram.................. 17 3.6 Robot Control Schematic..................... 18 4.1 Denavit-Hartenberg kinematic parameters.......... 21 4.2 The 3DOF manipulator structure................ 23 4.3 The 7DOF manipulator structure................ 24 4.4 Block scheme of joint space PD control with gravity compen- sation................................ 27 4.5 Block scheme of task space PD control with gravity compen- sation................................ 28 4.6 Block scheme of joint space computed torque method.... 29 4.7 Block scheme of task space computed torque method.... 30 4.8 Link modeled as a cylinder................... 31 5.1 2DOF Planar Robot structure.................. 34 5.2 Dynamic Parameter estimation 2DOF planar Robot..... 37 5.3 Data transmission in MATLAB/Simulink........... 38 5.4 The 3DOF module configuration................ 39 5.5 SimMechanics 3DOF Block Diagram.............. 42 5.6 SimMechanics representation for the 3DOF model...... 42 5.7 PD+G Control in Joint Space results for T = 5 and p = 2:5 .. 44 5.8 PD+G Control in Joint Space results for T = 5 and p = 1:25 . 45 5.9 PD+G Control in Task Space results for T = 5 and p = 40 .. 46 5.10 PD+G Control in Task Space results for T = 5 and p = 20 .. 47 5.11 CTM Control in Joint Space results for T = 1:5 and p = 10 . 49 5.12 CTM Control in Joint Space results for T = 5 and p = 10 ... 50 5.13 CTM Control in Task Space results for T = 1:5 and p = 10 .. 51 5.14 CTM Control in Task Space results for T = 5 and p = 10 ... 52 5.15 Dynamic S-Function blocks................... 54 5.16 SimMechanics representation for the 7DOF model...... 55 5.17 7DOF PD+G Control in Joint Space results for T = 3 and p = 5 56 5.18 7DOF PD+G Control in Task Space results for T = 3 and p = 25 57 xiv 5.19 7DOF CTM Control in Joint Space results for T = 3 and p = 25 58 5.20 7DOF CTM Control in Task Space results for T = 3 and p = 25 59 6.1 Schunk LWA4D connectors................... 61 6.2 Dimensions of Schunk LWA4D power supply socket (Both sides)................................ 62 6.3 DIP switches in PRL+ driver................... 63 6.4 DIP switches in ERB+ driver................... 64 6.5 DIP switches in PG+ gripper................... 65 6.6 Positions of Schunk LWA4D CAN and Serial sockets..... 65 6.7 CAN terminator adaptor in accordance with CiA....... 66 6.8 CAN assignment of 9-pin SUB D Socket............ 66 6.9 MATLAB/Simulink Blocks from dSpace............ 69 xv List of Tables 3.1 How to Map (or Remap) a PDO................