UNIT 2: DC MOTOR POSITION CONTROL

Similar documents
MEM01: DC-Motor Servomechanism

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

Brushed DC Motor Microcontroller PWM Speed Control with Optical Encoder and H-Bridge

Rotary Motion Servo Plant: SRV02. Rotary Experiment #02: Position Control. SRV02 Position Control using QuaRC. Student Manual

7 Lab: Motor control for orientation and angular speed

EE 4314 Lab 3 Handout Speed Control of the DC Motor System Using a PID Controller Fall Lab Information

Root Locus Design. by Martin Hagan revised by Trevor Eckert 1 OBJECTIVE

Design of stepper motor position control system based on DSP. Guan Fang Liu a, Hua Wei Li b

Position Control of DC Motor by Compensating Strategies

Ball and Beam. Workbook BB01. Student Version

Penn State Erie, The Behrend College School of Engineering

Brushed DC Motor PWM Speed Control with the NI myrio, Optical Encoder, and H-Bridge

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

UNIVERSITY OF JORDAN Mechatronics Engineering Department Measurements & Control Lab Experiment no.1 DC Servo Motor

DC SERVO MOTOR CONTROL SYSTEM

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

Lab 2: Quanser Hardware and Proportional Control

Sensors and Sensing Motors, Encoders and Motor Control

Rotary Motion Servo Plant: SRV02. Rotary Experiment #03: Speed Control. SRV02 Speed Control using QuaRC. Student Manual

Brushed DC Motor System

Automatic Control Systems 2017 Spring Semester

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

Open Loop Frequency Response

CHAPTER-III MODELING AND IMPLEMENTATION OF PMBLDC MOTOR DRIVE

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

The Discussion of this exercise covers the following points: Angular position control block diagram and fundamentals. Power amplifier 0.

Motor Modeling and Position Control Lab 3 MAE 334

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

Control Design for Servomechanisms July 2005, Glasgow Detailed Training Course Agenda

GE 320: Introduction to Control Systems

Sensors and Sensing Motors, Encoders and Motor Control

ECE 5670/6670 Project. Brushless DC Motor Control with 6-Step Commutation. Objectives

Mechatronics Laboratory Assignment 3 Introduction to I/O with the F28335 Motor Control Processor

Lab 1: Steady State Error and Step Response MAE 433, Spring 2012

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

5 Lab 5: Position Control Systems - Week 2

CHAPTER 2 PID CONTROLLER BASED CLOSED LOOP CONTROL OF DC DRIVE

MCE441/541 Midterm Project Position Control of Rotary Servomechanism

Course Outline. Time vs. Freq. Domain Analysis. Frequency Response. Amme 3500 : System Dynamics & Control. Design via Frequency Response

EE 560 Electric Machines and Drives. Autumn 2014 Final Project. Contents

Sfwr Eng/TRON 3DX4, Lab 4 Introduction to Computer Based Control

Ver. 4/5/2002, 1:11 PM 1

Rotary Motion Servo Plant: SRV02. Rotary Experiment #17: 2D Ball Balancer. 2D Ball Balancer Control using QUARC. Instructor Manual

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

EE 461 Experiment #1 Digital Control of DC Servomotor

EE 3TP4: Signals and Systems Lab 5: Control of a Servomechanism

Mechatronics. Analog and Digital Electronics: Studio Exercises 1 & 2

dspace DS1103 Control Workstation Tutorial and DC Motor Speed Control Project Report

DC MOTOR SPEED CONTROL USING PID CONTROLLER. Fatiha Loucif

Lab 2: Introduction to Real Time Workshop

Lab 23 Microcomputer-Based Motor Controller

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

Motomatic Servo Control

Ball Balancing on a Beam

Using Magnetic Sensors for Absolute Position Detection and Feedback. Kevin Claycomb University of Evansville

Integrated Easy Servo

ies-2309 Integrated Easy Servo

ECE 5671/6671 Lab 3. Impedance Measurement and Parameter Estimation of a DC Motor

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

MTY (81)

Where: (J LM ) is the load inertia referred to the motor shaft. 8.0 CONSIDERATIONS FOR THE CONTROL OF DC MICROMOTORS. 8.

Industrial Control Equipment. ACS-1000 Analog Control System

University of California, Berkeley EE128, Fall Lab 7 A Microcontroller Based Position/Speed Controller

Hydraulic Actuator Control Using an Multi-Purpose Electronic Interface Card

Comparative Study of PID and Fuzzy Controllers for Speed Control of DC Motor

Teaching Mechanical Students to Build and Analyze Motor Controllers

V&T Technologies Co., Ltd. Vectorque TM V6-H-M1 SERIES INVERTER ADDITIVE MANUAL (M1) V6-H Series ADDITIVE MANUAL V& T

Time Response Analysis of a DC Motor Speed Control with PI and Fuzzy Logic Using LAB View Compact RIO

No Gain Tuning. Hunting. Closed Loop System

Optimal Control System Design

BLuAC5 Brushless Universal Servo Amplifier

Feedback Systems. Many embedded system applications involve the concept of feedback. Sometimes feedback is designed into systems: Actuator

Phys Lecture 5. Motors

CHAPTER-5 DESIGN OF DIRECT TORQUE CONTROLLED INDUCTION MOTOR DRIVE

Synchronized Injection Molding Machine with Servomotors

EE 370/L Feedback and Control Systems Lab Section Post-Lab Report. EE 370L Feedback and Control Systems Lab

Motor Control. Suppose we wish to use a microprocessor to control a motor - (or to control the load attached to the motor!) Power supply.

Electrical Drives I. Week 4-5-6: Solid state dc drives- closed loop control of phase controlled DC drives

INTEGRATED CIRCUITS. AN1221 Switched-mode drives for DC motors. Author: Lester J. Hadley, Jr.

BLuAC5 Brushless Universal Servo Amplifier

A PID Controller for Real-Time DC Motor Speed Control using the C505C Microcontroller

CHAPTER 4 FUZZY BASED DYNAMIC PWM CONTROL

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

Design Applications of Synchronized Controller for Micro Precision Servo Press Machine

Implementation of Proportional and Derivative Controller in a Ball and Beam System

dspace DS1103 Control Workstation Tutorial and DC Motor Speed Control Project Proposal

Modelling and Control of Hybrid Stepper Motor

SIMULATION AND IMPLEMENTATION OF PID-ANN CONTROLLER FOR CHOPPER FED EMBEDDED PMDC MOTOR

Actuators. EECS461, Lecture 5, updated September 16,

EE 482 : CONTROL SYSTEMS Lab Manual

Tech Note #3: Setting up a Servo Axis For Closed Loop Position Control Application note by Tim McIntosh September 10, 2001

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

Lecture 5 Introduction to control

Modeling, Simulation and Implementation of Speed Control of DC Motor Using PIC 16F877A

DESIGN OF A TWO DIMENSIONAL MICROPROCESSOR BASED PARABOLIC ANTENNA CONTROLLER

Feed-back loop. open-loop. closed-loop

Magnetic Levitation System

Lab Exercise 9: Stepper and Servo Motors

Effective Teaching Learning Process for PID Controller Based on Experimental Setup with LabVIEW

Embedded Control Project -Iterative learning control for

Transcription:

UNIT 2: DC MOTOR POSITION CONTROL 2.1 INTRODUCTION This experiment aims to show the mathematical model of a DC motor and how to determine the physical parameters of a DC motor model. Once the model is verified, it is used to design a closed-loop control system that regulates the position of the DC motor. 2.2 EXPERIMENTAL SETUP The block diagram ofthe setupis as shown in Fig. 2.1 (a). OneFiOLite board from Aimagin (www.aimagin.com), one dc motor driver and interface board, onelego DC motor with built-in encoder, one external power supply, and one USB isolator will be given to each group. Connect up these components to the FiOLite Board and PC according to the setup shown in Figure 2.2 (b). The given NXT parts are connected with the motor as shown in Fig. 2.2. FiO Lite Board (a) DC Adapter FiOLite Board USB Isolator Lego Motor Port B Motor Driver Board (b) Fig. 2.1 Block diagram (a) and motor control lab setup (b) S WONGSA INC451: 2-1

Fig. 2.2 How to build the Lego Motor in this experiment 2.2.1 LEGO MINDSTORMS NXT MOTOR The motor has a built-in gear reduction and an optical encoder with 180 pulsesper rotation. The encoder generates two shifted rectangular pulses from ports TACH00 and TACH01, and the shift represents one quarter of a cycle. These signals allow us to determine the direction and speed of the motor. Fig. 2.4 (a) illustrates the signals for a motor turning forward, and Fig. 2.4 (b) is for reverse. Fig. 2.3 Lego Mindstorms NXT motor (a) (b) Fig. 2.4 Quadrature signals for motor running forward (a) and reverse (b) (Gasperi and Hurbain 2009) S WONGSA INC451: 2-2

2.2.2 DC MOTOR DRIVER BOARD The motor driver board is based on H-bridge IC drivers LB1836M which can drive up to 2 DC motors, connected through Ports A and B, at 9V-1A per channel. You need three signals to drive each motor. Two digital signals provide appropriate logics to control the motor s directions and one Pulse Width Modulation (PWM) signal for controlling the motor s speed. The speed of a motor depends on the average voltage applied to it, and the PWM method is a way of controlling this average voltage. Pins used for driving motors A and B are summarised in Table 1.1. Fig. 2.5 Motor driver board Table 2.1 Pin connections for driving motors A and B Control signal (direction 1 for motor A) Da1 (direction 2 for motor A) Da2 (PWM for motor A) Pa (direction 1 for motor B) Db1 (direction 2 for motor B) Db2 (PWM for motor B) Pb Motor driver port C1 C2 C6 C3 C4 C7 2.2.3 FIOLITE BOARD FiOLite board is based on ARM 33-bits processor (STM32F103R8), supporting on-chip peripherals, for instance digital IOs, ADC, PWM, USART, and USB. One of the most appealing features of this board is that it supports C code generation of a custom user program for STM32 from a Simulink model. Therefore, it is suitable for those who are familiar with MATLAB programming. The interested reader is referred to www.aimgin.com for required software and tutorials on how to program the board with many example projects. S WONGSA INC451: 2-3

2.3 MOTOR MODELLING 2.3.1 MODEL OF A SIMPLE SERVO SYSTEM Fig. 2.6 Armature-controller DC motor Table 2.2Definitions of parameters of the servo DC motor J Moment of inertia (kg m 2 ) b Viscous friction coefficient of the motor (N m s) K t L R K b Motor torque constant (N m/a) Motor armature inductance (H) Motor armature resistance (Ω) Back emf coefficient V/(rad/s) A servo DC motor system, as shown in Fig. 2.6, in the armature-control mode of operation is composed of the armature circuit and the mechanical parts, leading to the two following dynamic equations(nise 2008): J& θ + b & θ = K ti (2.1) di dθ L + Ri+ K b = v dt dt (2.2) wherev is the input voltage applied to the motor s armature, θ is the angular displacement of the shaft, and the definition of all constant parameters is summarized in Table 2.2. It is usual to assume that the armature inductance, L, is small compared to the armature resistance, R. By applying the Laplace transform to the above differential equations with L being eliminated from (2.2), we can obtain the following transfer function: S WONGSA INC451: 2-4

Θ( s) V ( s) = s s+ K t / RJ 1 K t K b+ J R b (2.3) In this experimental setup, however, instead of controlling the voltage we will control a PWM signal with varying duty cycle with amplitude of 3.3 V. Also, the output shaft position will be considered in degrees.based on this setup, the servo system model can be put in the following transfer function form: Y ( s) G( s) = U ( s) = K s( τs+ 1) (2.4) where U(s) is the input PWM duty cycle and Y(s) is the shaft position in degrees, K is the system gain and τ is the time constant. 2.3.2 MOTOR DEADBAND The linear model described above is the basis of the design of servo controller. However, a real servo has nonlinear components that influence its dynamic behavior. Examples of these nonlinearities are the saturation voltage of the motor drive amplifier, Coulumb friction in the moving parts, and the deadbandor deadzone in the motor amplifier. Deadband is the region where the applied input has no effect, preventing motor from turning when small inputs are applied. ω Fig. 2.7 Motor deadband The deadband can be included to the servo system at the system input for moreaccurate approximation of the system model. The nonsymmetricdeadband nonlinearity shown in Fig. 2.8 is given by + u u, u > u u m = 0, u u u u u, u< u + + (2.5) S WONGSA INC451: 2-5

The parameters {u -,u + } characterise the width of the system deadband. Fig. 2.8 Friction modeling with deadband 2.4 LAB EXPERIMENTS 2.4.1 MOTOR MANUAL CONTROL We will get started by learning how to make your motor rotate. Three topics will be covered in this section: Using the motor driver board to control motor speed and direction Reading the incremental quadrature encoder The nonlinearities Coulomb & viscous friction effects This lab consists of two Simulink models, one for the target and another for the host PC. The target Simulinkmodel is configured such that the FiO board receives3 command signals, including PWM duty cycle (to pin C6) DIR1 (to pin C3) DIR2 (to pin C4), from a Simulink model running on the host PC to control the motor speed anddirection. The target alsoreturns two output signals, rotation direction and encoder counts, to the host PC. On the host PC Simulink model, you can use a slider gain block to vary PWM duty cycle and sign(between -100 and +100) to control the motor speed and direction in real-time. The received encoder countsare converted to positions 0-360 degrees. You should also observe the nonlinear effects due to mechanical frictions. 2.4.1.1 EXPERIMENTAL SETUP To drive the motor and to read the encoder signals, connect the driver motor board with the FiO board as shown in Fig. 2.9. Pins C3 and C4 are for controlling the motor s direction. PWM signals generated from pin A3 of FiO board is connected to the PWM pin (C7) of the motor driver board to control the motor s speed. The two encoder signals, A8 and A9, from the motor driver board are read by the target Simulink model to calculate the corresponding angular displacement of the motor. S WONGSA INC451: 2-6

Fig. 2.9 Pin connections between the motor driver board and the FiOLite board 2.4.1.2 TARGET SIMULINK MODEL Fig. 2.10 Target Simulink model Build a Target Simulink as shown in Fig. 2.10. Notice that The sample time is 0.005 sec. S WONGSA INC451: 2-7

PWM frequency is 20 khz PinsC3 and C4of Digital Output Block are configured asopen-drainoutput. Table 2.3summarises required signals to control the motor in different modes.in Break mode, the motor will stop right away. In Standby mode, the motor will slowly come to a stop depending on the inertia of the load. Table 2.3 Truth table for motor control C3 C4 Mode H L Forward L H Reverse H H Brake L L Standby Position (POS) port of Incremental Quadrature Encoder Interface Block is the count of number of edges of the encoder output signals from both channels A and B. The decoder is set to count at every rising and falling edge of both channel A and B to provide maximum resolution. Therefore, for our encoder which has 180 pulses per revolution (PPS), the maximum count is 720 per revolution (4x180 = 720), i.e. from 0 to 719.Given the number of edges of encoder signals, we can calculate the corresponding angular displacement in degrees as (POS+1)/2. The Data Type Conversion Block, connected to the POS port, is used to convert POS (unit16) to the 64-bit double-precision format for floating-point computation. 2.4.1.3 HOST SIMULINK MODEL Fig. 2.11 Host Simulink model S WONGSA INC451: 2-8

function [pwmout, dir1, dir2] = fcn(pwm) if (pwm>0)%forward pwmout = pwm; dir1 = uint8(1); dir2 = uint8(0); elseif (pwm<0)%reverse pwmout = pwm; dir1 = uint8(0); dir2 = uint8(1); else%break pwmout = 0; dir1 = uint8(1); dir2 = uint8(1); end Fig. 2.12 MATLAB function for manual speed control (Speed Control Block of Fig. 2.11) In the Host Simulink model, the angular displacement from Target model is read in the Host model by using the Host HID Receiver Block. In the driver side, we need to send the Target model the PWM percent duty cycle and the right logics to control the motor s direction.given the PWM value, ranging from -100% to 100%, the Speed Control Block, which is created by the MATLAB Function Block Editor, converts the PWM value to the corresponding logics for pins C3 and C4, according to the truth table in Table 2.3. The function script is shown in Fig. 2.12. 2.4.1.4 LET S GET IT RUN i) Set FiO board in USB In Application Programming (IAP) Mode then Build Model. Do not forget to update the diagram until all blocks display correct sample time before building the model. The source code should be automatically generated, compiled, and downloaded to the FiO Lite board ii) Set FiO board in Run Custom User Program Mode and run the Host model by double clicking the HID Force Output Block. iii) Double click the Slider Gain to control PWM duty cycle. Because of the friction effects, a certain minimum percent of duty cycle is required to make the motor start to run from rest. This nonlinear behaviour is known as the deadband. Record the deadbandvalues of your motor in both directions. - Deadband of forward direction: u + = % - Deadband of reverse direction: u - = % 2.4.2 IDENTIFICATION OF MOTOR MODEL 2.4.2.1 CLOSED-LOOP IDENTIFICATION AND DEADBAND COMPENSATION We will identify the motor transfer function G(s) by using the closed-loop identification and a deadband compensation techniques. To compensate for the deadband in closed-loop, we can introduce a deadbandprecompensator as in Fig. 2.13. The rule of deadband compensator depends on the region within which u ~ occurs and can be normally described as follows: S WONGSA INC451: 2-9

+ u~ + u, u~ > 0 u = u ~ u, u~ < 0 (2.6) ~ u, otherwise ~ U ( s ) U (s) Fig. 2.13 Feedback control with deadband compensation If the deadband is well determined and constant, we can use the same value in the deadbandprecompensation as described in (2.5). Unfortunately, the deadband approximation is normally not perfect. If you attempt to cancel the deadband completely, we could therefore end up with overcompensation that causes unwanted jitter and limit cycles. Therefore, to avoid these undesired outcomes, in practice the precompensator magnitude is chosen smaller than the width of the deadzone. After applying the deadbandprecompensation, we can hopefully significant reduce the effects of Coulomb friction. If this is the case, we could consider the closed-loop system as if all components are linear. Consequently, the closed-loop system after the deadband is compensated can be considered as shown in Fig. 2.14. U (s) Fig. 2.14 Closed-loop motor control system If C(s) is a proportional compensator with a constant gain, say C(s) = 1, the closed-loop transfer function of the system in Fig. 2.14 becomes Y ( s) T ( s) = R( s) = s K / τ = s K + + τ τ 2 2 s + 2 ω 2 n ζω s+ ω n 2 n (2.7) S WONGSA INC451: 2-10

Note that the closed-loop transfer function of motor can be written in the standard form of 2 2 2 second order transfer function ω /( s + 2ζω s+ ω ). The parameters K and τ of the open-loop n transfer function G(s) in (2.3) can therefore be identified from T(s). 2.4.2.2 IDENTIFICATION EXPERIMENT n n 1. Modify the Host Simulink model in Fig. 2.11 to perform the closed-loop identification with deadbandprecompensator in Fig. 2.13. Set the controller C(s) = 1 and the desired angle r(t) to be a square wave with amplitudes[170, 190 ] and period 6 sec as shown in Fig. 2.15. 195 190 Angle r(t), deg. 185 180 175 170 165 0 5 10 15 20 Time(sec) Fig. 2.15 Squarewave input r(t) used for closed-loop identification experiment 2. Try to use the deadband constants obtained in Section 2.4.1.4 for your deadband compensator. But if this causes jitter, slightly reduce them until the jitter disappears. Your response should look like asecond-order step response. For example, it may look like Fig. 2.16. 200 190 Angle y(t), deg. 180 170 160 150 0 2 4 6 8 10 12 14 16 18 Time(sec) Fig. 2.16 Second-order step response of the servo motor system Save the desired angle r(t) and the motor angle y(t) as variables r and y, respectively, in Workspace. Approximate the overshoot, the rise time, and the settling time of your second order step response and define the corresponding ωn and ζ. Overshoot =. % S WONGSA INC451: 2-11

Rise time =... sec Settling time = sec ω n =. rad/sec ζ = Given the approximated ωn and ζ, calculate the corresponding K and τ by using (2.6). K = τ = 3. Alternatively, you can use the MATLAB identification Toolbox to identify T(s). % Assuming you already have r(input), y(output), and t(time vector) in Workspace dat=iddata(y,r,0.005); % Create a data object to be used for system identification % Identify a predicted model of the system using the assumed form ofunderdamped system m = pem(dat,'p2u'); % The obtained model m is in the form % Kp % G(s) = ---------------------- % 1+2*Zeta*Tw*s+(Tw*s)^2 % Extract parameters Kp, Tw and Zeta from m Kp = m.kp.value; Zeta = m.zeta.value; Tw = m.tw.value; % Create the corresponding closed-loop transfer function object T T = tf(kp,[tw^2 2*Zeta*Tw 1]); % Simulate response from the model and compare with experiment [ysim,t]=lsim(t,r,t); figure plot(t,ysim,t,y) legend('simulated angle','actual angle') 200 190 Simulated angle Actual angle 180 170 160 150 3 4 5 6 7 8 9 Fig. 2.17Closed-loop identification results S WONGSA INC451: 2-12

Given the approximated T(s), calculate the parameters of G(s) : K = τ = Comment on the identification results, compared with those obtained from your rough approximations in 2. 2.4.3 DESIGN ASSIGNMENT Design a discretee PD compensator which satisfies the following specifications: - Overshoot less than 5% - Settling less than0.5 sec. - Steady state error less than 1 degree. for step inputs. Simulate your design closed-loop systems and compare them with the real experimental results forthe desired angle r(t) to be a square wave with amplitudes[170, 190 ], [135, 225 ], and [90, 270 ]. Your simulated model should include the saturation of controller output (duty cycle [-100 %,100%] ) and the deadband. Also include the deadband compensation as used in the real experiments. The saturation and deadband can be modelled by using the Saturation and Dead Zone Blocks of Simulink. Fig. 2.18 Saturation and Dead Zone Blocks of Simulink S WONGSA INC451: 2-13

REFERENCES Gasperi, Michael, and Phillippe Philo Hurbain. Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level. 2009. Nise, Norman S. Control Systems Engineering. John Wiley & Sons, 2008. S WONGSA INC451: 2-14