Flumes TMMS04 – Mechatronics September 16, 2014 Lab 2 – Angle Servo Figure 1: The DC-Motor Servo Setup 1 Goals • To be able to retrieve relevant data from data sheets. • To be able to build an angle servo by connecting components using their respective data sheets. • To control a motor from dSPACE to achieve an angular resolution less then one degree. • To understand how basic mechatronic components such as encoder, amplifier and motor work and how they can be controlled by a computer. 2 Preparations (Do Before the Lab) 1. Make sure that you have read the introduction to Lab 1, or have done the lab. 2. Repeat basic control theory for Proportional and Proportional-Integrating control. 3. Understand the working principle of a quadrature encoder, see Lesson 1 – Sensors and Characteristics. 4. Understand the working principle of pulse width modulation. 5. Understand the working principle of a DC Motor with permanent magnets. 6. Draw a schematic connection diagram of the involved hardware components: • Power supply 15V and 5V • Gearbox • Angle indicator (object to control) • Electric DC-motor • LMD-18200T H-Bridge • dSPACE motor control output • Optical encoder, HEDL 5540 • dSPACE encoder input 7. Draw a schematic connection diagram of the involved software components: • Encoder counter input • Reference angle input (user input) • Motor control signals output • Signal conversion blocks (if needed) • Controller (P or PI) • Run/Stop function Page 1 of 4 Flumes TMMS04 – Mechatronics September 16, 2014 8. Indicate in the two diagrams which software components correspond to which hardware components. That is which are the hardware / software interface components. 9. Use the data sheets and try to find out which pins are needed on the H-Bridge and Encoder. Try to figure out as many connections as possible. You will get more information during the lab when you have access to the real hardware. Figure 2 shows the connector board and the encoder ribbon cable connectors. The LMD18200 is attached at the top of the board. The encoder will be connected at the bottom. Draw in the pin diagram on the next page. 10. Find the answer to the following questions about the LMD18200. • What is the maximum operating temperature? • At what temperature will the overheat warning activate and how is this visible? • What is the power loss at about 60 deg C when the motor power consumption is 3A at 42V? • What is charge-pump and why may bootstrap capacitors be needed? • Are bootstrap capacitors needed in this lab? • How to connect an oscilloscope to see the PWM? How will the signal look like? • How to connect an oscilloscope to see the current through the motor? Using and not using the LMD18200. How will the signal look like? 11. Find the answer to the following questions about the HEDL 5540 Optical encoder. • Which is the most likely, that the encoder is attached to the angle indicator or the electric motor? • What is the encoder angular resolution in radians, and in degree? Page 2 of 4 Flumes TMMS04 – Mechatronics September 16, 2014 • How many pulses per second does the encoder emit when the motor is running at 9800 rpm? • What is the main difference between the HEDS and HEDL models (except for the number of available sub-models)? • How many output signals from the encoder do you at least have to use? 12. Determine an equation for the theoretical angular resolution of the entire servo. 3 Lab 3.1 Prices The components in this lab cost (all prices given excluding VAT): • Motor — 600 SEK • Gearbox — 600 SEK • Encoder — 650 SEK 3.2 Tips • Use 15V to feed the amplifier. Do NOT connect 15V to the encoder. • You will not have a dedicated 5V power supply, but you may find 5V available somewhere else. • Connections to the dSPACE I/O board are described on pages 155-161 of the dSPACE “Installation and Configuration Guide”. • If you are unsure about what is connected to what, use the “beep” function on the multimeter. Be very careful not to short circuit anything, only do this when the power is turned off. 3.3 Tasks 1. Familiarise yourself with the lab equipment, try to locate the individual components and make sure that you know exactly what models you are working with. Also make sure that you are have got all connector pin configurations right. 2. First make sure that you can manually control the motor from dSPACE. That is, do NOT connect or use the encoder. You must be able to manually start, stop and set the rotation direction before you can go on to the next step. 3. Connect the encoder to dSPACE and add a controller to your program so that it will automatically position the angle indicator at the reference value that you specify. Also make sure that you can set the controller gains from your interface. You do not have to normalize the angle between 0 and 360 degrees. If you make an input step from 0 to 720 degrees the indicator should make two revolutions. 4. What is the theoretical resolution of the servo? Is that achieved? Page 3 of 4 Flumes TMMS04 – Mechatronics September 16, 2014 Figure 2: Left: The holes in the connector board are connected to each other according to the dashed line markings. Either long rows or columns or short multicolumn rows. Right: Flat ribbon cable is used for signal transfer. The red color on the cable shows you pin 1. Usually pin 1 is also marked by a small arrow on the connector itself. The arrow have been highlighted in the image. Look for it on the real connector. Page 4 of 4
© Copyright 2026 Paperzz