You are on page 1of 7

Project 2: DC Motor Control

To: Dr. Timothy Burg From: Group 1 Subject: Project 2 Final Report Date: September 17, 2010 CC: Emily Artz, Damien Cameron, Hunter Hayes, Joshua Renzulli

Dr. Burg: Attached you will find the Report for Project 2 on DC Motor Control. Contained in the report are an overview of what we did for the project, an overview of closed loop control, and an explanation of closed loop control using Simulink. Disassembling the motor and stripping the circuit board of its components, except the potentiometer and the motor, was fairly trivial. Reassembling the motor to allow the potentiometer to provide the feedback through for the modified circuit was not difficult either, but it was done with caution to avoid any circuitry problems. As with any project there were problems that were encountered. Our problem was the motor would always turn to one extreme when any value over 5 was entered in the input block on the Simulink module. It was discovered that during the reassembling of the device the potentiometer was placed in backwards. After fixing this problem, we did obtain the desired output from the motor. This project not only provided the challenge of designing a system, but also forced us to practice some reverse engineering at times with disassembling the motor, and also trying to fix the error and understand what may have caused the problem in the first place. Engineering practices learned in this project will help with future encounters of problems with design and troubleshooting. Sincerely,

William Stewart Group 6 Leader

Project Overview The project consisted of displaying a closed loop control system using a servomotor and a potentiometer. The original motor was disassembled, and all electrical components were stripped from the circuit board leaving only the motor and the potentiometer. The potentiometer and the motor were then wired together to where the potentiometer would provide feedback to the Q4 board. That feedback is then used to determine the position of the motor through the module that was built in Simulink. The Simulink module contained the block diagram that would simulate the operation of the DC motor. The module also allowed for switching logic which would allow one to switch from Simulated mode to Real Mode. After verifying the completeness of the circuit, testing was done to check that the motor was operating correctly. The Simulink module contains a gain block that block that converts the input from the user to radians (using the following formula: pi*(170degree/180degree)/5V). According to the number that was entered into the input block, the motor would rotate the number of radians based on the value obtained from the formula. It was fairly trivial stripping the system board of its hardware, with the exception that some components were tougher than others to de-solder. Once wiring was completed the motor was tested using the Simulink module and enabling the real motor simulation. It was found that with any value that was put in the input block the motor would turn to its extremes, which is not the desired result. The desired result would have had the motor turn a specific amount based on the input in the Simulink model. If a zero was placed in the input block, then the motor would turn to one extreme. If a 170 was placed in the input block then it would turn to the other extreme. It was found that the potentiometer was reversed in the process of reassembling the motor, and the motor was trying to turn past what it was able to turn. After reversing the potentiometer further testing was conducted where we obtained the desired result. Overview of Closed Loop Control Closed-loop control is a very useful technique for controlling the output of a system. Instead of telling a system to perform a certain task and hoping that it accomplishes the task as desired, you can be certain a system with closed-loop control will accomplishes the task exactly as desired. Closed-loop control looks at the output of the system, compares it to the desired output, and then adjusts the output so that the system will reach the desired output. There are many instances when incorrect output of a system is not only undesired, but also dangerous. Closed-loop control is a way of making a system safer so that people are not harmed by the system. It can also be used to make a system very precise, such as in a surgical robot. Robots use cameras and a variety of other sensors to determine exactly how to move to the desired state or position. These sensors make up the robots feedback mechanisms. In addition to robots, closed-loop control is also used in regulation equipment to control valves and monitor the rate of flow of a particular substance. One such example would be a natural gas infrastructure, in which the gas company could

monitor the gas flow in a particular pipe and automatically adjust it to match a desired level.

Block Diagram of a Closed-Loop Control System

A Proportional-Integral-Derivative Controller, or PID, is a feedback mechanism that attempts to minimize error in a systems output. To accomplish this, the PID calculates the proportional, the integral, and the derivative of the error signal, sums them, and then sends that signal to the process. The proportional of the error signal is what the system should do based on the current error, the integral is what it should do based on recent errors, and the derivative is what it should do based on a prediction of future error. All three of these terms are controlled by constants, which can be adjusted to suit the specific application. By using a PID controller to minimize the error of a system, the system can be made more precise and can possibly even be opened up to further applications that would not have been previously possible with the less precise system.

Block Diagram of a PID Controller

Closed Loop Control Using Simulink For controlling the servo motor a PID model was setup to implement the closed-loop-control on the system. In a PID model each of the proportional gain (ki), integral gain (ki) and derivative gain (kd) effect the response of the closed-loop system in different ways yet they are each dependent on each other. Each value affects the rise-time, overshoot and steady-state error of the system in different ways. Changing one may change the effect the other two gains have on the system. Because of this it is hard to be 100 percent sure what change in kp, ki or kd will produce the desired output response. Ideally the system should have no overshoot, little (if any) steadystate error and a rise-time that is as fast as possible. Changing the ki value we found helped the most with reducing the steady-state error. If the ki value was to high the servo motor would alternate between positive and negative error and never reach an error of zero if however the value was to low the motor would not accurately reach the desired angle. The kd value adjusted the overshoot and to a lesser extent the rise-time. The kp was harder to gage how it changed the response of the system. It appears to slightly increase the overshoot so we tried several different values before landing on one that interfered as little as possible. Our final values were: kp = 1, ki = 0.06 and kd = 0. These values gave us no overshoot and very little steady-state error and fast rise-time. The figures below show the response of our servo motor to various changes in angle. In the figures Sum1 is the error reported by the servo and Sum2 is the current angle reported by the motor.

Figure 1 Change from 0 - 45 Degrees

Figure 2 - Change from 0 - 90 Degrees

Figure 3 - Change from 0 - 170 Degrees

Figure 4 - Change from 170 - 45 Degrees

The equipment in the lab seems to work great. The voltage amplifier allows us to get an accurate voltage output within a volt which is great for this type of output. The output from the Quanser Q4 board was a little tricky to hook up into because the necessary tools where not readily available. The output of the graphs were not labeled on the Target computer and made it a little more difficult to identify which graph was which. The DC voltage source works great and has a great set up that allowed us to get within a tenth of a volt accuracy. The motor that we used works great and had a great connection to the pedometer. As shown below the silicon board was used just to hold the motor in place and all of the wires where soldered directly to the locations they needed to be at.

The pedometer was connected in the housing through a system of gears to the motor. The electronic component of it where hooked up to the yellow, red (on left), and center copper wire. The black wire and the center copper wire were connected to a common ground. The yellow wire was connected to the input of the Quanser Q4 board to create a feedback loop. The red (right) wire was hooked up to the voltage amplifier which was connected to the output of the Quanser Q4 board. This controlled the motor and determined which direction it would turn. Five volts was placed across the pedometer. The program and the motor then worked perfectly according to the input. The advantage to simulating a system and then perform hardware-in-the-loop is that it allows you to see what the output is supposed to look like. A simulation will give you a decent idea of what you should be getting as an output. This can help you identify a problem with the hardware layout is different from the software simulation. This experiment is suitable to our final project. This will greatly help us with the final project in controlling motors because the interface with Matlab is already there for us. Without this project it would increase the level of difficulty involved in making the final project work correctly.

Introduction to ECE495- Laboratory2 Group Name : Group 6 Group Members : Emily Artz, Damien Cameron, Hunter Hayes, Joshua Renzulli Score Pts ABET Outcom es 10 General Format - Professional Looking Document/Preparation (whole document) a) b) c) Project Memo Style Cover Letter (1 page) Spelling and grammar Grading sheet included as final page Overview g

20

< 1page describing the experiment Q: Can any non-technical person read this section and understand what you did in this experiment? 30 Overview of Closed-Loop Control What do we mean by Closed-Loop Control? In general, how does it work? Why would you use it? When would you use it? What does PID mean? (1-2 pages) 40 Closed-Loop Control Using Simulink Run the simulation to understand closed loop control What happens when you change the proportional gain, derivative gain, integral gain? Use the motor position control experiment to demonstrate the feasibility of using Simulink as a possible closed-loop controller for your main project. The point of this exercise is to give you practice in using the equipment AND in writing a good response to an unstructured question. Write your response from the perspective that you are at work and your boss has this software/hardware on a demonstration loan and asks you to Try it out and then Let me know what you think. You would describe what you have done including: Plots (references signal, actual position), diagrams, photos Observations about the equipment What is the advantage of software/hardware that can simulate a system and then perform hardware-in-the-loop (HIL) experiments? Answer the question Does this equipment seem suitable to our project? (~2-3 Pages including figures) k k

You might also like