Speed 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

21

Uploaded by CountAntPerson493

Report
ENME 585 Speed Response and Control of a DC Motor Introduction In this lab, you will investigate the speed response of a DC motor to step and ramp voltage inputs. The experiments will be performed on the Quanser QUBE Servo2 motor. Objectives To become familiar with the DC motor. To study the response of a first-order system. To investigate the linearity of the system. To identify the time constant and DC gain of the system for different inertial loads. To apply proportional speed control and investigate the effect of the control gain on the time constant and the steady-state speed tracking error. Submission Requirements Prelab Questions: Prelab questions are to be completed individually and submitted to Dropbox by the due date and time posted on D2L . 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 A model of a DC motor appears on page 57 of the textbook (Franklin, 8 th Ed., reference [1]), as a pair of differential equations (2.62, 2.63) relating the armature voltage 𝑣 to the armature current 𝑖 and the motor shaft angle 𝜃 . If the armature inductance 𝐿 is neglected, 𝑖 may be eliminated from these equations to give 𝜏𝜔̇ (𝑡) + 𝜔(𝑡) = 𝑐𝑣(𝑡) , (1) where 𝜔 = 𝜃 ̇ is the shaft speed, and the constants 𝜏 and 𝑐 depend on the physical parameters of the motor. Instead of calculating 𝜏 and 𝑐 from these physical parameters, we will determine these constants experimentally from the step response of the motor.
Prelab Questions These prelab questions are to be completed individually and submitted to the Dropbox on D2L before the start of your lab session. 1) Why is it preferable to find 𝜏 and 𝑐 from experiment (based on equation (1)), rather than calculating them from the physical parameters that appear in equations (2.68) and (2.69) of the textbook (e.g., using manufacturer’s data). Give 2 reasons. 2) Solve equation (1) to find the motor speed 𝜔(𝑡) in response to a unit step input 𝑣(𝑡) = 1 . Assume the motor is initially at rest and express your answer in terms of 𝜏 and 𝑐 . 3) The DC gain of the motor is the steady-state value of 𝜔 due to a unit step input. Use your answer from (2) to find the DC gain of the motor in terms of 𝜏 and 𝑐 . 4) The motor time constant is the time required for the motor to reach 63.212% of its steady-state speed following a step input. Use your answer from (2) to find the motor time constant in terms of 𝜏 and 𝑐 . 5) Qualitatively, what is the effect on 𝜏 and 𝑐 of increasing the inertial load driven by the motor? 6) Find the motor speed 𝜔(𝑡) in response to a unit ramp 𝑣(𝑡) = 𝑡 . Assume the motor is initially at rest and express your answer in terms of 𝜏 and 𝑐 . 7) If proportional control 𝑣(𝑡) = 𝑘 𝑝 𝑒 = 𝑘 𝑝 (𝜔 ? − 𝜔) is applied to the motor (1), find the time constant 𝜏 ? of the closed-loop system and the steady-state error 𝑒 𝑠𝑠 in response to a constant reference 𝜔 ? . These can be expressed in terms of 𝑘 𝑝 , 𝜔 ? , the plant time constant 𝜏 , and dc gain 𝑐 . Experimental Setup 1. Warnings/Safety Review the following warnings prior to operating the lab equipment [2]: 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 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 . Caution: Holding the motor in a stalled position for a prolonged period of time at applied voltages of over 5V can result in permanent damage.
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 [3]) provided on D2L. b) Download all the Simulink and MATLAB script files from the Lab 1 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_speed_ctrl. mdl”. For guidance on running Simulink files to operate Quanser lab equipment, refer to Appendix A. The Simulink model is shown in Figure 1 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 the switch selection boxes are coloured green. All the input gains are coloured orange. The PID controller gains are coloured blue, violet, and red. 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). The data is also saved to a MATLAB data file for further manipulation and plotting if required. Figure 1: Simulink DC Motor 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
Lab Procedure 1. Model Identification via Step Response a) Set up the model switches to apply an open loop step input (no PID control) and to plot the motor speed. To do this, set the model parameters as detailed below: Model Switch Parameter Value Switch 1 1 Switch 2 1 Switch 3 1 Switch 4 1 b) Attach the inertial disc to the motor. c) Apply a step voltage of 2 V to the DC motor (the maximum voltage that should be applied to the motor is 5 V). To do this, set: Block A (step gain) to 2. Open the scope plot of the response and export it to a Figure as detailed in Appendix B. Use the Figure to pick appropriate data points to find the values of 𝑐 and 𝜏 . Q1. Include the Figure showing the selected data points, and the values of 𝑐 and 𝜏 in the Lab Submission Worksheet. d) Open the Lab1_Step_Overlay.m ” MATLAB script in the working directory that the Simulink model saved the data to. Enter the values for 𝑐 and 𝜏 that you determined in step c), and other relevant parameters in the indicated place in the MATLAB script. Run the script. A new plot figure should appear showing the overlay of the Simulink data with a step function; scale the axes of this plot to match the one generated by the motor (for ease of comparison). Observe the difference between the measured and modeled response. Q2. Include this Figure in the Lab Submission Worksheet. Also, provide possible reasons for any differences. e) Apply a step input of 4 V (set step gain Block A to 4) and observe the scope output. Q3. Export the scope output to a Figure and include it in the Lab Submission Worksheet. Is the output speed twice that found in (c)? Is the system linear? f) Remove the inertial disc and repeat part (c). Q4. Export the scope output to a Figure and include it in the Lab Submission Worksheet. Does the effect of inertia on the time constant and DC gain match what you predicted in part (5) of the prelab?
2. Proportional Speed Control a) With the inertial disc attached, set up the motor model for PID control of speed with closed-loop feedback with proportional control only. To do this, set the model parameters as outlined below. Note that with the system set to closed loop, the system input becomes the reference or target motor speed 𝜔 ? . Switch Parameter Value PID Gain Parameter Value Input Gain Parameter Value (rad/s) Switch 1 1 (no change) Kp 0.1 A. Step Gain (now Target Speed) 20 Switch 2 2 Ki 0 Switch 3 2 Kd 0 Switch 4 1 (no change) b) Run the system for 3 values of 𝑘 𝑝 ranging from 0.1 to 0.2 volts per radian/s. Q5. E xport the scope output to a Figure and include it in the Lab Submission Worksheet. Describe how the step response changes as 𝑘 𝑝 is increased. Does the response become faster or slower? Does the steady-state error increase or decrease? c) For 𝑘 𝑝 = 0.2, select appropriate data points on the Figure export of the scope plot to find the closed-loop time constant 𝜏 ? and steady state error 𝑒 𝑠𝑠 from the step response. Do these values agree with those calculated from your answer to part (7) of the prelab using the values of 𝑐 and 𝜏 found experimentally in step 1c? Q6. Enter your answers in the Lab Submission Worksheet. References [1] G. F. Franklin, J. D. Powell, and A. Emami-Naeini, Feedback control of dynamic systems , 8th ed. Upper Saddle River, NJ: Pearson, 2018. [2] User Manual: QUBE-Servo 2, Quanser Consulti ng Inc., Markham, ON, 2016. [3] Quick Start Guide: QUBE-Servo 2 USB, Quanser Consulti ng Inc., Markham, ON, 2016.
Appendix A: Running Simulink Models with Quanser Laboratory Hardware Running a Simulink Model for QUARC 22 in Simulink 2021b The interface for QUARC 22 and the operating procedures have been greatly simplified compared to previous releases. For a QUARC 22 Simulink model that has been setup correctly (such as a Quick Start Simulink model provided by Quanser), and Quanser hardware which is connected and turned on in accordance with the instructions in the Quick Start Guide for that hardware, simply do the following: Click Monitor & Tune on the Hardware Tab . Simulink will compile the code and run it to the device. Building a Simulink model that will run correctly A QUARC model must have the Essential Elements of a Simulink Model for QUARC as detailed in the next section. When in doubt, it can be a good idea to start with a functioning Simulink model for that piece of equipment, and then modify the model to add in your preferred logic . An example would be Quanser’s Quick Start Simulink model for the Quanser equipment you are using. All of the blocks for interacting with the Quanser hardware will be setup correctly, though there may be some data channels from the hardware which were not used in that particular file.
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
Essential Elements of a Simulink Model for QUARC The following blocks are required to interface with a Quanser equipment through Simulink and QUARC. HIL-initialize block This is a block that must be included. It indicated that you are using Quanser hardware in the loop (HIL) and it identifies which piece of hardware to connect to, and any relevant special parameters to be used. Double click the HIL-initialize block to open its properties. Select the correct piece of hardware and appropriate options for the item from the drop down menus. There is also a set default options button at the bottom right of the properties window as indicated in the figures below. The figures show the settings for the Q2-USB DAQ.
HIL-read There are various analog or encoder specific read blocks in QUARC. But the HIL-read block is a generic block which can read from any channel. Double click to open the block properties and enter the appropriate analog or encoder channel to read from.
HIL-write There are various analog or other write blocks in QUARC. But the HIL-write block can do any. Double click to open the block properties and enter the appropriate analog channel to write to.
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
Troubleshooting Hardware Troubleshooting: Troubleshooting specific hardware refer to the use manual or the quick start guide for the Quanser equipment you are using. The Hardware Tab is not present in Simulink If the Hardware Tab is not present in the Simulink window when you have a QUARC Simulink file open, then the Simulink file likely does not have a QUARC target registered. In the QUARC tab, click the QUARC targets dropdown and select “quarc_win64.tlc”. If this does not work, from the same dropdown first click “quarc_linux_rt_armv7.tlc”, then select “quarc_win64.tlc”.
The model r an before but now it won’t run” If the model does not run when it had run previously, there may be some previously compiled code which is pointing to the equipment on a different channel or other potential issues. The previously compiled code should be cleared so that new code can be compiled for your equipment connections. Close the Simulink file. Check in MATLAB in the “Current Folder”. Check for Simulink cache files and folders with the same name as your Simulink file. Select them all and delete them. Reopen the Simulink file and try to run it again. Or on the QUARC tab in Simulink, click Clean-> Clean All
Appendix B: Capturing Figures from Scope Output The following procedure details the process of creating MATLAB figures from Simulink Scope outputs, and provides some pointers on selecting data points and for how to adjust the presentation of the figure with axis labels and figure title. There are a number of reasons to do this: MATLAB figures can be saved in a variety of formats MATLAB figure files also contain the vector data series MATLAB figures offer additional tools for data manipulation and presentation that the Simulink Scope does not 1. From the Scope window in Simulink, adjust the zoom level to include all of the data by clicking the “zoom extents” button. (Note: further adjustment of the window extents when it is ported over to a figure). Right click on the plot of the scope and select “Print Display to Figure”. A new Figure window will open with the data from the Scope plot.
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
2. In the Figure window, to select relevant data points, all other figure manipulation functions must be turned off. For example, if you currently have the hand/pan tool activated, click on its icon in the top right of the figure to turn it off. With no figure manipulation functions activated, to select relevant data points, hover the mouse cursor over the desired data set for a few seconds. A data point will be highlighted and a box detailing the x- and y-values of the data point will appear. Move the cursor along the data set and new data points will be highlighted. When a data point is highlighted that you want to select, left click and the point and its data box will stay highlighted in the plot.
3. To add a Figure Title, or an X- or Y- Axis label, select the appropriate option from the “Insert” menu. 4. To save the Figure to a file, click File->Save The figure can be saved as a MATLAB figure file or as a vector image file such as a .png
5. The figure can be copied to the clipboard as a vector file and directly pasted into a word processor. To do this click Edit-> Copy Figure 6. An example of a MATLAB figure copied and pasted into Microsoft Word is shown below.
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
Appendix C - Guide to Simulink model block insertion The DC-Motor-Model can be modified to have a sum of signals as its input. Since the lab procedure requires the sum of ramp and step signals, one way is to insert an additional ramp block and then add this new block to the existing step block. The following section explains the process involved. Step 1) Adding a new Ramp block Right-click on the existing Ram p” block and select C opy” (or select the Ram p” block by clicking on it and then select Edit a nd “ C opy” from the top menu bar, as shown in Figure 2. Right-click on the model and select P aste” (or select Edit and Paste from the top menu bar), as shown in Figure 3. Figure 2: Copy the existing Ramp block
Figure 3: Paste the new Ramp block. Note it has been renamed Ramp1.
Step 2) Adding and modifying a Sum block Right-click on the Sum block and select C opy”, as shown in Figure 4. Right-click on the model and select P aste”, as shown in Figure 5. Double click the Sum block to bring up the “ Param eters” dia l og box and under “ List of S igns” cha nge the +- configuration to ++, as shown in Figure 6. The output of this block is now the sum of its inputs. Figure 4: Copy the summation block
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
Figure 5: Paste the summation block Figure 6: Modify the summation block to output sum of its inputs
Step 3) Creating the connection signals Delete the existing connection from the S tep” block to the “Input Swi tch” and make new connections between the S tep”, Ram p1” and Sum blocks. Make sure that the output from the Sum is connected to the first input slot on the “Input Sw itch”, as shown in Figure 7. Since the Input Selecto r” is set to 1, the input to the system is now the sum of Step and Ramp signals. Figure 7: Connect the Step and Ramp blocks as inputs to the Sum block. Connect output to channel 1 on Input Switch Step 4: Changing the Step and Ramp parameters The Step and Ramp input parameters may be changed to create a desired combination of signals. Double click on each block and modify the values as required. Figures 8 and 9 show the parameters dialog box for each input type. Also note that the input to the system can be made a pure Ramp by setting Step Final to 0 or a pure Step by setting the Ramp Slope to 0.
Figure 8: Input parameters for the Step block Figure 9: Input parameters for the Ramp block Step 5) Building and running the model The model needs to be rebuilt after changes are made to the blocks. This is done by selecting QUARC ” and then “ Bui ld” from the top menu bar.
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