Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

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

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

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

4 Brushed DC Motor components

5 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.

6 Toy DC Motor, cont.

7 A View of the Brushes

8 Inside the Motor, cont.

9

10 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

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

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

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

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

15 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

16 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:

17 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

18 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

19 Modeling DC Motor Position

20 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.

21 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.

22 PWM

23 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?

24 Open loop dc response motor

25 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%

26 Simulation using Matlab

27 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)

28 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

29 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.

30 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

31

32

33

34 Close loop DC Motor Speed Control (analog)

35 P Design Method for DC Motor Speed Control (analog)

36 PD Design Method for DC Motor Speed Control (analog)

37 PID Design Method for DC Motor Speed Control (analog)

38 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

39 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.

40 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')

41

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

43 Let's increase Kd to reduce the overshoot.

44 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.

45 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


Ads by Google