Table of Contents: Introduction: ........................................................................................................................ 2 Objectives: .......................................................................................................................... 4 Plan of Action and Verification .......................................................................................... 5 Plan and Testing Procedures ........................................................................................... 5 Tolerance Analysis.......................................................................................................... 7 Design Strategy ................................................................................................................... 8 Modeling ......................................................................................................................... 9 Parameter Identification ................................................................................................ 10 Control Design .............................................................................................................. 11 Implementation and Integration .................................................................................... 12 Cost: .................................................................................................................................. 13 Schedule: ........................................................................................................................... 14 Bibliography: .................................................................................................................... 14 Appendix A: Terms........................................................................................................... 15 Appendix B: SimMechanics Modeling ............................................................................. 16 Appendix C: Schedule ...................................................................................................... 19 Table of Figures: Figure 1: Front and Side views of a 3D Arm Driven Inverted Pendulum .......................... 2 Figure 2: Pan and Tilt System ............................................................................................. 3 Figure 3: National Instruments cRIO .................................................................................. 3 Figure 4: Plan of Action ...................................................................................................... 5 Figure 5: Design Strategy ................................................................................................... 8 Figure 6: Sim Mechanics Simulink Diagram..................................................................... 9 Figure 7: SimMechanics 3D Model ................................................................................. 10 Figure 8: SimMechanics 2D System................................................................................. 16 Figure 9: Simulink 2D System .......................................................................................... 16 Figure 10: SimMechanics 3D System............................................................................... 17 Figure 11: Simulink 3D System ........................................................................................ 18 1 Introduction: The inverted pendulum is a popular control problem which is frequently used and studied throughout the scientific community. The significance behind the inverted pendulum is that it is inherently unstable. The ability to stabilize an unstable system has many useful and interesting applications. Cutting edge military fighters and spaceships harness the ability to stabilize unstable systems to achieve tremendous performance gains. Many robotic applications such as biped walking robots also use similar aspects in their operation [4]. There are many different forms of inverted pendulums. Linear, Rotary, and Spherical are some of the more traditional implementations. A Two Dimensional Arm-Driven Inverted Pendulum, also known as a Pendubot, is the most similar design to the proposed project [2] [3]. The goal of this project is to design and stabilize a Three Dimensional Arm-Driven Inverted Pendulum. The simplest way to visualize this system is to imagine a stick balancing another stick. The lower stick, called the Actuated Arm, is driven by a motor. The upper stick, called the Balanced Arm, is not actuated. The two arm ends are connected with a universal joint. The picture below illustrates this system. Figure 1: Front and Side views of a 3D Arm Driven Inverted Pendulum 2 Initially, the three dimensional pendulum will be modeled in Simulink using SimMechanics. Then, using the control design features of Matlab, a controller to stabilize the system can be generated. For the physical system design, the arm driven inverted pendulum apparatus will have to be built on top of a modified pan and tilt system that was supplied. Figure 2: Pan and Tilt System A National Instruments CompactRIO (Compact Reconfigurable I/O, cRIO) will be used to realize and implement a stabilizing control system. Figure 3: National Instruments cRIO 3 Objectives: The primary objective of the project is to design and balance a Three Dimensional ArmDriven Inverted Pendulum. Since the size and dimensions of this system greatly influence how easy or difficult it will be to control, four different mechanical configurations will be created. These configurations will range from being very easy to control to being very difficult to control. Part of the project will be to identify what mechanical characteristics cause the system to be easy or difficult to control. Once the configurations are decided upon, then they will have to be implemented in hardware. The overall success of the project will be defined by how well a system configuration can be balanced. The two areas of analyzing system performance will be first in simulation and then in final implementation. In simulation, there will be a vast amount of flexibility in setting up initial conditions and tests. Unfortunately, evaluations of the physical implementation must be both realizable and repeatable. The current plan is to use torque disturbance as a way if monitoring the performance of the physical system. The project has two secondary objectives. The first is to implement the entire controller on the FPGA section of the cRIO. This will require special attention to numerical issues and filtering. The second is to add a human interface that will allow the user to act as the control system. This will add a human vs. computer competition aspect to the project. The scope of this project has changed somewhat from its inception. The focus is now primarily on balancing rather than both balancing and swing up. This change was primarily based on the availability issues associated with acquiring a slip ring. 4 Plan of Action and Verification The figure below is an overview of the plan of action for designing, building and analyzing the proposed Three Dimensional Arm-Driven Inverted Pendulum balancing system. There are a total of ten steps that will be taken in order to accomplish a controlled three dimensional arm-driven inverted pendulum. While the steps are listed in a chronological order, there may be some overlap between stages, as well as complete changes in order, depending on the presence of circumstances that are out of the realm of human control. A general synopsis of each block and potential verification procedures may be found in the subsequent section. Plan and Testing Procedures A model of the intended system will be created and analyzed for feasibility before the system will be implemented. The Simulink SimMechanics toolkit has been used to do the initial model. First a two dimensional model was formed, and then the three dimensional system was modeled. As a check of the accuracy of the SimMechanics equations, modeling will also be done for the two dimensional system by hand. If the two methods of modeling agree for the two dimensional system, then it will be assumed that the three dimensional model created in SimMechanics is accurate as well. The system model will then be linearized and a state space controller will be designed. The SimMechanics modeling has been done by Matt Rosmarin and Teresa Bernardi. The hand calculations will be done by Brian Lewis. The parameters of the system base will be identified before the control design is completed. The properties of the motors and corresponding assembly will affect the system’s response and capabilities. Specific parameters that need to be identified are the friction, inertia, and backlash. A Labview interface has been created in order to directly measure the friction of the motors by Matt Rosmarin and Brian Lewis. The inertia of the motors and assembly will be found using SolidWorks and verified experimentally. The most likely experimental verification of the assembly inertias is a series of pendulum tests in which one axis of rotation is locked and a pendulum is allowed to swing freely about the other axis. From the frequency of the oscillations, the inertia about that axis of rotation may be determined. An analysis of the amount of backlash also needs to be accomplished. Additionally, the physical assembly of the base has some compliance. This compliance can be measured by applying a torque to each of the motors separately, and determining the amount and direction of any deflections in the assembly. Should the compliance be established as excessive for the system application, the assembly will be refashioned out of a more rigid material. Figure 4: Plan of Action 5 Each component of the balancing subsystem needs to be designed. The main components of the subsystem are the actuated arm, balanced arm, universal joint, and end mass. The design should take into account the center of mass of each arm and the speed necessary to respond to perturbations in the system balance. The control design will then be adapted to the system as each of the balancing subsystem components are sized. The sensors and motors will also be selected and/or designed to work well with the designed system. For example, the proposed encoders need to be of high enough resolution to detect an offset angle that is an order of magnitude less than the specified maximum allowable oscillation. The gearing of the motors may also have to be redesigned to attain the required torque and speed to accurately control the system. The construction and fabrication of the physical system will be set into motion once the sizing of the balancing subsystem is complete. The machining will be accomplished in one of the machine shops on-campus by several of the team members. Some of the components will most likely be commercially available. The construction of the physical system will be a team effort; however Brian Lewis will be the lead. While the system is being constructed the various aspects of the interaction between the mechanical and control systems will be tested and any problems identified. The integration of the systems will be monitored by all team members. An additional controller may also be added at this stage to allow for human control of the balancing system, so that the control algorithm response may be compared to human reflexes. Once the integration of the physical and control systems is complete, the control algorithms may be tuned. Since the purpose of our system is to balance, the optimization of the system will be focused on this goal. Tuning will also focus on the speed and robustness of the overall system. The overall performance of the system will be analyzed as to its ability to acquire and maintain a balancing state, and compensate for slight disturbances in both the two and three dimensional configurations. The analysis will most likely be done in tandem with the tuning of the controls, as a bad performance review indicates the need for further tuning. While the speed of system response will be analyzed in the system performance, the target speed will vary between the different size systems. If there is time, existing swing up techniques will be applied to the system so that human initialization is not necessary. The controller design for the swing up of pendulums already exists for a two dimensional system. For this reason, the swing up may be restricted to two dimensions. 6 Tolerance Analysis The components that most affect the performance of the system are the sensors. Should the sensors that detect either the motor rotation or the rotation of the balanced arm be inadequate, the system will continuously go unbalanced. The reaction of the system to disturbances will also be affected in that the system will be very likely to either under- or over-compensate due to erroneous sensor readings. The balancing subsystem parameters will also affect the system performance. While the controller should be designed to accommodate for small changes in the system, any large changes will cause difficulties in controlling the balanced arm. For example, adding an additional small mass to the tip of the balancing arm should not affect the system performance; while adding an object of significant mass, with respect to the original system, will cause the system to be unable to adequately compensate. The base parameters will also have an affect on the performance of the system. The specific parameters that will impact the performance are the friction of the motors, backlash in the gear train, and the compliance in the assembly. Since the controller will be linearized, these aspects of the system will not necessarily be taken into account. If there is a significant amount of friction and backlash, then the system’s ability to balance will be compromised. 7 Design Strategy Physical Model Modeling SimMechanics Hand Derived Parameter Identification Friction Backlash / Compliance Inertia Control Parameter Selection Arm Lengths Arm Weights Linearization Simulink Linearization Hand Linearization Control Design Root Locus Design LQR Generation Non Linear Simulation / Evaluation Simulink / Labview Implementation / Integration Mechanical Fabrication Arms Universal Joint Fixtures Electrical Sensors Actuators Human Interface Controller cRIO (Onboard Controller / FPGA) Figure 5: Design Strategy 8 Modeling The primary method of modeling the system will be utilizing SimMechanics. SimMechanics is an add-on for Matlab Simulink. SimMechanics allowed the team to very quickly create a full non-linear model of a mechanical system. Below is the Simulink model diagram the full 3D system. Figure 6: Sim Mechanics Simulink Diagram In addition, SimMechanics also automatically allows for 3D Visualization of a created model. 9 Figure 7: SimMechanics 3D Model The key advantage of using SimMechanics is that model can be quickly created, and later the model can be edited. Large scale changes which would normally require total reworking of a hand derived model can be implemented with a few keystrokes in SimMechanics. To verify that SimMechanics is correct, a hand derived model of the two dimensional system will be compare against a two dimensional version of the SimMechanics model. Finally, because it is already part of Simulink, it will be very easy to include the control system loop, and nonlinearities such as saturation, quantization, fixed point calculations, loop rates, and time delays in the simulation. Parameter Identification The next major step in the project will be to identify all the parameters of the system base. The main parameters of interest are the Friction Parameters, the Inertia Parameters, and the Backlash Parameters. Friction: To identify the coulomb static friction, the coulomb dynamic friction, and the viscous friction, the team has created Labview VI that automates this parameter identification. Specifically, the test plots the applied torque vs. steady-state velocity through a predefined profile. Inertia: Finding the inertia of the base will be a slightly more complicated. To find it experimentally, a pendulum will be rigidly attached to the axis of rotation. By finding the frequency of oscillation and measuring the weights and sizes of several other parts, the inertia of the system can be determined with respect to the axis of rotation. Solidworks will be used to verify our experimental results. Backlash: Due to the significant amount of backlash in the system, the team is concerned that it will severely impact the balancing of the system. To better identify its effects, the backlash needs to be clearly characterized. It will be measured 10 through the use of two high resolution optical encoders. Both of these encoders are already mounted. One is mounted directly to the axis of rotation and the other is mounted to the back of the motor. From several experiments there will be a clearer picture of how much backlash there is and what needs to be done to reduce it. Control Design Since of there is a large amount of flexibility in the selection of the system parameters above the base (arm length and weight), there will be four different configurations. These mechanical configurations will range from easy to control to difficult to control. The control design process will require several iterations of the following steps for all four configurations. 1. Parameter Sizing: The length and weight parameters will be chosen for the actuated arm and the balanced arm. These sizes will be based on past iterations and experiences. Certain combinations should be easy to control while others may be impossible or very difficult. 2. Linearization: Linearization of the SimMechanics model will be done by using the linearization feature of Simulink. Once an operation point is selected, then linearized equations of motion will automatically be generated. Linearization of the hand derived model will be done by hand, but will only be done a limited number of times because its purpose is only to verify the SimMechanics model. 3. State Space Control Design: Once the state matrices are known, then Matlab’s LQR (linear-quadratic statefeedback regulator) command will be used to generate a controller. 4. Evaluation: The entire system will be simulated with all nonlinearities to evaluate the systems performance. Evaluation will based on: How well it recovers from a non-zero starting angle. How well it recovers from a non-zero starting velocity How well it recovers when arm parameters (length, weight) are varied by ± 10% to get an idea of how robust the system will be. How well it recovers from a torque disturbance. By setting up the following steps in an automated batch file, the team will be able to view and compare the performance of hundreds of different system configurations and controllers. 11 Implementation and Integration System Implementation and Integration is the process of bringing the Mechanical, Electrical, and Control portions together. Mechanical Fabrication: The primary mechanical part of the project will be the design and fabrication of the arms, the universal joint, and any mounting fixtures. These features will be designed in Solidworks and manufactured using the fabrication facilities accessible to the team. The key mechanical issues will be to keep the universal joint friction very low and to also allow for the easy swapping of components. Electrical: The electrical portion will consist of sensors, motors, amplifiers and interconnection. The electrical portion will also need to allow for a user interface such as a joystick. All in all, the electrical section of this project should be quite straightforward. Control Issues: The encoders that will be used have very high resolutions, but since they are incremental, it is necessary to set their zero position manually. To solve this issue, the team will to use inexpensive accelerometers to accurately calibrate the incremental encoders. 12 Cost: Parts: Part Number: S2-2048-B GM8724S017 MSC: 74924887 MMA7260Q Raw Materials: Part Number: Description US Digital Encoder Pittman Motor Flange Bearings Pan gear A Pan gear B Tilt gear A Tile gear B Pan belt Tilt belt Triple Axis Accelerometer with Breakout Description MSC: 02629335 Alloy 3003 Aluminum Material: Aluminum - Alloy 3003 Outside Diameter: 1/2 Wall Thickness: 0.035 In. Alloy 6061 Aluminum Material: Aluminum - Alloy 6061 Diameter: 1 Length: 12 MSC: 32012254 Alloy 6061 Aluminum Material: Aluminum - Alloy 6061 Length: 72 Length: 6 Thickness: 1/4 Width: 1 MSC: 32000820 Labor Costs Name: Brian Lewis Adjima Moreira Teresa Bernardi Matthew Rosmarin Quantity 4 2 4 1 1 1 1 1 1 2 Quantity Title Engineer Engineer Engineer Engineer Price $ 85.55 $ 210.00 $ 7.44 $ 9.97 $ 22.02 $ 7.95 $ 22.02 $ 3.92 $ 4.00 $ 34.95 Price Total Cost Our Cost $ $ $ $ $ $ $ $ $ $ $ $ 342.20 420.00 29.76 9.97 22.02 7.95 22.02 3.92 4.00 69.90 Parts Total $931.74 Total Cost $ $ $ $ $ $ $ $ 29.76 69.90 $ 99.66 Our Cost 2 $9.66 $19.32 $19.32 1 $7.56 $7.56 $7.56 1 $12.38 Hours 135 135 135 135 Cost $40 $40 $40 $40 $12.38 Raw Materials Total $39.26 $12.38 $39.26 Total Cost Our Cost $5,400 $ $5,400 $ $5,400 $ $5,400 $ Labor Costs Total $21,600 $ - Final Cost $22,418.84 13 - Our Final Cost $ 138.92 Schedule: See Appendix C Bibliography: [1] CJC, CTM Example: Inverted Pendulum Modeling http://www.engin.umich.edu/group/ctm/examples/pend/invpen.html (c) 1997 [2] Craig, Kevin Inverted Pendulum Systems: Rotary and Arm-Driven, A Mechatronic System Design Case Study [3] Kajiwara, Hiroyuki, Wide Range Stabilization of an Arm-Driven Inverted Pendulum Using Linear Parameter-Varying Techniques February 1998 [4] Kajita, Shuuji A Realtime Pattern Generator for Biped Walking IEEE Robotics & Automations Conference May 2002 14 Appendix A: Terms Abbreviations: 2D = two dimensional 3D = three dimensional cRIO = Compact Remote Input Output or Compact RIO FPGA = Field Programmable Gate Array Device Parts: 15 Appendix B: SimMechanics Modeling Figure 8: SimMechanics 2D System Figure 9: Simulink 2D System 16 Figure 10: SimMechanics 3D System 17 Figure 11: Simulink 3D System 18 Appendix C: Schedule See next page. 19 20 Team Contributions: Work on this paper was shared equally between, Teresa Bernardi, Brian Lewis, and Matthew Rosmarin. Teresa Bernardi Brian Lewis Matthew Rosmarin 21