Your SlideShare is downloading. ×
Assignment 5
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Assignment 5

97
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
97
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ASSIGNMENT Module Code Module Name Course Department ESD 527 Embedded Control System M.Sc in Real Time Embedded Systems Computer Engineering Name of the Student Bhargav Rajivbhai Shah Reg. No CHB0911001 Batch Full-Time 2011. Module Leader Viswanath K Reddy M.S.Ramaiah School of Advanced Studies Postgraduate Engineering and Management Programmes(PEMP) POSTGRADUATE ENGINEERING AND MANAGEMENT PROGRAMME – (PEMP) MSRSAS - Postgraduate Engineering and Management Programme - PEMP #470-P Peenya Industrial Area, 4th Phase, Peenya, Bengaluru-560 058 Tel; 080 4906 5555, website: www.msrsas.org i
  • 2. Declaration Sheet Student Name Bhargav Rajivbhai Shah Reg. No CHB0911001 Course Real Time Embedded Systems Batch Full-Time2011 Module Code ESD 527 Module Title Module Date Embeddede Control System to Module Leader Viswanath K Reddy Batch Full-Time2011 5.11.2011 Extension requests: Extensions can only be granted by the Head of the Department in consultation with the module leader. Extensions granted by any other person will not be accepted and hence the assignment will incur a penalty. Extensions MUST be requested by using the ‘Extension Request Form’, which is available with the ARO. A copy of the extension approval must be attached to the assignment submitted. Penalty for late submission Unless you have submitted proof of mitigating circumstances or have been granted an extension, the penalties for a late submission of an assignment shall be as follows: • Up to one week late: Penalty of 5 marks • One-Two weeks late: Penalty of 10 marks • More than Two weeks late: Fail - 0% recorded (F) All late assignments: must be submitted to Academic Records Office (ARO). It is your responsibility to ensure that the receipt of a late assignment is recorded in the ARO. If an extension was agreed, the authorization should be submitted to ARO during the submission of assignment. To ensure assignment reports are written concisely, the length should be restricted to a limit indicated in the assignment problem statement. Assignment reports greater than this length may incur a penalty of one grade (5 marks). Each delegate is required to retain a copy of the assignment report. Declaration The assignment submitted herewith is a result of my own investigations and that I have conformed to the guidelines against plagiarism as laid out in the PEMP Student Handbook. All sections of the text and results, which have been obtained from other sources, are fully referenced. I understand that cheating and plagiarism constitute a breach of University regulations and will be dealt with accordingly. Signature of the student Date Submission date stamp (by ARO) Signature of the Module Leader and date Signature of Head of the Department and date ii
  • 3. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Abstract ____________________________________________________________________________ The history of micro air vehicles really began with the development of model airplanes in the 19th century and the development of radio controlled model airplanes in the 20th century. The development of miniature radio receivers and control components in the 1990s also had a large impact on the ability to design a very small flying vehicle. Once the aerodynamics and control of small aircraft models with a mass less that 100 grams were better understood, the micro-air-vehicle was born. As the first part of this assignment a brief essay prepared on Construction, working principal of single rotor and quad rotor MICAVs. Comparison of the single rotor and quad rotor MICAV, application and roadmap is discussed. Based on this work, MICAV is suggested for low altitude costal area surveillance. There are three possible motions any aircraft can take in space named as roll, yaw and pitch .Mathematical model is derived in for roll control systems part b. Step response of the mathematical model is created and analyzed. To get desire time response form that roll control system PID controller is designed. Open loop step response of PID and close loop response of whole mechanism with PID is plotted. To Digitalize designed PID ,z-transform of PID controller is derived with three different methods in part c. Apart from that , open loop step response of PID is plotted, analyzed and compared with the step response of analog controller which is plotted in part b. C program for the PID controller is created and tested with different test cases. By the end of the section direct form1 and direct form 2 realization of PID is done. iii
  • 4. Contents ____________________________________________________________________________ Contents Declaration Sheet ......................................................................................................................... ii Abstract ....................................................................................................................................... iii Contents ........................................................................................................................................iv List of Figures ..............................................................................................................................v List of Tables ...............................................................................................................................vi List of Symbols .......................................................................................................................... vii PART-A ........................................................................................................................................8 CHAPTER 1 Quad rotor v/s Single rotor .................................................................................8 1.1 Introduction.....................................................................................................................8 1.2 Construction and working principle of single and Quad rotor MICAVs .......................8 1.3 Comparison of the single rotor and quad rotor MICAVs ...............................................9 1.4 Applications ..................................................................................................................10 1.5 Roadmap .......................................................................................................................10 1.6 Recommendation of a suitable MICAV for coastal surveillance .................................10 PART-B ......................................................................................................................................11 CHAPTER 2 Modeling and Simulation of Quad rotor .........................................................11 2.1 Introduction ..................................................................................................................11 2.1 literature survey on the relative speed of the rotor for correcting the roll....................11 2.2 FBD for roll of the quad rotor.......................................................................................12 2.4 Mathematical model .....................................................................................................13 2.3 Assumptions of motor ...................................................................................................15 2.4 Transfer function based assumed parameter .................................................................15 2.5 Mathematical model simulation and analysis ...............................................................16 2.6 Design and implementation of PID controller ..............................................................17 2.7 Testing of PID controller ...............................................................................................19 2.8 Conclusion .....................................................................................................................20 PART-C ......................................................................................................................................21 CHAPTER 2 Digitalization of PID ..........................................................................................21 3.1 Introduction ...................................................................................................................21 3.2 Digitalizing of controller ...............................................................................................21 3.3 Modeling of digital controller .......................................................................................22 3.4 Comparison of analog and digital controller responses ................................................23 3.5 Implementation of digital controller in c .......................................................................24 3.6 Test cases .......................................................................................................................24 3.7 Responses of two implemented controller structures ....................................................26 3.8 Conclusion .....................................................................................................................27 CHAPTER 4 ..............................................................................................................................28 4.1 Learning outcome ..............................................................................................................28 REFRENCE ...............................................................................................................................29 BIBILOGRAPGY .....................................................................................................................30 Appendix ....................................................................................................................................31 iv
  • 5. MSRSAS - Postgraduate Engineering and Management Programme - PEMP List of Figures ____________________________________________________________________________ Figure 1. 1 Straight Rotations & Tilted Rotations ......................................................8 Figure 1. 2 Rotor Structure of Quad rotor[6] ..............................................................9 Figure 2. 1 Construction of quad rotor......................................................................11 Figure 2. 2 Phenomena of Roll motion .....................................................................12 Figure 2. 3 Block diagram of the rite rotor with brushless motor[3] ........................13 Figure 2. 4 Step response of roll control system .......................................................17 Figure 2. 5 Close loop response of roll control system with Kp...............................18 Figure 2. 6 Close loop response roll control system with Kp and Ki ......................18 Figure 2. 7 Close loop response roll control system with Kp,Ki and Kd .................19 Figure 2. 8 Testing of PID ........................................................................................20 Figure 3. 1 Step response of controller .....................................................................23 Figure 3. 2 Responses of analog and digital controller.............................................23 Figure 3. 3 Response Ramp exited digital PID ........................................................25 Figure 3. 4 Response of Impulse exited digital PID .................................................25 Figure 3. 5 Configuration of filter parameter in fdatool ...........................................26 Figure 3. 6 Step exited direct form 1 ........................................................................26 Figure 3. 7 Step exited direct form 2 ........................................................................27 v
  • 6. MSRSAS - Postgraduate Engineering and Management Programme - PEMP List of Tables ____________________________________________________________________________ Table 2. 1 Parameters of motor ...................................................................................................15 Table 2. 2 Relation between roll angel and input voltage ...........................................................16 vi
  • 7. MSRSAS - Postgraduate Engineering and Management Programme - PEMP List of Symbols ____________________________________________________________________________ Symbol Description MAV Micro Air Vehicle VTOL Vertical take-off and landing MEMs Micro-electromechanical Systems FDB Free Body Diagram RPM Revolutions per Minute BLDC Brush Less Direct Current ZOH Zero Order Hold PID Praposnal, integrator and differentiator . vii
  • 8. PART-A CHAPTER 1 Quad rotor v/s Single rotor v 1.1 Introduction MAVs are defined as small flying systems which are designed for performing useful operations. The concept to design micro air vehicle came in lime light over the past few year, with the purpose of carrying law altitude surveillance. To fulfill the utility of law altitude aerial surveillance, the aircrafts that are small and slow as the law of aerodynamics is essential. This kind of small vehicle is known as the micro air vehicles. As per the pattern of the landing and takeoff there are two arrangement of the rotor is possible. The first one is the tilt rotor or single rotor in the which the takeoff and landing is possible with the horizontal axis [4]. Tilt-rotor aircraft feature the ng rotor ability to hover like a helicopter, enabling a vehicle to loiter directly over a target and to fly at high speeds. The anther one is a quad rotor, in which the four rotors are used to control the spee and speed altitude of the vehicle. This type of MA is capable to land or take off along with vertical axis. MAVs r VTOL MAVs are also gaining popularity, mainly because of their ability to quietly linger in one s popularity, spot for an extended period of time [ [4]. 1.2 Construction and working principle of single and Quad rotor MICAVs Single rotor: A single rotor MAV is the type of the micro version of the helicopter. Which fly MAV with thrust that is produced by the rotation of the only one main rotor which is mounted above the body. The lifting force is produced by the main rotor As they spin in the air and produced the lift. duced rotor. Each blade of rotor produces an equal share of the lifting force. The weight of a helicopter is equal divided evenly between the rotor blades on the main rotor system. The straight rotations of the main rotation rotor as shown in figure 1.1 are responsible for the producing the vertical thrust. By tilting the direction of the main rotor as shown in the figure 1.1 produce the horizontal thrust. Figure 1. 1 Straight Rotations & Tilted Rotations 8
  • 9. MSRSAS - Postgraduate Engineering and Management Programme - PEMP With effect of only single rotor, if the rotor is rotating in the clock wise direction so the whole body moves in the anti clock wise direction as per the Newton's third law of motion states. To avoid this unnecessary rotation contradictory torque to main rotor is required. Usually a small rotor is used on the tail to produce a contradictory thrust that prevents the body from the rotation. Sometimes whole body can rotate by the thrust produced you the tail rotor. Quad rotor: The quad-rotor MAV consists of a rigid cross frame equipped with four rotors placed in the four corners of a planar square, those ones placed oppositely rotate in the same direction, while the perpendicular ones rotate reversely. A revolution or a torque control can be realized from group of a motor and the rotor mounted on it to ensure simple and efficient actuation, which can practically be realized within a local control loop. The attribute control in the quad rotor is carried out by changing the speed of the four motors. Figure 1. 2 Rotor Structure of Quad rotor[6] The arrangement of the motors is shown in the figure 1.1. Pitch and roll angles are controlled using moments generated by differential thrust between rotors on opposite sides of the vehicle, and the yaw angle is controlled using the difference in reaction torques between the pitch and roll rotor pairs. 1.3 Comparison of the single rotor and quad rotor MICAVs • A phenomena of the tilting of the rotor while running at high speed is mechanically complicated as compared changing the speed of the rotors in the quad rotor • In single rotor one main rotor and one tail rotor rotate so the vibrations produced on the body is less as compared to four rotors in quad rotor design • Four rotors are used in the quad rotor so the cost and weight is more as compared to the single rotor • In the quad rotor each individual rotor has s small diameter as compared to the single rotor, which is having less kinetic energy during the flight. Which reduce damage if rotor hits anything . 9
  • 10. MSRSAS - Postgraduate Engineering and Management Programme - PEMP 1.4 Applications 1) A law cost spying 2) Search for survivors[4] 3) Urban traffic management[4] 4) Ares surveillance[4] 5) Pipeline inspection 6) Used by the military for recognizance and search and rescue operations[5] 1.5 Roadmap In 1907, the Breguet Brothers constructed the first quad-rotor named Gyroplane. The flight was a good work to show the principle of a quad rotor. In 1922, Georges de Bothezat built a quad rotor with a rotor located at each end of a truss structure of intersecting beams, placed in the shape of a cross. Experimental aircrafts X-19 and Bell X-22A are also designed as quad rotor aircrafts. In time due to the tremendous improvements in manufacturing techniques and innovations in metallurgical material knowledge more precise and smaller sensors can now be produced. The Microelectromechanical Systems (MEMs) technology now allows the production of machine components such as gears with sizes in 10ି଺ meter range. Using this MEMs technology very small accelerometers, gyros and magnetometers are also produced, which caused the production of smaller strap down inertial navigation systems. As a result of this improvement in technology very small quad rotors are developed around the world. 1.6 Recommendation of a suitable MICAV for coastal surveillance The quad rotor MICAVs has very stable performance in the windy condition due to the four rotors. Driving flexibility is more in quad rotor .Moreover the due to four rotor structure of the quad rotor it can stay at one place for long time as compare to the single rotor ,which can provide accurate surveillance of costal area. So, quad rotor type MICAVs are recommended for costal surveillance. 1.7 Conclusion On the basis of above I can conclude that single rotor MAV has a less power consumption due to the single rotating wing but for good stability in the windy condition and ability to hover for a long time on same pace quad rotor is the suitable. 10
  • 11. MSRSAS - Postgraduate Engineering and Management Programme - PEMP PART-B CHAPTER 2 Modeling and Simulation of Quad rotor ________________________________________________________________________________ 2.1 Introduction In this part of assignment the literature survey on the relative speed of the rotor and FBD is created. Based on the FDB mathematical model is created. Mathematical model is simulated using the Matlab and analyzed the Quad rotor model for stability. 2.1 literature survey on the relative speed of the rotor for correcting the roll A Quad rotor is an aerial vehicle that generates lift with four rotors. The MAV is controlled by varying the rpm and not by using any mechanical actuators like in a helicopter. This makes it particularly suitable for MAVs. The MAV requires active control of six degrees of freedom to fly. The layout of a quad rotor is shown in the figure. Figure 2. 1 Construction of quad rotor The Quad Rotor layout is shown Figure 2.1. There are two arms, each having motors at its ends. The motors 1 and 3, which are mounted on the same arm, rotate in the clockwise direction while the motors 2 and 4, mounted on the second arm, rotate in the anti-clockwise arrangement. Both motors at opposite ends of the same arm should rotate in same direction to prevent torque imbalance during linear flight. Altitude Motion The throttle movement is provided by increasing (or decreasing) the speed of all the rotors by the same amount. It provides a vertical force to the quad rotor. 11
  • 12. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Roll motion The roll movement is provided by increasing (or decreasing) the left rotor speed and at the same time decreasing (or increasing) the right rotor speed. It leads to a torque with respect to the central axis as shown in Fig 2.2 which makes the quad rotor roll. The overall vertical thrust is the same as in hovering. Figure 2. 2 Phenomena of Roll motion Pitch Motion The pitch movement is provided by increasing (or decreasing) the front rotor speed and at the same time decreasing (or increasing) the back rotor speed. It leads to a torque with respect to the central axis. Yaw Motion The yaw movement is provided by increasing (or decreasing) the front-rear rotor speed and at the same time decreasing (or increasing) the left-right couple. It leads to a torque which makes the quad rotor turn in horizon level. 2.2 FBD for roll of the quad rotor A FBD is a pictorial representation of the force acting on the body of interest. It included all the forces acting on a body.FBD consists of sketch of body &arrows which shoes the force applied on it. For drawing FBD assume one condition in which at t=0 speed of a right and left rotor is 50 rpm and aircraft is in hovering condition. At this condition Roll angle with respect to the ground axis is zero. In stable state at t=1 aircraft got some problem and it tilted to right side and to roll angle with respect to the ground axis is changed to 30 degree. At this movement still both rotors rotating at the same speed. Sometimes this condition is hazardous for aircraft. To overcome this tilt and make roll angle to zero there must be sudden increase in upward torque from right rotor. For 12
  • 13. MSRSAS - Postgraduate Engineering and Management Programme - PEMP increasing the produced torque by the right rotor speed of the rotor should be increase. So, the needed increment in speed is proposal to the roll angle. At t=2 speed of the right rotor is increased by the 20 rpm. Sudden change in rotor speed produced more lift at right side and roll angle will recover .Once roll angle reached to the 0 degree or near to that speed of the right motor should be decreased again. So, by increasing and decreasing the speed of one rotor, roll angle can be controlled. Figure 2.3 shows the free body diagram of the brush less D.C motor. At the electrical side of a free body, diagram stator is represented as three phase why connection and input voltage to motor is given to by why connection network. Figure 2. 3 Block diagram of the rite rotor with brushless motor[3] At other side torque which is produced by the motor is represented by the upwards arrow. Load is the wing of the rotor .which has a angular displacement and friction. 2.4 Mathematical model Mathematical model of the brushless DC motor is almost same as brushed DC motor. Only by considering one condition of which phase is affecting the output of BLDC. The phase only affected the resistive and the inductive load of the BLDC[3]. The transfer function for DC motor is: G(s) = ఠ೘ ௏ೞ = ௦మ ௃௅ା௦௄ ௄೟ ೑ ௅ା௦ோ௃ା௄೑ ோା௄೐ ௄೟ Where, ܶ௘ =an electrical tourqe ‫=ܥ‬a friction constent J=rotor innertia ߱௠ =the angular velocity ܶ௟ =the suspended mechanical load 13
  • 14. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Where the electrical tourqe and the back emf is written as e=݇௘ ߱௠ and ܶ௘ =݇௧ ߱௠ where ݇௘ is back emf constant and ݇௧ ݅‫ݐ݊ܽݐݏ݊݋ܿ ݁ݍݎݑ݋ݐ ܽ ݏ‬ G(s) = ఠ೘ ௏ೞ = ௄೟ ௦మ ௃௅ା൫௄೑ ௅ାோ௃൯௦ା௄೑ ோା௄೐ ௄೟ Considering the following assumption. 1. Due to brushless in the nature friction constent is small for the brushless motor, ‫ܭ‬௙ tends to zero. 2. Rj>>‫ܭ‬௙ L 3. ݇௘ ݇௘ >>‫ܭ‬௙ ܴ So, the final transfer function is written is G(s) = ఠ೘ ௏ೞ ௄ ೟ = ௦మ ௃௅ାା௦ோ௃ାା௄ ೐ ௄೟ By multiplying the top and bottom equation by: ܴ 1 ∗ ‫ܭ‬௘ ‫ܭ‬௧ ܴ Finally above equation became: G(s) = ఠ೘ ௏ೞ = భ ಼೐ ೃ಻ ಽ ೃ಻ ௦మ ∗ ା௦ ାଵ ಼೐ ಼೟ ೃ ಼೐ ಼೟ From the above equation mechanical time constant and electrical time constant is ߬௠ = ܴ‫ܬ‬ ‫ܭ‬௘ ‫ܭ‬௧ ߬௘ = ‫ܮ‬ ܴ So above equation became G(s) = ఠ೘ ௏ೞ = ௦మ ∗ఛ భ ಼೐ ೘ ∗ఛ೐ ା௦∗ఛ೘ ାଵ Construction of the D.C brushless motor will affect only mechanical and the electrical co offecient of the D.C motor transfer function So mechanical and the electrical time constent for D.C brushless motor is ߬௠ = ∑ ܴ‫ܬ‬ ‫ܴ∑ܬ‬ = ‫ܭ‬௘ ‫ܭ‬௧ ‫ܭ‬௘ ‫ܭ‬௧ ߬௘ = ∑ ‫ܮ‬ ‫ܮ‬ = ܴ ∑ܴ Due to symmetrical and three phase arrangement 14
  • 15. MSRSAS - Postgraduate Engineering and Management Programme - PEMP ߬௠ = ߬௘ = (3ܴ)‫ܬ‬ ‫ܭ‬௘ ‫ܭ‬௧ ‫ܮ‬ 3∗ܴ Therefore the equation for the brushless motor is obtain by G(s) = 2.3 ఠ೘ ௏ೞ = ௦మ ∗ఛ భ ಼೐ ೘ ∗ఛ೐ ା௦∗ఛ೘ ାଵ Assumptions of motor Assumptions are taken from the Data sheet of the EC45 flat 45mm brushless motor. Table 2. 1 Parameters of motor Motor Data Unit Value 1 Nominal voltage V 12.0 2 No load speed rpm 2500 3 Nominal speed rpm 1200 4 Nominal torque mNm 30 5 Terminal resistant phase to phase Ω 4.5 6 Terminal impedance phase to phase H 3 7 Torque constant mNm/A 2 8 Mechanical time constant ms 2.25 9 Rotor inertia gܿ݉ଶ 5 2.4 Transfer function based assumed parameter By substituting the values to the general transfer function for the BLDC motor. The electrical time constant ߬௘ = ‫ܮ‬ 3∗ܴ Where, R=Rɸ=4.5Ω ‫ܬ‬௥௢௧௢௥ =5 gܿ݉ଶ =5*10ିଷK݃݉ଶ ߬௠ =2.25 ms L=3H ߬௘ = 3 3 ∗ 4.5 15
  • 16. MSRSAS - Postgraduate Engineering and Management Programme - PEMP ߬௘ = 0.2222 For mechanical time constant ߬௠ = ‫ܭ‬௘ = (ଷோ)௃ ௄೐ ௄೟ =2.25 (3ܴ)‫ି01 ∗ 5 ∗ 5.4 ∗ 3 ܬ‬ଷ = = 15 ߬௠ ‫ܭ‬௧ 2.25 ∗ 2 There for final transfer function is ‫= )ݏ(ܩ‬ 0.0666 0.5‫ ݏ‬ଶ + 2.25ܵ + 1 Above transfer function is for the stable condition of the MICAV. For unstable condition if the roll angle of the rotor with respect to ground axis is 30 degree at right hand side, so speed of the right rotor should be increased by some factor of roll angle. The speed of motor is depend upon the input voltage .Assumed relation between the roll angle, rpm to overcome roll angle and voltage to achieve rpm is given by table 2.2.In the case of 30 degree roll angle with respect to right rotor, speed of the right motor should be increased by the 30 rpm to overcome roll angle. To achieve this rpm input voltage should increased by 3. Table 2. 2 Relation between roll angel and input voltage Roll angle Voltage to achieve rpm 10 10 1 20 20 2 30 30 3 40 40 4 50 50 5 60 2.5 Rom to overcome roll angle 60 6 Mathematical model simulation and analysis Simulation of the open-loop transfer function and step response of right side motor is show by figure 2.4.From the plot , if 1V is applied to the system the motor can only achieve 0.7 rad/sec. It also takes 8.9 second to reach its final speed (steady state). Amount of overshoot in step response is 0%.Required overshoot should less than 10%, steady state time is 2 sec and peak overshoot is less the 10 %.PID controller is required to regulate the input of system for which it responds under require parameter. In this condition of the motor time taken by to MICAV to recover the roll angle is ଷ଴∗଼.ଽ ௥௣௠∗௦௘௖ T= ଺.଻௥௣௠ = 39 ‫ܿ݁ݏ‬ 16
  • 17. MSRSAS - Postgraduate Engineering and Management Programme - PEMP 1 rad/sec =9.6 rpm, so speed achieve by motor is by applying 1 V is 0.7 ras/sec=6.7 rpm[1]. 2.6 Design and implementation of PID controller PID controller is added to the roll control system to get the desired output response. First, only the proportional control (Kp) in the controller is considered. The closed-loop transfer function of the roll control system with a proportional control is obtained, as. Figure 2. 4 Step response of roll control system ‫= )ݏ(ܩ‬ 0.5‫ ݏ‬ଶ 0.0666 ∗ ‫ܭ‬௣ + 2.25‫ܭ + 1( + ݏ‬௣ ) Initially the proportional controller is set at 150.Figure 2.5 shows the response of the system using only proportional controller at kp=145.Graph shows that peak overshoot is at 0% and settling time is also increased by the around 16 second. To achieve desire performance of the roll control system integral controller is being designed with the proportional controller. The response of close loop transfer function of the roll control system is shown in the figure2.6. In the plot, Overshoot is 1% that is under required range. Settling time is approximately 14 seconds that is doesn’t match specifications. Match system performance with the requirement PID controller is designed. 17
  • 18. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Figure 2. 5 Close loop response of roll control system with Kp Figure 2. 6 Close loop response roll control system with Kp and Ki Proportional control (Kp), the integral control (Ki) and the differential control in the controller are considered in the roll control system. The closed-loop transfer function of the roll control system with the PID controller is obtained, as ‫ܭ‬ௗ ܵ ଶ + ‫ܭ‬௣ ‫ܭ + 6660.0( + ݏ‬௜ ) ‫= )ݏ(ܩ)ݏ(ܪ‬ (‫ܭ‬ௗ + 0.5)ܵ ଶ + (2.25+‫ܭ‬௣ )ܵ + 1 + ‫ܭ‬௜ 18
  • 19. MSRSAS - Postgraduate Engineering and Management Programme - PEMP 0.4541ܵ ଶ + 9.729‫214.3 + ݏ‬ ‫= )ݏ(ܩ)ݏ(ܪ‬ 0.5ܵ ଷ + 2.704ܵ ଶ + 10.73ܵଵ + 3.412 Figure 2.7 shows the response of the roll control system using PID controller with values of kp=145.9316,Ki=51.1785 and Kd= 6.8114. Graph shows that at this values of the PID controller peak overshoot is deceased to the 8.8% And settling time is also decreased by the around 2 second. By comparing the step response open loop transfer function without PID with step response of close loop transfer function with PID controller, 1V is directly given to that right motor without PID controller so motor it will rotates at the constant speed of 0.7rad/sec. To achieve this speed motor will take 8.9 sec . At this same input condition with PID controller same motor will rotate at 1 rad/sec. To achieve this speed same motor will take 2 sec. After PID time taken to recover 30 degree roll angle is ૜૙∗૛ ࢘࢖࢓∗࢙ࢋࢉ T= ૢ.૞࢘࢖࢓ = ૟. ૜ ࢙ࢋࢉ. 1 rad/sec =9.6 rpm Figure 2. 7 Close loop response roll control system with Kp,Ki and Kd 2.7 Testing of PID controller Testing of PID control is being done by providing the step input to the controller. A figure 2.8 show the output of the output of the analog PID controller .it can observed from figure 2.8 which has setting time 11.8 seconds . Note: The PID transfer function is not proper. Matlab will not allow this. By switching the numerator and denominator the step command can be fooled into giving the right answer. 19
  • 20. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Figure 2. 8 Testing of PID 2.8 Conclusion On the basis of above analysis of responses I can conclude that, by using the PID controller time taken to the recover roll angle can be optimized. By combining of the two unstable system one stable system can be possible. 20
  • 21. MSRSAS - Postgraduate Engineering and Management Programme - PEMP PART-C CHAPTER 2 Digitalization of PID ________________________________________________________________________________ 3.1 Introduction In this part of assignment, digitalization of the analog PID controller is done using three methods is done and matlab/simmulink model is created. Response of the analog and digital controller is compared. Direct form 1 and direct form 2 is created for digital controller and c program is written. 3.2 Digitalizing of controller 1. Zero Order Hold (ZOH) method: It is assumed that the system has a zero order hold element on the input side of the system. This is the case when the physical system is controlled by a computer via a DA converter (digital to analog). Zero order hold means that the physical input signal to the system is held fixed between the discrete points of time[2]. PID controller transfer function ௄ H(s)=‫ܭ‬௣ + ௌ೔+‫ܭ‬ௗ ܵ ௄೏ ௌ మ ା௄೛ ௌା௄೔ H(s)= ௌ Bys subtitling values of Kp,Kd and Ki ଺.଼ଵଵସௌ మ ାଵସହ.ଽଷଵ଺ௌାହଵ.ଵ଻଼ହ H(s)= G(z)=[ G(z)=[ ௌ ଵି௘ ೄ೅ G(z)=[ G(z)=[ ௌ ଵି௘ ೄ೅ ଵ ][ ][ ଵି௘ ೄ೅ ଵ ଵି௭ షభ ଵ ଺.଼ଵଵସௌ మ ାଵସହ.ଽଷଵ଺ௌାହଵ.ଵ଻଼ହ ଺.଼ଵଵସௌ మ ାଵସହ.ଽଷଵ଺ௌାହଵ.ଵ଻଼ହ ] ௦మ ଺.଼ଵଵସ ][ ଵ ଺.଼ଵଵସ ][ ] ௌ ଵ + + ଵସହ.ଽଷଵ ௌ ଵସହ.ଽଷଵ௭ (௭ିଵ)భ + ହଵ.ଵ଻଼ହ + ହଵ.ଵ଻଼ହ்௭ ௌమ ] (௭ିଵ)మ ] At T=1 G(z)=[ G(z)=[ ଵି௭ షభ ଵ ଺.଼ଵଵସ ][ ଵ + ଵସହ.ଽଷଵ௭ (௭ିଵ)భ + ହଵ.ଵ଻଼ହ௭ (௭ିଵ)మ ] ௭ିଵ ଺.଼ଵଵସ൫௭ మ ିଶ௭ାଵ൯ାଵସହ.ଽଷଵ൫௭ మ ି௭൯ାହଵ.ଵ଻଼ହ௭ ௭ ][ (௭ିଵ)మ ] 21
  • 22. MSRSAS - Postgraduate Engineering and Management Programme - PEMP ଵହଶ.଻ସଶସ൫௭ మ ൯ିଵ଴଼.ଷ଻ହଷ(௭)ା଺.଼ଵଵସ ௒(௭) G(z)= ௑(௡) = [ ௭ మ ି௭ ] By multiplying denominator and numerator with 1/‫ ݖ‬ଶ , (z)= ௒(௡) ௑(௡) ଵହଶ.଻ସଶସାଵ଴଼.ଷ଻ହଷ൫௭ షభ ൯ା଺.଼ଵଵସ௭ షమ =[ ଵି௭ షభ ] By cross multiplying, Y(n)-Y(n-1)= 152.7424ܺ(݊) + 108.3753ܺ(݊ − 1) + 6.8114ܺ(݊ − 2) Y(n)=152.7424ܺ(݊) + 108.3753ܺ(݊ − 1) + 6.8114ܺ(݊ − 2) + ܻ(݊ − 1) 2 Bilinear transformation: This method is based on an integral approximation where the integral is interpreted as the area between the integrand and the time axis, and this area is approximated with trapezoids. This is the Tustin’s method .but with a modification so that the frequency response of the original continuous-time system and the resulting discrete-time system has exactly the same frequency response at one or more specified frequencies [2]. ଺.଼ଵଵସௌ మ ାଵସହ.ଽଷଵ଺ௌାହଵ.ଵ଻଼ହ H(s)= ௌ ଶ ௓ିଵ S=்(௓ାଵ),Sampling time T=1; ଶ ௓ିଵ H(்(௓ାଵ)) = ସ∗଺.଼ଵଵସቀ ೋషభ మ ೋషభ ቁ ାଵସହ.ଽଷଵ଺∗ଶ( )ହଵ.ଵ଻଼ହ ೋశభ ೋశభ ೋషభ ଶ( ) ೋశభ ௒(௭) ଷ଻଴.ଶହ଻ଷ௭ మ ାହ଻.଼ହହ଼௭ିଶଵଷ.ସ଴ଽଵ = ଶ௭ మ ିଵ ௑(௭) 3. Backward differentiation method ଺.଼ଵଵସௌ మ ାଵସହ.ଽଷଵ଺ௌାହଵ.ଵ଻଼ହ H(s)= ௌ ௭ିଵ S= ் Sampling time T=1; H( ௓ିଵ ଵ )= H( ଺.଼ଵଵସ((௭)మ ିଶ௭ାଵ) ାଵସହ.ଽଷଵ଺∗ଶ(௭ିଵ)ାହଵ.ଵ଻଼ହ ௭ିଵ ௓ିଵ ଵ )= ଺.଼ଵଵସ((௭)మ ାଵଷଶ.ଷ଴ଶ଺௭ି଼ଵ.ଵଶସଵ ௭ିଵ 3.3 Modeling of digital controller Zoh method is chosen for matlab modeling of the PID controller. By step excitation of PID system alone the response of the filter is shown by figure 3.1. Graph shows the open loop response of the PID controller. Due to open loop in nature amount of overshoot is infinity. Settling time of the response is 12 seconds. 22
  • 23. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Figure 3. 1 Step response of controller 3.4 Comparison of analog and digital controller responses Figure 3.2 show the comparison of the step response of the analog and digital controller which is developed in the previous section. Figure 3. 2 Responses of analog and digital controller From figure, settling time of analog controller is 11.2 second with final value of 0.3 but in the case of the digital controller it is being increased by the 12 second with the final value of 0.3. Settling 23
  • 24. MSRSAS - Postgraduate Engineering and Management Programme - PEMP time of the analog controller is 11.2 second, for digital controller settling time is increased by 0.8.Rise time of the analog controller 0.000541 second but for digital controller rise time is 0 second. Peak amplitude of the analog controller is 0.0065 with occurs at the time of 0.197 seconds but for digital system peak amplitude is 0.0049 second which occurs at 1 second. 3.5 Implementation of digital controller in c As per z-transform equation derived by the zoh method c algorithm has been created. filter equation is Y(n)=152.7424ܺ(݊) + 108.3753ܺ(݊ − 1) + 6.8114ܺ(݊ − 2) + ܻ(݊ − 1) . **************************************************************************** #include<stdio.h> Void main(void) { int input[]={1,1,1,1,1,1}; int output[]; // input sample string // filtered output sample string int i; for(i=0;i<=size of(input);i++) { If(i>=2) { output[i]=152.7424*input[i]+108.3753*input[i-1]+6.8114 input[i-2]+output[i-1]; Elseif(i=1) { Output[i]=152.7424*input[i]+108.3753*input[i-1]+output[i-1]; Elseif(i=0) { Output[i]=152.7424*input[i] }}}} At the end output is ={152.7424,413.8601,681.7892,949.7183,1217.6474,1485.5765} 3.6 Test cases There are three input condition is possible for filter .Based on the input condition there are three test cases are designed. 1. Input of step signal By providing the step input to the filter, the input string will be input={0 ,1 ,1, 1, 1, 1}. 24
  • 25. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Figure 3.1 shows the response of the filter by inserting step input. 2. Input of ramp signal By providing the ramp input to the filter, the input string will be input={01,2,3,4,5,6}. Figure 3.3 shows the open-loop response of the PID exited with ramp signal. Figure 3. 3 Response Ramp exited digital PID 3. Input of impulse signal By providing the step input to the filter, the input string will be input=1. Figure 3.4 shows the open-loop response of the PID exited with impulse signal. Figure 3. 4 Response of Impulse exited digital PID 25
  • 26. MSRSAS - Postgraduate Engineering and Management Programme - PEMP 3.7 Responses of two implemented controller structures Direct form 1 and the direct form2 is a different pictorial representation of the filter equation. Digital PID structure is implemented on simmulink to develop direct form 1 and direct form 2.Fdatool is used to get direct form 1 and direct form2.figure 3.3 shows the configuration of the filter parameter in fdatool. The output of the fdatool is simmulink subsystem with direct form 1 and direct form 2. Figure 3. 5 Configuration of filter parameter in fdatool Figure 3. 6 Step exited direct form 1 26
  • 27. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Figure 3. 7 Step exited direct form 2 Figure 3.3 and 3.4 shows the direct form realization of digital PID which is generated by fdatool. By exiting this filter realization with unit step, output of the system is shown by graph in figures. Left graph shows input of the digital filter as the right once represents the output response of the filter. 3.8 Conclusion By doing above work i can conclude that, by converting the analog PID into the digital the overall response of the system will almost be same. Accuracy of the digital resource is gained by decreasing the sampling time. 27
  • 28. MSRSAS - Postgraduate Engineering and Management Programme - PEMP CHAPTER 4 Module learning outcomes ______________________________________________________________________________ 4.1 Learning outcome The module was well taught by module leader. This module helped me to understand the following things. • To identify free body diagram of system on the basis of FBD derivation of mathematical model of system • Analyzing the time and frequency response of the system • To design of PID controller to obtain desire response of system • To convert the analog PID in to digital by z-transform and analyze the response of the same • To make efficient use of matlab/simmulink for control theory 28
  • 29. MSRSAS - Postgraduate Engineering and Management Programme - PEMP REFRENCE ________________________________________________________________________________ [1] http://www.convertunits.com/from/radian/second/to/RPM [2] http://techteach.no/publications/articles/discretization/discretization.pdf [3]http://amrita.academia.edu/AdityaSreekumar/Papers/590760/Design_and_Implementation_of_th e_Closed_Loop_Control_of_a_Quad_Rotor_UAV_for_Stability [4] http://www.dtic.mil/cgi-bin/GetTRDoc?AD=ADA521374 [5] http://illumin.usc.edu/162/the-quadrotors-coming-of-age/ [6] www.ijcaonline.org/volume11/number10/pxc3872181.pdf [7] http://www.winlab.rutgers.edu/~samar/public/mimo_sensing_aces05.pdf 29
  • 30. MSRSAS - Postgraduate Engineering and Management Programme - PEMP BIBILOGRAPGY ________________________________________________________________________________ 1. Viswanath K Reddy, Embedded Control System, Course Notes – M.S.Ramaiah School of Advanced Studies, Bangalore, Feburary, 2011 2. www.mathworks.com 3. control system engineering by Norman Nise 30
  • 31. MSRSAS - Postgraduate Engineering and Management Programme - PEMP Appendix ________________________________________________________________________________ %% for step respounce of open loop system close all clear all J=5; p=3; Kt=2; R=4.5; L=3; tm=2.25; te=L/(p*R); Ke=(3*R*J)/(tm*Kt) num=1/Ke den=[tm*te tm 1] a=tf(num,den) //openloop TF of motor figure(1) step(num,den) // Step respounce of motor title('open loop transfar function') grid on %%% for PID controller close all clear all J=5; p=3; Kt=2; R=4.5; L=3; tm=2.25; te=L/(p*R); Ke=(3*R*J)/(tm*Kt) num=1/Ke den=[tm*te tm 1] a=tf(num,den) Kp=145.9316; Ki=51.1785; Kd=6.8114; figure(2) po=tf([Kd, Kp, Ki],[1 0]); // TF of PID s=feedback(a*po,1) step(s) // step resource of PID title('PID Control with small Ki, Kd and Kp') %%% plotting of analog and digital controller respounce Kp=145.9316; Ki=51.1785; Kd=6.8114; figure(1) step([1 0],[Kd Kp Ki]) title(' respounce of Analog controller') po=tf([Kd, Kp, Ki],[1 0]); [denasz,numasz]=c2dm([1 0],[Kd, Kp, Ki],1,'zoh') // z-transform of PID figure(2) dstep(denasz,numasz,101) [x1]=dstep(denasz,numasz,101) figure(3) t=0:.12:12 stairs(t,x1) // steap ounce of digital PID title('respounce of Digital controller') %%%%% 31