Introduction: This project consists of designing a software-based control workstation in the Simulink environment using the SimMechanics Toolbox. The Quanser robot arm system will be modeled using this software. Once modeled, closed-loop controllers can be evaluated in real time. Objectives: The two systems that will be examined will be the Quanser robot arm in an inverted and non-inverted configuration. The high-level control block diagram of the system is shown in Figure 1-1. The project will consist of: Creating linear model of systems using Simulink Creating nonlinear model of systems using SimMechanics Toolbox Implementation of power amplifier and/or PWM (Pulse Width Modulation) board Developing and testing analog controller Developing and testing digital controller Implementing force feedback joystick controllers Software Commands (Test Inputs) Joystick Control Simulink Based Robot Arm Control Workstation Position Velocity Torque Feedback Force Modes of Operation: Figure 1-1 High Level Block Diagram There are two modes of operation: external and internal. The internal mode will consist of a MATLAB GUI (Graphical User Interface) which will generate command signals that will be used to test the model of the system in the MATLAB environment. A 3D model of the robot arm system will be simulated using the SimMechanics toolbox. This allows viewing of the system in real time. The external mode allows the user to control the robot arm with a joystick. Force feedback will cause resistance in joystick that is proportional to a load present on the robot arm. 1
Input Subsystem: Figure 2-1 Input Subsystem Block Diagram The input R to the system consists of a software command or a joystick command as shown in Figures 2-1 and 2-2. The software commands will be generated in Simulink and will be used to test the controller response in simulation. There will be two joystick modes. A conventional joystick mode will provide position and velocity control of the robot arm. In the second mode, a force feedback joystick will provide resistance in the joystick proportional to the torque as seen by the motor. This will provide feedback to the user to what kind of load is present on the robot arm. Controller Subsystem: Figure 2-2 Controller Subsystem Block Diagram The robot arm system will have two controllers, shown as F and Gc in Figure 4. Block F is a feed-forward controller while Gc is a PID (Proportional Integral Derivative) type controller. These controllers will be implemented digitally in Simulink and will interface with the robot arm through A/D and D/A converters. The position sensor is a potentiometer connected to the gear train that provides position feedback. It is shown as block H. 2
Plant Subsystem: The robot arm system or plant, consisting of DC motor, robot arm, and gear train is represented by Gp. This system can be further broken down to the block diagram shown in Figure 3-1. Figure 3-1 Plant Subsystem Block Diagram The input is the voltage applied to the DC motor, Va. The armature inductance, La, and resistance, Ra, form the electrical impedance of the motor. The DC Motor s back EMF and torque constants are represented by Kv and Kt. The parameter Ia is the armature current of the DC motor. This current is proportional to the torque. The equivalent mechanical inertia and resistance are represented by J and B, respectively. The output of the system is velocity that is reduced by a factor of 70 due to external gear ratios. Preliminary Results: A linear model of the DC Motor and gear train has been created in Simulink. A proportional controller is used to control position. The model has been tested against the experimental results of the actual Quanser motor with gain, Kp. Results are shown in Table 1 for a -10 to 10 step input. Kp Experimental Overshoot Simulation Overshoot 0.1 none 0.51% 0.2 10.45% 25.14% 0.3 33.3% 54.04% 0.4 saturation 81.7% Table 1 Overshoot vs. Gain 3
The linear model used in simulation differed by approximately a factor of two when compared to the experimental results. The gain was limited by the A/D and D/A voltage range of +5 to -5 [v]. For high gain, the output must be smaller than 5[v] otherwise saturation will occur. The proportional controller is severely limited as a gain of 0.4 results in saturation. The differences in percent overshoot are due to modeling non-linear effects as linear approximations. The static friction of the motor and gear-slop were modeled using a simple time delay term. The time delay term was found experimentally. The measurement used was a worst case scenario that contributes to the larger simulation overshoot. These discrepancies between simulation and experimental results should be reduced as non-linear elements are modeled using SimMechanics. SimMechanics Model: A model of the robot arm system will be constructed in the SimMechanics toolbox included with Simulink. This model consists of the physical characteristics associated with the robot arm system including inertia tensors, mass, and dimensions of each body in the system. The system can be broken down into simple body shapes for ease of calculating each inertia tensor and center of gravity associated with that body. The SimMechanics toolbox allows the implementation of each body in a block diagram. An example robot arm model is shown in figure 4-1. The bodies are connected by joints which define the characteristics between bodies. The gravitational parameters are then set in the mechanical environment block. Graphical Analysis: Figure 4-1 Robot arm example block diagram in SimMechanics The Matlab Graphics window allows a 3D view of the model and how it behaves in the mechanical environment. An example of the Matlab Graphics window with the robot arm model is shown in figure 5-1. To overcome the limitations of the Matlab Graphics window a VRML representation will be used. The Virtual Reality toolbox can be used to design a full 3D model of each body. The bodies created in virtual reality are then associated with the bodies in SimMechanics. 4
Figure 5-1 Robot arm example in Matlab Graphics window Projected Schedule: Week Kain Osterholt Adam Vaccari 1-2 3-4 Joystick Force Feedback Test with DC Motor Model SimMechanics Model Inverted Robot Arm 5-6 7-8 9 Model Gripper Attachment Model using VR Toolbox Model Sensors Design Analog Controllers Design Digital Controllers Model H-Bridge, PWM 10 11 12 MATLAB GUI (Graphical User Interface) Preparation for EXPO Final Report 5