Position Control of a DC Motor

pdf

School

University of Calgary *

*We aren’t endorsed by this school

Course

585

Subject

Mechanical Engineering

Date

Feb 20, 2024

Type

pdf

Pages

12

Uploaded by CountAntPerson493

Report
Page 1 of 12 ENME 585 Position Control of a DC Motor Introduction In this lab, you will use feedback to control the position of a DC motor (the Quanser QUBE Servo 2) and investigate the performance of PID (proportional integral derivative) control. In Lab 1, you found the model parameters of the motor from its speed response. In this lab, you will measure and control motor position instead of speed. Objectives To observe the response of a second-order system. To understand the effect of P, PI, and PD control. To observe performance limitations of a real feedback system. Submission Requirements Prelab Questions: Prelab questions are to be completed individually and submitted to the Dropbox on D2L before the start of your lab session . Lab Submission Worksheet The labs are to be completed in groups of 1 to 2 students, and one Lab Submission Worksheet is to be submitted per group, including the full name and student number of both students, the date, and lab session. Submit the Lab Submission Worksheet via D2L into the Dropbox of both students. Theory Recall the dynamic model of a dc motor with negligible armature inductance, 𝜏𝜔̇ (𝑡) + 𝜔(𝑡) = ?𝑣(𝑡) , (1) where 𝜔 is the angular speed of the motor shaft, 𝑣 is the input voltage, and 𝜏 and ? are constant parameters that you found experimentally in a previous lab. If 𝜃 is the angle of the shaft, then substituting 𝜔 = 𝜃 ̇ into (1) gives the motor model with position 𝜃 as output: 𝜏𝜃 ̈ (𝑡) + 𝜃 ̇ (𝑡) = ?𝑣(𝑡) . (2) In operational notation, we write this as (𝜏? 2 + ?)𝜃 = ?𝑣 , which gives 𝜃 = 𝑃(?)𝑣 , with
Page 2 of 12 𝑃(?) = ? ?(𝜏?+1) (3) as the motor (plant) transfer function, mapping input voltage to output position. A system block diagram for the plant with a feedback controller is shown in Figure 1 below. Figure 1: Block Diagram of the DC Motor Plant and Controller The goal of feedback control is to make 𝜃(𝑡) follow some desired reference position 𝑟(𝑡) with small error ?(𝑡) = 𝑟(𝑡) − 𝜃(𝑡) . The control ?(?) responds to the measured error with a motor input 𝑣 = ?(?)? , where ?(?) is a control transfer function to be chosen. Hence, ? = 𝑟 − 𝜃 = 𝑟 − 𝑃𝑣 = 𝑟 − 𝑃?? , which may be rearranged to give ? = 𝑇 ?? (?)𝑟 , where 𝑇 ?? (?) = 1 1+𝑃(?)?(?) (4) is the closed-loop transfer function from reference 𝑟 to error ? . PID control is defined as 𝑣(𝑡) = 𝑘 ? ?̇(𝑡) + 𝑘 𝑝 ?(𝑡) + 𝑘 𝑖 ?(𝜏)?𝜏 ? −∞ , (5) where 𝑘 ? is the derivative gain, 𝑘 𝑝 is the proportional gain, and 𝑘 𝑖 is the integral gain. This may be written in operational notation as 𝑣 = ?(?)? , where ?(?) = 𝑘 ? ? + 𝑘 𝑝 + 𝑘 𝑖 /? , or in rational form: ?(?) = 𝑘 𝑑 ? 2 +𝑘 𝑝 ?+𝑘 𝑖 ? . (6)
Page 3 of 12 Prelab Questions Submit your answers to these questions to the Dropbox on D2L prior to your lab session. Each student must submit their own answers. 1) Substitute the motor transfer function (3) and the PID transfer function (6) into (4) to obtain the closed-loop transfer function 𝑇 ?? (?) , and express your answer as a ratio of polynomials in ? . 2) Suppose that 𝑇 ?? (?) is stable. If a step reference 𝑟 = [1] = ℎ = 1/? is applied, what is the steady- state error ? ?? = ?(∞) , and why? What will be the value of ? ?? if a ramp reference 𝑟 = [𝑡] = ℎ 2 = 1/? 2 is applied? Assume that 𝑘 𝑖 > 0 and 𝑘 𝑝 > 0 3) Suppose instead that 𝑘 𝑖 = 0 , so the PID control reduces to a PD control. Does this change the steady-state errors in response to step and ramp reference inputs? If so, by how much? 4) The transient response of the feedback system depends on the poles of 𝑇 ?? (?) , which are the roots of the denominator polynomial in 𝑇 ?? (?) . For the case of PD control, what is the order of this polynomial (i.e., how many poles does 𝑇 ?? (?) have)? Give an example of a purely mechanical system of the same order. Qualitatively, what is the effect of increasing 𝑘 𝑝 on the step response of the feedback system? What is the effect of increasing 𝑘 ? ? Justify your answers by relating the control gains to the physical parameters in your mechanical analogy. Experimental Setup 1. Warnings/Safety Review the following warnings prior to operating the lab equipment [1]: CRITICAL FOR THIS LAB : Holding the motor in a stalled position for a prolonged period of time at applied voltages of over 5V can result in permanent damage. The model will prevent voltages of over 5V from being applied. Do not change the values in the saturation block of the model. ESD Warning: QUBE-Servo 2 internal components are sensitive to electrostatic discharge. Before handling the QUBE-Servo, ensure that you have been properly grounded. Warning: High-frequency signal applied to a motor will eventually damage the
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Page 4 of 12 motor brushes. The most likely source for high frequency noise is derivative feedback. If the derivative gain is set too high, a noisy voltage will be fed into the motor. To protect your motor, you should always band limit your signal (especially derivative feedback) to a value of 50 Hz . Caution: Max motor input ± 10 V, 2 A peak, 0.5 A continuous . 2. System Setup a) The QUBE Servo 2 system will be setup by the TAs prior to the start of the lab. If you need to setup the equipment yourself or require additional guidance on its operation, refer to the quick start guide for the QUBE Servo 2 (reference [2]) provided on D2L. b) Download all the Simulink and MATLAB script files from the Lab 3 folder on D2L to your working directory for this lab exercise. Open MATLAB and ensure that the “Current Folder” in MATLAB is set to this directory. This will ensure that the data from the Simulink model is saved in this directory and will ensure that the MATLAB scripts will work properly. NOTE: Ensure you are using MATLAB/Simulink 2021b and QUARC 2022. You will perform the lab experiment using the Simulink model entitled DC_Motor_Model_2021b_pos_ctrl .mdl”. For guidance on running Simulink files to operate Quanser lab equipment, refer to Appendix A in the Lab 1 handout. The Simulink model is shown in Figure 2 below. The model has been designed to simplify the execution of the lab exercises with all parameters that will be changed highlighted in colour. All of the switch selection boxes are coloured green. All of the input gains are coloured orange. The PID controller gains are coloured blue, violet, and yellow. The scope window will display the recorded signals, which can be exported to Figures for including in the Lab Submission Worksheet (refer to Appendix B in the Lab 1 handout). The data is also saved to a MATLAB data file for further manipulation and plotting if required.
Page 5 of 12 Figure 2: Simulink DC Motor Model Procedure We will investigate P, PI, and PD control of the motor shaft angle, which is measured by an optical encoder. For all experiments, the inertial disc should be installed on the rotor of the QUBE. Answer all numbered questions in BLUE text in the Lab Submission Worksheet. 1. Setting the Inertial Disc on the Rotor A clockwise rotation of the rotor produces positive angular measurements. The zero position of the (incremental) encoder is set as its current position when the Simulink model is executed. i. After mounting the inertial disc on the rotor, turn the disc and rotor to align the middle-etched line on the disc with the 0 degree mark on the QUBE body each time before executing the Simulink model. This alignment is shown in the photo below.
Page 6 of 12 Figure 3: Correct alignment of the rotor and inertial disc before executing the Simulink model
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Page 7 of 12 2. Proportional (P) Control 2.1. Explore the step response for 2 proportional gains in the following steps: i. Set up the motor model for PID control of position with closed-loop feedback with proportional control only, with a step input. To do this, set the model parameters as outlined below. Note that with the system set to closed loop, the system input is the reference or target angular position. Switch Parameter Value PID Gain Parameter Value Input Gain Parameter Value (rad) Switch 1 1 Kp 0.5 A. Step Gain (now reference angle) 3 Switch 2 2 Ki 0 Switch 3 2 Kd 0 Switch 4 2 Switch 5 1 ii. Additionally, adjust the settings of the step input to introduce a delay of 0.3 seconds. To do this, double click on the step block (shown below) in the Simulink model to edit the block parameters. In the block parameters window that opens, set the “Step Time” field to 0.3 seconds as shown in the figure below, and click OK.
Page 8 of 12 iii. Set the experiments to run for at least 3 seconds. To do this, in the Hardware Tab enter 3 in the “Stop Time” field. iv. Before running the experiment, each time rotate the rotor to an angular position of 0 degrees. Run the experiment for 𝑘 𝑝 = 0.5 and 𝑘 𝑝 = 3 . Export the scope plots to figures as done in previous labs. Refer to Appendix B in the handout for Lab 1 for instructions on this if necessary. Run the script in “ENME585_Lab3_Simulated_Response.m” (the script) with the above gains and your determined c and τ values from Lab 1 to produce theoretical step and ramp responses for the same gains. Q1. Include your physical and simulated step response plots for 𝑘 𝑝 = 0.5 and 𝑘 𝑝 = 3 in the Lab Submission Worksheet. Answer the questions in the worksheet. 2.2. Gain a tactile feel for the effect of the proportional controller gain in the following steps. i. CRITICAL NOTE: Holding the motor in a stalled position at voltages greater than 5V will permanently damage the equipment. Ensure that you monitor the motor current in the scope throughout this exercise and ensure that it does not exceed 0.5 A. ii. CRITICAL NOTE: change the saturation block to 5V. To do this set: Switch 5: set to 2. iii. To do this enter the character string “inf” in Stop Time in the Hardware Tab. Set 𝑘 𝑝 = 0.5 . iv. Run the step response experiment for a step reference of 1 rad. When it reaches steady state, grip the disc with your fingers and gently twist it back to zero rad, noting the stiffness. Do not force a rotation greater than 1 radian (approx. 60 degrees). Repeat for 𝑘 𝑝 = 3. Q2. Answer questions about your observations in the Lab Submission Worksheet. 2.3. Explore the ramp response of the system for 2 proportional gains as follows: i. Set the system to produce a ramp response. To do this set: Switch 1: set to 2 Switch 5: set to 2 Set block B. Ramp Gain to 30 Set the Stop Time in the Hardware Tab to 6 seconds ii. Run the ramp response experiment with 𝑘 𝑝 = 0.5 and 3. Export the scope plots to figures.
Page 9 of 12 Run the script with the above gains to produce theoretical step and ramp responses for the same gains. (Note: you will see some oscillatory behaviour in the system response. This is an artifact of the direct drive motor of the QUBE system. This is not related to the controller response.) Q3. Include your physical and simulated ramp response plots for 𝑘 𝑝 = 0.5 and 𝑘 𝑝 = 3 in the Lab Submission Worksheet. Answer some questions about the ramp response in the worksheet. 3. PD Control Adding derivative control adds damping to the transient response. In this section you will explore the effect of derivative control on step response. 3.1. Explore the step response of the system under PD control in the following steps. i. Introduce derivative control to the controller. To do this set the PID gains as outlined below: PID Gain Parameter Value Kp 2 Ki 0 (no change) Kd 0.01 ii. Set the reference input back to a step input with a target position of 3 radians and set the experiment duration to 3 seconds. To do this set: Switch 1: set to 1 Switch 5: set to 1 Block A (step gain): set to 3 Set the Stop Time in the Hardware Tab to 3 seconds iii. With 𝑘 𝑝 = 2, run the experiment for 𝑘 ? = 0.01 and 0.3. Before running each experiment, return the disc to the 0 radian position. Export the scope plots to figures. Run the script with the above gains to produce theoretical step and ramp responses for the same gains. Q4. Include your physical and simulated step response plot figures for 𝑘 ? = 0.01 and 𝑘 ? = 0.3 in the Lab Submission Worksheet. Answer some questions about the step response in the worksheet.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Page 10 of 12 3.2. Gain a tactile feel for the effect of the PD controller in the following steps. i. CRITICAL NOTE: Holding the motor in a stalled position at voltages greater than 5V will permanently damage the equipment. Ensure that you monitor the motor current in the scope throughout this exercise and ensure that it does not exceed 0.5 A. ii. CRITICAL NOTE: change the saturation block to 5V. To do this set: Switch 5: set to 2. iii. To do this enter the character string “inf” in Stop Time in the Hardware Tab. Keeping 𝑘 𝑝 = 2, set 𝑘 ? = 0.1 . iv. Run the step response experiment. Gently gripping the disc, wiggle it back and forth at different speeds and observe how it feels. Repeat for 𝑘 ? = 0.9. Q5. How does the resistance torque that you feel depend on the speed that you wiggle the disc? 4. PI Control 4.1. Explore the step response of the system under PI control in the following steps. i. Introduce proportional-integral (PI) control to the controller. To do this set the PID gains as outlined below: PID Gain Parameter Value Kp 1 Ki 1.7 Kd 0 ii. Set the reference input back to a step input and set the experiment duration to 3 seconds. To do this set: Switch 1: set to 1 Switch 5: set to 1 Block A (step gain): set to 3 Set the Stop Time in the Hardware Tab to 3 seconds iii. Keeping 𝑘 𝑝 = 1 and 𝑘 ? = 0 , run the experiment using: 𝑘 𝑖 = 1.7 and 4 Export the scope plots to figures. Run the script with the above gains to produce theoretical step responses for the same gains.
Page 11 of 12 Q6. Include your physical and simulated step response plots for 𝑘 𝑖 = 1.7 and 𝑘 𝑖 = 4 in the Lab Submission Worksheet. Answer some questions about the step response in the worksheet. 4.2. Gain a tactile feel for the effect of the PI controller in the following steps. i. CRITICAL NOTE: Holding the motor in a stalled position at voltages greater than 5V will permanently damage the equipment. Ensure that you monitor the motor current in the scope throughout this exercise and ensure that it does not exceed 0.5 A. ii. CRITICAL NOTE: change the saturation block to 5V. To do this set: Switch 5: set to 2. iii. To do this set the simulation Stop Time to “inf” in the Hardware Tab. Keeping 𝑘 𝑝 = 1, set 𝑘 𝑖 = 1.7 . iv. Run the step response experiment. When the step response reaches steady state, loosely grip the disc and gently twist it back to 0 degrees and hold it there for 2 seconds. Do not apply a rotation greater than 1 radian (approx. 60 degrees) in magnitude. Release the disc from 0 degrees after holding it for 2 seconds. Observe what happens when you release the disc. Repeat the experiment, but holding the disc at zero degrees for 4 seconds. (Note: if you move the disc beyond 1 radian (approx. 60 degree) rotation, hold it for too long, or if you apply too much of a disturbance to the disc, the system can go unstable due to a phenomenon called integral windup. If this occurs, stop the model and repeat this step (4.2.iv).) Q7. Answer some questions about your observations in the Lab Submission Worksheet. 4.3. Explore the ramp response of the system with PI control in the following steps: i. Apply a ramp reference as the input. To do this set: Switch 1: set to 2 Switch 5: set to 2 Block B. Ramp Gain: set to 30 Set the Stop Time in the Hardware Tab to 10 seconds ii. Keeping 𝑘 𝑝 = 1 , and 𝑘 ? = 0 , run the ramp response experiment with 𝑘 𝑖 = 3. Export the scope
Page 12 of 12 plot to a figure. Run the script with these gains to produce theoretical step and ramp responses for the same gains. Q8. Include the physical and simulated ramp response plot in the Lab Submission Worksheet. Does the steady-state error match your prediction in prelab Question 2? iii. The stability of the system depends on the relative values of 𝑘 𝑝 and 𝑘 𝑖 and requires that 𝑘 𝑝 > 0 . Set 𝑘 𝑝 = 0 , and choose a nonzero value for 𝑘 𝑖 . Test this with a step response. Q9. What is the result of having 𝑘 𝑝 = 0 with a non-zero 𝑘 𝑖 ? References [1] User Manual: QUBE-Servo 2, Quanser Consulting Inc., Markham, ON, 2016. [2] Quick Start Guide: QUBE-Servo 2 USB, Quanser Consulting Inc., Markham, ON, 2016.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help