You are on page 1of 5

ME 411 Lab 7

Course Instructor: Dr.Atul Kelkar Lab Instructor: Ruchir Goswami (goswami@iastate.edu !ime Allocated: " #eek !otal $oints: %&

Due: At the end of the lab on Dec 3rd

Control Angle of 'Quanser' DC Motor Using dSPACE 1 Introduction


In the labs 1 and 2 you have derived the equation of motion for a DC motor and designed controllers using different methods. In this lab you will be implementing the controller using the Simulink model in atlab and dS!"C# data acquisition tool suite. $he data acquisition systems are used in wide variety of fields ranging from life sciences to engineering. %ut it is mainly used for real time simulation of comple& systems. It was not so long ago that hardware and processing power were e&pensive and software none&istent. #very program had to be written from scratch in low level languages. 'owadays there are many data acquisition systems to choose from( with good hardware and vastly improved software running on fast personal computers. $he high level languages like atlab( )ab*iew etc have made the programs very simple and short. Specially( Simulink toolbo& in atlab gives the diagrammatical view of the program. $he ready+made hard wares like dS!"C# board give e&cellent interface between sensors,actuators and the computer.

! "b#ecti$e
!reliminary ob-ective of this lab is to get acquainted with the computer+hardware interface like dS!"C#. In this lab you will design a controller in order to control the angle of the DC motor and then implement it using dS!"C# and .anser servo rotary module. /nce the e&periment is set up( then you can check the step response and frequency response of the closed loop system.

%igure 1 &loc' diagra( of a t)*ical DC (otor !aramenter *alue 0eq 1 2.34 & 1567+48 kgm2 %eq 1 2.9&1567+:8 ;e 1 ;m 1 5.554:4'mamp <m 1 2.: ohm <2 1 <11 1 +able 1 ,ariable ,alues

- +.e Plant Model


$he .uanser S<*52 series servo module which has a potentiometer and a DC motor will be used as a plant. $he schematic diagram of .uanser servo plant is shown in figure 1. $he equation of motion of this system is given by=

$he values of parameters are given in the table 1 "ssuming that the e&ternal mechanical force 7$D8 is >ero( the transfer function from input voltage to the angle of the motor is given by

4 Procedure
4/1 Part 1 011 Points2 deri$e controller d)na(ics
'ow design a !D controller for the plant model+ ?sys7s8 in order to control the angle of the DC motor. @ollow the same procedure as in the )ab 2( i.e. calculate the damping ratio 7>eta8 and natural frequency 7omega n8 from design criteria( and then compare the desired characteristic polynomial with the characteristic polynomial of the closed loop system. $he design criteria are + overshoot A1 9B. settling time A1 2sec. >ero steady state error. Cou can use the same atlab program you have written for previous labs.

4/! Part ! 011 Points2 Measure(ent of angle of t.e (otor


<eal+time Dorkshop block set in Simulink facilitates the computer+hardware interface with dS!"C# panel( hence we will build a simulink model for the software part of the system. It is important to have the simulink model as well as the dS!"C# e&periments in the same directory for connecting the two. $herefore make a separate directory on local drive and save all the Simulink models and dS!"C# e&periments in the same directory. In order to establish connection between the dS!"C# and matlab( use the block + DS115E"DC C9 as input block in your Simulink model. $he channel number can be selected through the block properties. $he dS!"C# internal gain is 5.1( hence in order to compensate for this gain( multiply the output of DS115E"DC C9 block by a gain of value 15. $he output from the gain block gives the e&act potential difference 7in *olts8 measured by the dS!"C# channel. 'ow set up the hardware needed to measure the angle. $he apparatus is a .uanser S<*52 rotary servo plant and a .uanser power source. $he servo plant has a DC motor( some gears and a potentiometer. Cou must be familiar with the functioning of the potentiometer. " diagram of the circuit to measure the voltage across variable resistor is given in figure 2. %efore turning on the power supply check the connections and then open the dS!"C#ControlDesk and create a new e&periment and save it in the same directory as the Simulink model. 'ow build the simulink model( then a lot of processes will be performed by the matlab. Dait until it says + Successful completion of <eal+$ime Dorkshop build process for model= ... /nce the model is built( go to the e&periment started in dS!"C# control desk. Cou should see an added tab at the bottom. 'ow create a new layout in the same e&periment and then bring a FdisplayF widget on your layout from the visual instruments available in the right hand side menu bar. $hen open the Eth tab at the bottom and e&pand the odel <oot tree node. Cou should see all the blocks you used in the simulink model. Drag the Fout1F variable in FgainF on to the FdisplayF widget.

%igure ! Connections for (easuring t.e angle of t.e (otor/ Gse the FCaptureSettingsF from FData "cquisitionF tab for setting up the data capture options. $here are many other virtual visual instruments in dS!"C# software which you can try. In order to start the data acquisition( start the F"nimation modeF from the toolbar and then turn on the power supply. Gse Fnumerical inputF visual instrument to change the value of the gain. $une the gain such that the output of the gain varies from Hpi to +pi in a full rotation of the potentiometer gear. Save the measured angle in a .mat Ile and plot the angle measured by the dS!"C# during one full rotation of the potentiometer gear. @or this( rotate the potentiometer by hand and record the angle measured by dS!"C#.

4/- Part - 013 Points2 I(*le(ent t.e controller


" controller dynamics can be included in the Simulink model( but then we need a digital to analog converter 7D"C8 as a power source. Search for the block + DS115ED"C C1 and use it in your model as output block. $he output of the D"C in dS!"C# panel will be used to drive the motor( but the output power of dS!"C# is very low hence we need an amplifier. $he .uanser power module includes a power operational amplifier 7/p"mp8. $he theoretical background of /p"mps can be found in any power systems book. In order to compensate for the internal gain of the D"C( we need a gain of value 5.1 in the Simulink block. "lso use the saturation block before the output block to avoid the high voltages. 7In case the controller is unstable( then the output may keep on

increasing( which is not desirable8

Figure 3: Schematic diagram of the overall system. $he schematic diagram of software+hardware combined system is shown in figure 2. %uild a simulink model with D"C and "DC blocks as Foutput to hardwareF and Finput from hardwareF. %efore connecting the new circuit( turn on the power supply and then make the connections. @or this part of the lab( use square wave input of unit amplitude from the signal generator. <ead the angle of the motor using dS!"C# visual instruments. <ecord and save the input as well as the angle data for at least one period of the input. !lot step response by cropping the data set. Compare the e&perimental plot with the step response obtained from the matlab+ FstepF command. Comment on the e&perimental response.

4/4 Part 4 013 Points2 %re4uenc) res*onse


$he ob-ective of this part is to plot the %ode amplitude and phase plots using the data acquisition tool. $his time use the sinusoidal inputs and record the input data as well as the angle of the motor using dS!"C# visual instruments for at least 2 cycles of input. Compute the amplitude of input and output signal( calculate the amplitude ratio in d%. "lso calculate the phase difference between input signal and angle of the motor. <ecord the data for 3 to 15 different input frequencies and then plot the phase and magnitude %ode plots using atlab or #&cel.

3 %inal 5ords
Dhat to turn in+ $he atlab code and its output or hand calculations for the process of designing the !D controller. Clearly write the values of gains ;p and ;d. Simulink model for part 2( screen shot of dS!"C# control desk layout for part 2( plot of angle measured by dS!"C# for one complete rotation of the potentiometer gear. Simulink model for part 2( screen shot of dS!"C# control desk layout for part 2( a plot comparing square wave input and measured angle. " table for amplitude ratios and phase angles at different input frequencies. agnitude and phase bode plots. " small note on difference between e&pected 7theoretical8 responses and actual 7e&perimental8 step responses. $his lab e&ercise is a group e&ercise but write the reports independently.

You might also like