DOC PREVIEW
GVSU EGR 345 - Lab 8 - System Modeling

This preview shows page 1-2-3 out of 8 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 8 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

10.0.1 Lab 8 - System Modeling10.0.1.1 - Purpose10.0.1.2 - Background10.0.1.3 - Theory10.0.1.4 - Prelab10.0.1.5 - Equipment10.0.1.6 - Experimentalegr345 lab guide - 10.110.0.1 Lab 8 - System Modeling10.0.1.1 - PurposeTo simulate and then build a motor controller for position control using a potenti-ometer.10.0.1.2 - BackgroundIn the previous laboratory we modelled a motor using a differential equation that did not include friction. To compensate for the effects of friction a deadband compensator was used. If we include friction in the model for the motor it is possible to develop a better motor model that is more accurate. It also makes it possible to develop a simulation that accurately models the system as a whole.10.0.1.3 - TheoryThe differential equation is rederived in Figure 10.1 and Figure 10.2 to include a term for friction. In the derivation it is assumed that the motor is turning, and the friction is dynamic. Clearly the motor will not turn if the motor torque is less than the static friction limit. Figure 10.1 The torque and inertia in a basic motor model+-RVoltage+-SupplyJ2J1IVsT ω,VmNext, consider the power in the motor,PVmITω KIω===Because a motor is basically wires in a magnetic field, the electron flow (current) in the wire will push against the magnetic field. The torque (force) generated will be proportional to the current.TmKI=Vm∴ Kω=M∑TmTF– Jddt-----ω==Consider the dynamics of the rotating masses by summing moments.Tm∴ Jddt-----ω TF+=I∴TmK------=egr345 lab guide - 10.2The coefficients for the differential equation in Figure 10.2 can be found for the motor in a dynamic case using steady state velocities. The static torque value can be found using the deadband limits. Figure 10.2 The first-order model of a motor experiencing kinetic frictionPotentiometers measure the angular position of a shaft using a variable resistor. A potentiometer is shown in Figure 10.3. A potentiometer is based upon a resistor, normally made with a thin film of resistive material. A wiper can be moved along the surface of the resistive film. As the wiper moves toward one end there will be a change in resistance pro-portional to the distance moved. If a voltage is applied across the resistor, the voltage at the wiper interpolate the voltages at the ends of the resistor.The current-voltage relationship for the left hand side of the equation can be writ-ten and manipulated to relate voltage and angular velocity.IVsVm–R------------------=TmK------∴VsKω–R--------------------=Jddt-----ω TF+K------------------------------∴VsKω–R--------------------=ddt-----ωωK2JR------+∴ VsKJR------TFJ------–=ω 0= TFTs<,ifω 0≠ TFTk<,ifegr345 lab guide - 10.3Figure 10.3 A PotentiometerThe potentiometer in Figure 10.4 is being used as a voltage divider. As the wiper rotates the output voltage will be proportional to the angle of rotation. Figure 10.4 A Potentiometer as a Voltage DividerPotentiometers are inexpensive but have limited accuracy, normally in the range of 1%. They measure absolute position, and are calibrated by rotating the shaft to given angles and measuring the resulting output voltage. The range of rotation is normally lim-ited to less than 360. An example of a potentiometer used for position feedback is given in schematicphysicalresistivewiperfilmV1V2VwV1VwV2V2V1VoutVoutV2V1–()θwθmax-----------V1+=θmaxθwegr345 lab guide - 10.4Figure 10.5. Figure 10.5 Position control systemFor the laboratory this week we will use a system like that defined in Figure 10.6, with a potentiometer for position feedback.68HC11PWMCW (PD2)CCW (PD3)Analog InVrlH-bridge(L293D)motorpotentiometershaft couplerCdVrhegr345 lab guide - 10.5Figure 10.6 Block diagram of a position control systemA control system can be evaluated numerically using a program similar to the one shown in Figure 10.7 and Figure 10.8. The program uses the simple model of the motor, without friction, and proportional feedback control. The program has also been designed to model the potentiometer input and PWM output.Cddesired position setpoint (0 to 255)=Kpθθ the rotational position of the motor (0rad to 6.3rad)=Vzerothe zero position for the potentiometer (V)=CpCuCpthe position value (0 to 255)=CdVLVsKpotthe potentiometer angle voltage constant (V/rad)=where,Kpthe proportional gain=Cethe position error (-255 to 255)=PWM motorpotentiometerA/D-+Cuthe control output (-255 to 255)=VLvoltage proportional to angle of load (0 to 5V)=Vseffective voltage to the motor (-12V to 12V)=KpotθLVzero–Ceegr345 lab guide - 10.6Figure 10.7 Scilab program to simulate position feedback control// lab_model.sce// System component valuesK = 0.5; // motor speed constant R = 7; // motor resistance J = 0.005; // rotor inertia // System statetheta0 = 0.0;// the initial position for the motoromega0 = 0.0;X=[theta0, omega0];moving = 0;// the system is not in motion// The controller definitionCd = 20;// the setpointKpot = 1.72;// the angle voltage ratioVzero = 0;// the voltage when the pendulum is verticalVadmax = 5;// the A/D voltage rangeVadmin = 0;Cadmax = 255;// the A/D converter output limitsCadmin = 0;Kp = 5; // position feedback gainVpwmmax = 12; // PWM output limitations in VCpwmmax = 255; // PWM input rangeCdeadpos_static = 10;// deadband limits for static torqueCdeadneg_static = 20;Cdeadpos_dynamic = 10;// deadband limits for static torqueCdeadneg_dynamic = 20;function foo=control(state, t)VL = Kpot * state($,1) - Vzero;// estimate input voltage for pot.Cp = (VL - Vadmin) / (Vadmax - Vadmin) * (Cadmax - Cadmin);// estimate A/D inputif Cp > Cadmax then Cp = Cadmax; end// check for voltages over limitsif Cp < Cadmin then Cp = Cadmin; endCe = Cd - Cp;Cu = Kp * Ce;if abs(state($,2) > 0.01) thenCdeadpos = Cdeadpos_dynamic;Cdeadneg = Cdeadneg_dynamic;elseCdeadpos = Cdeadpos_static;Cdeadneg = Cdeadneg_static;endCpwm = 0;if Cu > 0.99 then// deadband compensationCpwm = Cdeadpos + (Cu/Cpwmmax)*(Cpwmmax - Cdeadpos);endif Cu <= -0.99 thenCpwm = -Cdeadneg + (Cu/Cpwmmax)*(Cpwmmax - Cdeadneg);endfoo = Vpwmmax * (Cpwm / Cpwmmax) ; // PWM outputif foo > Vpwmmax then foo = Vpwmmax; end // clip voltage if too largeif foo < -Vpwmmax then foo = -Vpwmmax; endendfunctionegr345 lab guide - 10.7Figure 10.8 Scilab program to simulate position feedback control10.0.1.4 - Prelab1. Develop a Scilab worksheet to simulate the differential equation for the motor model


View Full Document

GVSU EGR 345 - Lab 8 - System Modeling

Documents in this Course
Y Axis

Y Axis

2 pages

Load more
Download Lab 8 - System Modeling
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab 8 - System Modeling and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab 8 - System Modeling 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?