Lab2: A self balancing platform v.9b1 Laboratory 2 A self balancing platform.

Slides:



Advertisements
Similar presentations
PID Control for Embedded Systems
Advertisements

ERT 210 Process Control & dynamics
Experiment 17 A Differentiator Circuit
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Objectives Control Terminology Types of controllers –Differences Controls in the real world –Problems –Response time vs. stability.
Outline quad-copter Abstract Quad-Copter Movement Hand movement
3442 Industrial Instruments 2 Chapter 9 Controller Principles
Gesture Controlled Car (GCC) By: Ashwaq Alkailany Reema Abubaker Supervised by: Dr. Luia Malhis.
Lecture 9: D/A and A/D Converters
The Proportional-Integral-Derivative Controller
CHE 185 – PROCESS CONTROL AND DYNAMICS
L.
Roberto - Balancing Robot RIT Computer Engineering Senior Design Project.
Design of a Control Workstation for Controller Algorithm Testing Aaron Mahaffey Dave Tastsides Dr. Dempsey.
COMP3221: Microprocessors and Embedded Systems Lecture 20: Analog Output Lecturer: Hui Wu Session 2, 2004.
Solar Tracking Project Team Members: –Cristian Ruvalcaba –Ken Seal –David Clark –Mark McKinley –Richard DeJarnatt.
DC Motor Control  mouse EE 496 Advisor: Dr. Tep Dobry.
“AX Control Objects” November 2006
Pulse Width Modulation (PWM) LED Dimmer Circuit
ME 270 Final Project Presentation Operational Amplifiers.
Sound Targeting Platform Andrew Lenharth Michael Schaffer Quang Luu CSE 477 May 22, 2001.
Proportional/Integral/Derivative Control
11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou.
Experiment 17 A Differentiator Circuit
Slide # 1 Velocity sensor Specifications for electromagnetic velocity sensor Velocity sensors can utilize the same principles of displacement sensor, and.
Ryan Courtney Senior Design II Advisor: Junkun Ma.
Regal Beloit Proprietary & Confidential What do I get? The X13 motor is a permanent magnet, three phase,brushless DC motor. A single phase drive is attached.
Intro to Arduino Programming. Draw your circuits before you build them From Arduino 330 Ohm From Arduino 330 Ohm From Arduino 330 Ohm.
Professor : Chi-Jo Wang Student’s name : Nguyen Van Binh Student ID: MA02B203 Two Wheels Self Balancing Robot 1 Southern Taiwan University Department of.
1 Lab 5: Controls and feedback. 2 Lab 5: Control and Feedback This embedded system uses the Photo sensor to detect the light intensity of the environment.
VAV Box Control Loop The purpose of the VAV Box control loop is to adjust airflow through the box to maintain a space temperature. The difference between.
A New Cost Effective Sensorless Commutation Method for Brushless DC Motors Without Phase Shift Circuit and Neutral Voltage 南台科大電機系 Adviser : Ying-Shieh.
By Tony Hoff ECE 4220 – Real Time Embedded Computing University of Missouri - Columbia Course Instructor: Dr. Guiherme DeSouza.
Objectives Discuss final project deliverables Control Terminology
Lecture 5: Stopping with a Sentinel. Using a Sentinel Problem Develop a class-averaging program that will process an arbitrary number of grades each time.
Study of Broadband Postbeamformer Interference Canceler Antenna Array Processor using Orthogonal Interference Beamformer Lal C. Godara and Presila Israt.
Control Theory Control System Objectives  Establish a final condition  Provide safe operation  Eliminate the human element  Assure economical operation.
Design Realization lecture 22
PID. The proportional term produces an output value that is proportional to the current error value. Kp, called the proportional gain constant.
Final Exam M.Eng. Amjad Elshenawy RTECS Gc(s)Gc(s) Gc(s)Gc(s) Controller   n sensor noise  w load disturbance  Gp(s)Gp(s) Gp(s)Gp(s) Plant.
PID CONTROLLERS By Harshal Inamdar.
Experiment 17 Two Differentiators Circuit. Analog Computing Analog computers – First were mechanical systems. Electrical analog computers were developed.
Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015.
Lecture 25: Implementation Complicating factors Control design without a model Implementation of control algorithms ME 431, Lecture 25.
Chapter - Continuous Control
UCLA IEEE NATCAR 2004 SUMMER CLASS Magnetic Sensors & Power Regulation.
Embedded Control Systems Dr. Bonnie Heck School of ECE Georgia Tech.
Think First, Code Second Understand the problem Work out step by step procedure for solving the problem (algorithm) top down design and stepwise refinement.
ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.
Flow of signal So you have a sensor, now to process data taken from a sensor you will need a processing unit and that is your controller. sensorcontroller.
Lecture 9: PID Controller.
Tiltmeter, Compass,Temperature modules for the PPM.
HOT CAR BABY DETECTOR Group #20 Luis Pabon, Jian Gao ECE 445 Dec. 8, 2014.
Electronic instrumentation Digitization of Analog Signal in TD
1 PID Feedback Controllers PID 反馈控制器 Dai Lian-kui Shen Guo-jiang Institute of Industrial Control, Zhejiang University.
Electromechanical Motor Control 석 사 2기 최 우 영 Systems & control Lab.
Lab descriptions Lab: Pitch tuner Lab: Self balancing platform Labs: pitch tuner and self balancing platform (v.5b) 1.
Introduction to Motors, servos and steppers
PID Control for Embedded Systems
Quiz: Calculating the total noise for ADC systems TIPL 4204 TI Precision Labs – ADCs Created by Art Kay.
Optical PLL for homodyne detection
Presentation at NI Day April 2010 Lillestrøm, Norway
Feedback Control System
DC MOTOR SPEED CONTROL 1. Introduction
Control Loops Nick Schatz FRC 3184.
Balanduino Supervisor: Dr. Raed Al-Qadi Prepared by: Nadeen Kalboneh Nardeen Mabrouk.
Digital Acquisition of Analog Signals – A Practical Guide
Two Differentiators Circuit
Quanser Rotary Family Experiments
Digital Control Systems (DCS)
Presentation transcript:

Lab2: A self balancing platform v.9b1 Laboratory 2 A self balancing platform

Lab2: A self balancing platform v.9b2 Objectives 1. Objectives  To lean how to interface a direct current (DC) output sensor to an microcontroller  To learn how to implement a Proportional–Integral– Derivative PID feed back control system.Proportional–Integral– Derivative PID 2. Aim  To develop a self-balancing platform using an embedded system. Reference:

Lab2: A self balancing platform v.9b3 PWM generator control method: PID (proportional-integral-derivative) control Required position=0 Left_pwm + - tmpl Integral control I* (deltal) dt Proportional control =P*(deltal) Derivative control D*d(deltal)/dt ; sum error term e=0-tmpl =deltal Position Sensor (tmpl) 0

Lab2: A self balancing platform v.9b4 The experimental setup video

Lab2: A self balancing platform v.9b5 Fig. 1b.Block Diagram of the Self- balancing platform

Lab2: A self balancing platform v.9b6 Fig. 2 Two channels DC amplifier circuit

Lab2: A self balancing platform v.9b7 Fig. 3 (a) Top View of the Accelerometer, (b) the sensor attached to the bottom of the platform x-axis y-axis In the arm mcu we set = read_sensor(1.5V);

Lab2: A self balancing platform v.9b8 Special techniques MIDL is the mid set point value for X-axis Use integer “int” to simulate floating point  Multiply the value by x and divide it by x afterwards, (e.g. x=200 in our example)  tmpl is the tilt position measurement e=deltal = (tmpl - (MIDL+200)) / 200; Derivative is d[e(t)] / dt = e (current ) – e (previous)  diffl = deltal – lastl; Integration is e dt = e (current) + e (previous) accul += deltal/200; //arbitrary set to divide by 200, Dead-band (see next page)

Lab2: A self balancing platform v.9b9 Dead band Dead-band : A Dead-band (sometimes called a neutral zone) is an area of a signal range or band where no action occurs : only enable motor when tile angle outside +/-  degrees (  =0.1 degrees). Dead-band

Lab2: A self balancing platform v.9b10 Algorithm of left motor (core loop in timer IRQ_exception) 500Hz void __irq IRQ_Exception() {  tmpl = read_sensor(0);// read X-axis value //putint(tmpl);// display on terminal //print("; "); if (tmpl>=(MIDL+200)) {// if X-axis value >= setpoint plus 200 deltal = (tmpl - (MIDL+200))/200;// calculate the error and normalize it diffl = deltal-lastl;// caculate the different between current and last error if(diffl max. difference // this prevent the noise due to undesired movement of accelerometer lastl = deltal;// save error as the last error leftPWM = leftPWM - (P*deltal - I*accul + D*diffl);// update the left PWM value by PID if (leftPWM<MINOUTPUT) leftPWM = MINOUTPUT;// limit the PWM value to its minimum if(accul<maxaccu) accul += deltal/200;// ensure the integral not exceed the maximum PWMMR2=leftPWM;// set the left PWM output PWMLER = 0x24;//enable match 2,5 latch to effective } else if (tmpl<=(MIDL-200)) {// if X-axis value <= setpoint plus 200 deltal = ((MIDL-200) - tmpl)/200;// calculate the error and normalize it diffl = deltal- lastl; // caculate the different between current and last error if(diffl max. difference // this prevent the noise due to undesired movement of accelerometer lastl = deltal; // save error to the last error leftPWM = leftPWM + P*deltal + I*accul + D*diffl; // update the left PWM value by PID if (leftPWM>MAXOUTPUT) leftPWM = MAXOUTPUT;// limit the PWM value to its maximum if(accul>0)accul -= deltal/100; // ensure the integral not less than zero PWMMR2=leftPWM; // set the left PWM output PWMLER = 0x24;//enable match 2,5 latch to effective } ////////////////////////////////////////////////////

Lab2: A self balancing platform v.9b11 if (tmpl>=(MIDL+200)) Tile position >  degrees (outside dead band) void __irq IRQ_Exception() //running at 500Hz, set by timer { tmpl = read_sensor(0); // read X-axis value //putint(tmpl); if (tmpl>=(MIDL+200)) {// if X-axis value >= setpoint plus 200 deltal = (tmpl - (MIDL+200))/200; // cal.error and normalize it diffl = deltal-lastl;// cal. different between current and last error if(diffl max. difference {//prevents noise from undesired accelerometer movement lastl = deltal;// save error as the last error leftPWM = leftPWM - (P*deltal - I*accul +D*diffl);//updatePWM if (leftPWM<MINOUTPUT) leftPWM = MINOUTPUT;// limit PWM to its min. if(accul<maxaccu) //make sure accul cannot grow too big accul += deltal/200; // ensure integral< maximum PWMMR2=leftPWM;// set the left PWM output PWMLER = 0x24;//enable match 2,5 latch to effective }

Lab2: A self balancing platform v.9b12 Else of if (tmpl>=(MIDL+200)) Tile position <=  degrees (outside dead band) else if (tmpl<=(MIDL-200)) { Similar but the rotation is reversed }////////////////////////////////////////////////////

Lab2: A self balancing platform v.9b13 Question 1) Is the output voltage changes linearly with the tilt angle? 2)What is the effect on the performance of the system when the sampling frequency is 100Hz? 3)The deadband in sensor reading is +/-200. Estimate the deadband in degrees of our system. 4)What is the effect on the performance of the system when the sampling frequency is 1000Hz? Explain your observation.

Lab2: A self balancing platform v.9b14 Conclusion Studied how to interface direct currents sensor to a embedded system Studied how to build and tune a PID control system