# Digital Control Lab Islamic University of Gaza Eng: Moayed Mobaied DC MOTOR.

## Presentation on theme: "Digital Control Lab Islamic University of Gaza Eng: Moayed Mobaied DC MOTOR."— Presentation transcript:

Digital Control Lab Islamic University of Gaza Eng: Moayed Mobaied DC MOTOR

A Simple Electromagnet Q - How do we reverse the poles of this electromagnet? A – By reversing polarity of the battery!

DC Motor Operation Principles In a motor, the permanent magnetic field of the Stator surrounds the Armature field like shown here:

Brushed DC Motor components

How the Commutator Works As the rotor turns, the commutator terminals also turn and continuously reverse polarity of the current it gets from the stationary brushes attached to the battery.

Toy DC Motor, cont.

A View of the Brushes

Inside the Motor, cont.

Motors Everywhere! The fan in the microwave ovenmicrowave oven The dispose-all under the sink The washerwasher The electric screwdriverelectric screwdriver The vacuum cleaner and thevacuum cleaner The electric toothbrush The hair dryerhair dryer

Optical Encoders Relative position - direction - resolution grating light emitter light sensor decode circuitry

Ideal Optical Encoders mask/diffuser grating light emitter light sensor decode circuitry Real A diffuser tends to smooth these signals

Optical Encoders Relative position - direction - resolution grating light emitter light sensor decode circuitry

Optical Encoders Relative position - direction - resolution grating light emitter light sensor decode circuitry A B A B A lags B

Optical Encoders Relative position - direction - resolution grating light emitter light sensor decode circuitry A B A leads B Phase lag between A and B is 90 degree

DC Motor Speed Modeling The motor torque, T, is related to the armature current, i, by a constant factor Kt. The back emf, e, is related to the rotational velocity by the following equations:

DC Motor Speed Modeling From the figure above we can write the following equations based on Newton's law combined with Kirchhoff's law: moment of inertia of the rotor (J). damping ratio of the mechanical system (b). * electromotive force constant (K=Ke=Kt) * electric resistance (R). * electric inductance (L) * input (V): Source Voltage * output (theta): position of shaft

Transfer Function By eliminating I(s) we can get the following open-loop transfer function, where the rotational speed is the output and the voltage is the input

Modeling DC Motor Position

PWM A pulse-width modulated signal is a rectangular waveform with a varying duty cycle. A longer duty cycle means the voltage is on for longer and the average voltage applied to the motor is higher and vice versa. Will be implemented using the PWM generator on our microcontroller.

H-Bridge DC motors only have two leads. The direction it spins is determined by which terminal has power applied and which is connected to ground. An H-bridge consists of four switches (in our case BJTs) and depending on which two are closed, allow the motor to operate in either direction We chose to use an L298 chip from STMicroelectronics because it has two H-bridges in one package.

PWM

Open-loop vs. Close-loop Control Open-loop Control: actual speed desired  d V Motor aa actual speed  a - compute V from the current error  d  a Closed-loop Control: using feedback desired speed  Controller solving for V(t) V(t) Motor If desired speed  d  actual speed  a, So what?

Open loop dc response motor

First, our uncompensated motor can only rotate at 0.1 rad/sec with an input voltage of 1 Volt. Since the most basic requirement of a motor is that it should rotate at the desired speed, the steady-state error of the motor speed should be less than 1%. The other performance requirement is that the motor must accelerate to its steady-state speed as soon as it turns on. In this case, we want it to have a settling time of 2 seconds. Since a speed faster than the reference may damage the equipment, we want to have an overshoot of less than 5%. If we simulate the reference input (r) by an unit step input, then the motor speed output should have: Settling time less than 2 seconds Overshoot less than 5% Steady-state error less than 1%

Simulation using Matlab

The step function is one of most useful functions in Matlab for control design. Given a system that can be described by either a transfer function or a set of state-space equations, the response to a step input can immediately be plotted. A step input can be described as a change in the input from zero to a finite value at time t = 0. By default, the step command performs a unit step (i.e. the input goes from zero to one at time t = 0). The basic command to use the step function is one of the following (depending if you have a set of state-space equations or a transfer function form): step(A,B,C,D) step(num,den)

J=0.01; b=0.1; K=0.01; R=1; L=0.5; num=K; den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]; step (num,den,0:0.1:3) title(‘ Step Response for the Open Loop System') step

From the plot we see that when 1 volt is applied to the system, the motor can only achieve a maximum speed of 0.1 rad/sec, ten times smaller than our desired speed. Also, it takes the motor 3 seconds to reach its steady-state speed; this does not satisfy our 2 seconds settling time criterion.

Evaluating the response steady-state error overshoot -- % of final value exceeded at first oscillation rise time -- time to span from 10% to 90% of the final value settling time -- time to reach within 2% of the final value ss error -- difference from the system’s desired value

Close loop DC Motor Speed Control (analog)

P Design Method for DC Motor Speed Control (analog)

PD Design Method for DC Motor Speed Control (analog)

PID Design Method for DC Motor Speed Control (analog)

Proportional control Let's first try using a proportional controller with a gain of 100. Kp=100; numa=Kp*num; dena=den; To determine the closed-loop transfer function, we use the cloop command. [numac,denac]=cloop(numa,dena); Note that numac and denac are the numerator and the denominator of the overall closed-loop transfer function. t=0:0.01:5; step(numac,denac,t) title('Step response with Proportion Control')step

From the plot above we see that both the steady-state error and the overshoot are too large. adding an integral term will eliminate the steady-state error and a derivative term will reduce the overshoot. Let's try a PID controller with small Ki and Kd.

J=0.01; b=0.1; K=0.01; R=1; L=0.5; num=K; den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)]; Kp=100; Ki=1; Kd=1; numc=[Kd, Kp, Ki]; denc=[1 0]; numa=conv(num,numc); dena=conv(den,denc); [numac,denac]=cloop(numa,dena); step(numac,denac) title('PID Control with small Ki and Kd')

Tuning the gains Now the settling time is too long. Let's increase Kd to reduce the settling time.

Let's increase Kd to reduce the overshoot.

So now we know that if we use a PID controller with Kp=100, Ki=200, Kd=10, all of our design requirements will be satisfied.

PID Tuning How to get the PID parameter values ? (1) If the system has a known mathematical model (i.e., the transfer function), analytical methods can be used (e.g., root- locus method) to meet the transient and steady-state specs. (2) When the system dynamics are not precisely known, we must resort to experimental approaches. Using only Proportional control, turn up the gain until the system oscillates w/o dying down, i.e., is marginally stable. Assume that K and P are the resulting gain and oscillation period, respectively. Then, use Ziegler-Nichols Tuning for second or higher order systems for P controlfor PI controlfor PID control K p = 0.6 K K i = 2.0 / P K d = P / 8.0 K p = 0.45 K K i = 1.2 / P K p = 0.5 K Ziegler-Nichols Rules for Tuning PID Controller:

Download ppt "Digital Control Lab Islamic University of Gaza Eng: Moayed Mobaied DC MOTOR."

Similar presentations