EE 308 Spring Preparation for Final Lab Project Simple Motor Control. Motor Control

Similar documents
Motor Control. Consider a motor which has a maximum speed of 5000 RPM. The speed vs. duty cycle may look something like this:

Experiment 9. PID Controller

Different Controller Terms

PYKC 7 March 2019 EA2.3 Electronics 2 Lecture 18-1

Sensors and Sensing Motors, Encoders and Motor Control

Basic Tuning for the SERVOSTAR 400/600

CHAPTER 2 PID CONTROLLER BASED CLOSED LOOP CONTROL OF DC DRIVE

Sensors and Sensing Motors, Encoders and Motor Control

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING BANGLADESH UNIVERSITY OF ENGINEERING & TECHNOLOGY EEE 402 : CONTROL SYSTEMS SESSIONAL

Laboratory Assignment 5 Digital Velocity and Position control of a D.C. motor

International Journal of Research in Advent Technology Available Online at:

Experiment Of Speed Control for an Electric Trishaw Based on PID Control Algorithm

SxWEB PID algorithm experimental tuning

GE420 Laboratory Assignment 8 Positioning Control of a Motor Using PD, PID, and Hybrid Control

CHAPTER 4 PID CONTROLLER BASED SPEED CONTROL OF THREE PHASE INDUCTION MOTOR

Fundamentals of Servo Motion Control

Hands-on Lab. PID Closed-Loop Control

CONTROLLER DESIGN FOR POWER CONVERSION SYSTEMS

Closed-Loop Position Control, Proportional Mode

Position Control of DC Motor by Compensating Strategies

Embedded Control Project -Iterative learning control for

A M E M B E R O F T H E K E N D A L L G R O U P

Lab 23 Microcomputer-Based Motor Controller

PERSONALIZED EXPERIMENTATION IN CLASSICAL CONTROLS WITH MATLAB REAL TIME WINDOWS TARGET AND PORTABLE AEROPENDULUM KIT

A Fast PID Tuning Algorithm for Feed Drive Servo Loop

Mercury technical manual

Lab 11. Speed Control of a D.C. motor. Motor Characterization

Design of Different Controller for Cruise Control System

Application Note #2442

CSE 3215 Embedded Systems Laboratory Lab 5 Digital Control System

The MFT B-Series Flow Controller.

ME 461 Laboratory #5 Characterization and Control of PMDC Motors

Load Observer and Tuning Basics

-binary sensors and actuators (such as an on/off controller) are generally more reliable and less expensive

(1) Identify individual entries in a Control Loop Diagram. (2) Sketch Bode Plots by hand (when we could have used a computer

Servo Tuning. Dr. Rohan Munasinghe Department. of Electronic and Telecommunication Engineering University of Moratuwa. Thanks to Dr.

Cohen-coon PID Tuning Method; A Better Option to Ziegler Nichols-PID Tuning Method

JUNE 2014 Solved Question Paper

Introduction to PID Control

Designing PID for Disturbance Rejection

Chapter 5. Tracking system with MEMS mirror

Procidia Control Solutions Dead Time Compensation

Optimizing Performance Using Slotless Motors. Mark Holcomb, Celera Motion

AVR221: Discrete PID Controller on tinyavr and megaavr devices. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

Performance Optimization Using Slotless Motors and PWM Drives

PID TUNING WITH INPUT CONSTRAINT: APPLICATION ON FOOD PROCESSING

Optimal Control System Design

EVALUATION ALGORITHM- BASED ON PID CONTROLLER DESIGN FOR THE UNSTABLE SYSTEMS

Closed-Loop Speed Control, Proportional-Plus-Integral-Plus-Derivative Mode

[ á{tå TÄàt. Chapter Four. Time Domain Analysis of control system

Elmo HARmonica Hands-on Tuning Guide

Digital Control of MS-150 Modular Position Servo System

TCS3 SERVO SYSTEM: Proposed Design

Advanced Servo Tuning

Experiment 7: PID Motor Speed Control

ME 5281 Fall Homework 8 Due: Wed. Nov. 4th; start of class.

Lecture 7:Examples using compensators

Loop Design. Chapter Introduction

Figure 1: Unity Feedback System. The transfer function of the PID controller looks like the following:

Relay Based Auto Tuner for Calibration of SCR Pump Controller Parameters in Diesel after Treatment Systems

Step vs. Servo Selecting the Best

6.270 Lecture. Control Systems

MEM01: DC-Motor Servomechanism

Laboratory PID Tuning Based On Frequency Response Analysis. 2. be able to evaluate system performance for empirical tuning method;

Design of a Simulink-Based Control Workstation for Mobile Wheeled Vehicles with Variable-Velocity Differential Motor Drives

Frequency Response Analysis and Design Tutorial

Servo Tuning Tutorial

MM7 Practical Issues Using PID Controllers

ABS System Control. Tallinn University of Technology. Pre-bachelor project. Ondrej Ille

PID Control Technical Notes

Choice of Sample Time in Digital PID Controllers CHOICE OF SAMPLE TIME IN DIGITAL PID CONTROLLERS

ME375 Lab Project. Bradley Boane & Jeremy Bourque April 25, 2018

MTE 360 Automatic Control Systems University of Waterloo, Department of Mechanical & Mechatronics Engineering

TF Electronics Throttle Controller

PID-CONTROL FUNCTION AND APPLICATION

Lecture 10. Lab next week: Agenda: Control design fundamentals. Proportional Control Proportional-Integral Control

Linear Control Systems Lectures #5 - PID Controller. Guillaume Drion Academic year

A Searching Analyses for Best PID Tuning Method for CNC Servo Drive

Position Control of AC Servomotor Using Internal Model Control Strategy

QuickBuilder PID Reference

PID Controller tuning and implementation aspects for building thermal control

The PID controller. Summary. Introduction to Control Systems

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

A simple method of tuning PID controller for Integrating First Order Plus time Delay Process

Controller Algorithms and Tuning

One-degree-of-freedom PID controlled Helicopter. PDE 2420 Control Systems

Robust Control Design for Rotary Inverted Pendulum Balance

Lab-Report Control Engineering. Real Water tank

Magnetic Levitation System

COMPARISON OF TUNING METHODS OF PID CONTROLLER USING VARIOUS TUNING TECHNIQUES WITH GENETIC ALGORITHM

A Case Study of Rotating Sonar Sensor Application in Unmanned Automated Guided Vehicle

SRV02-Series Rotary Experiment # 3. Ball & Beam. Student Handout

Phys Lecture 5. Motors

EE 482 : CONTROL SYSTEMS Lab Manual

Application Research on BP Neural Network PID Control of the Belt Conveyor

Advanced Motion Control Optimizes Laser Micro-Drilling

Motomatic Servo Control

6545(Print), ISSN (Online) Volume 4, Issue 1, January- February (2013), IAEME & TECHNOLOGY (IJEET)

Readings: FC: p : lead compensation. 9/9/2011 Classical Control 1

Application of SDGM to Digital PID and Performance Comparison with Analog PID Controller

Transcription:

Preparation for Final Lab Project Simple Motor Control Motor Control A proportional integral derivative controller (PID controller) is a generic control loop feedback mechanism (controller) widely used in industrial control systems - A PID is the most commonly used feedback controller. - A PID controller calculates an "error" value as the difference between a measured process variable and a desired set point. The controller attempts to minimize the error by adjusting the process control inputs. The PID controller calculation involves three separate constant parameters, and is accordingly sometimes called three-term control: 1) The proportional (P) 2) The integral (I) 3) The derivative values (D) These values can be interpreted in terms of time: P depends on the present error, I on the accumulation of past errors, and D is a prediction of future errors, based on current rate of change. The weighted sum of these three actions is used to adjust the process via a control element such as the position of a control valve, the power supply of a heating element, or the supply voltage to a motor (to control acceleration, velocity, or position).

Control Signal u(t) Kd and Ki constant

Kp and Kd constant Kp and Ki constant Stability If the PID controller parameters (the gains of the proportional, integral and derivative terms) are chosen incorrectly, the controlled process input can be unstable, i.e. its output diverges, with or without oscillation, and is limited only by saturation or mechanical breakage. Instability is caused by excess gain, particularly in the presence of significant lag.

Generally, stability of response is required and the process must not oscillate for any combination of process conditions and setpoints, though sometimes marginal stability (bounded oscillation) is acceptable or desired. Optimum behavior The optimum behavior on a process change or setpoint change varies depending on the application. Two basic requirements are regulation (disturbance rejection staying at a given setpoint) and command tracking (implementing setpoint changes) these refer to how well the controlled variable tracks the desired value. Specific criteria for command tracking include rise time and settling time. Some processes must not allow an overshoot of the process variable beyond the setpoint if, for example, this would be unsafe. Other processes must minimize the energy expended in reaching a new setpoint. - Rise time (tr): time for the output signal to go from 10% - 90 % of the step height (or any input signal). - Settling time (ts): time it takes for the signal to stabilize (be within 5%, 1%, or other). - Percent overshoot (PO): is the maximum value minus the step value divided by the step value. In the case of the unit step, the overshoot is just the maximum value of the step response minus one.

Consider a motor which has a maximum speed of 5000 RPM. The speed vs. duty cycle may look something like this: Negative and Positive Deadzones

The motor doesn t start rotating until it is driven with a 10% duty cycle (??), after which it will increase speed linearly with the increase in duty cycle. If the motor is initially stopped, and is then turned on (with 100% duty cycle), the speed vs. time might look something like this (the step response of the motor): We will control the motor by adjusting the duty cycle with the MC9S12. We will do this by measuring the speed and updating the duty cycle on a regular basis. Let s do the adjustments once every 8 ms. This means that we will adjust the duty cycle, wait for 8 ms to find the new speed, then adjust the duty cycle again. How much change in speed will there be in 8 ms? The motor behaves like a single time constant system, so the equation for the speed as a function of time is:

S(t) = Sf + e t/τ (Si Sf ) where Si is the speed at time 0, Sf is the speed at time 1, and τ is the time constant of the system. With a duty cycle of D, the final speed will be: Sf = αdc + S0 where S0 is the speed the motor would turn with a 0% duty cycle if the speed continued linearly for duty cycles less than 10%, and α is the slope of the speed vs. duty cycle line (5000/0.9 in this example). Here we assume that the time constant of the small motors we are using is about 1 second i.e., it takes about 5 seconds (5 time constants) for the motor to go from a dead stop to full speed. If T = 8 ms, the motor will have changed its speed from Si to S(T) = Sf + e T/τ (Si Sf ) S(T) = (αdc + S0) + e T/τ (Si (αdc + S0) ) S(T) = (αdc + S0)(1 e T/τ )+ e T/τ Si The speed at the nth cycle, S[n], will be S[n] = (αdc + S0)(1 e T/τ ) + e T/τ S[n 1] Consider an integral controller where the duty cycle is adjusted according to: DC[n] = DC[n 1] + k(sd Sm[n])

We can simulate the motor response by iterating through these equations. Start with Sm[1] = 0, D[1] = 0 (Duty Cycle), and Sd = 1500. Then we calculate: Sm[n] = (αdc[n 1] + S0)(1 e T/τ ) + e T/τ Sm[n 1] DC[n] = DC[n 1] + k(sd Sm[n]) In MATLAB we can simulate this as: alpha = 5000/0.9; % Max speed 5,000 RPM; turns on at 10% duty cycle Sd = 1500; % Desired Speed S0 = -alpha*0.1; % Speed motor would turn at 0% duty cycle if linear tau = 1; % One second time constant T = 8e-3; % Update rate is 8 ms k = 1e-7; % Constant for integral control Sm = 0; % Measured speed starts at 0 D = 0.1; % Duty cycle starts at 10% t = 0; ee = exp(-t/tau); % Precalculate this commonly used value for n=2:10000 % Make end value bigger if needed Sm(n)=(alpha*D(n-1) + S0)*(1-ee) + ee*sm(n-1); D(n) = k*(sd - Sm(n)) + D(n-1); t(n) = t(n-1)+t; end plot(t,sm);

By changing the value of k we can see how this parameter affects the response. Here is the curve for k = 1.0 10 7 : With this value of k, it will take about 1 minute for the motor to get to the desired speed. Here is the curve for k = 1.0 10-6 :

Now it takes about 10 seconds to get to the desired speed, with a little bit of overshoot. Let s try k = 1.0 10 5 : This gets to the desired value more quickly, but with a lot of oscillation. Let s increase k to 10 4.

For this value of k there is a significant oscillation. However, a real motor will not act like this. If we look at the duty cycle vs time, we see: To get this oscillating response, the duty cycle must go over 100%, and below 0%, which is clearly impossible. To get the response we expect in the lab, we need to limit the duty cycle to remain between 20% and 100%. Thus, we change our simulation to be: alpha = 5000/0.9; % Max speed 5,000 RPM; turns on at 10% duty cycle Sd = 1500; % Desired Speed S0 = -alpha*0.1; % Speed motor would turn at 0% duty cycle if linear tau = 1; % One second time constant T = 8e-3; % Update rate is 8 ms k = 1e-7; % Constant for integral control Sm = 0; % Measured speed starts at 0 D = 0.1; % Duty cycle starts at 10%

t = 0; ee = exp(-t/tau); % Precalculate this commonly used value for n=2:1000 % Make end value bigger if needed Sm(n)=(alpha*D(n-1) + S0)*(1-ee) + ee*sm(n-1); if (Sm(n) < 0) Sm(n) = 0; end; % Motor speed cannot be less than 0 D(n) = k*(sd - Sm(n)) + D(n-1); if (D(n) > 1.0) D(n) = 1.0; end; % Keep DC between 20% and 100% if (D(n) < 0.2) D(n) = 0.2; end; t(n) = t(n-1)+t; end plot(t,sm); When we use this to simulate the motor response, we get:

In your program for next Lab, you will use a Real Time Interrupt with an 8 ms period. In the RTI interrupt service routine, you will measure the speed, and set the duty cycle based on the measured speed. Your ISR will look something like this: void INTERRUPT rti_isr(void) { Code to read potentiometer voltage and convert into RPM Code to measure speed Sm in RPM Code which sets duty cycle to: DC = DC + k*(sd-sm) if (DC > 1.0) DC = 1.0; if (DC < 0.2) DC = 0.2; Code which writes the PWM Duty Cycle Register to generate duty cycle DC. } Code which clears RTI flag In the main program, you will display the measured speed, desired speed, and duty cycle on the LCD display. Your values of k will probably be different than the values in these notes because speed vs. duty cycle, time constant, and maximum speed will most likely be different than the values I used.