FULL PAPER PROCEEDING Multidisciplinary Studies Available online at

Size: px
Start display at page:

Download "FULL PAPER PROCEEDING Multidisciplinary Studies Available online at"

Transcription

1 FULL PAPER PROCEEDING Multidisciplinary Studies Available online at Full Paper Proceeding ECBA-2015 Vol. 24- Issue ISBN ECBA -15 GUI PID Self-Tuning System for Quadcopters Chiao-Tzu Huang 1* Yin-Chou Liao 2 12 Department of Industrial Engineering & Management National Chin-Yi University of Technology Abstract In this paper we developed a PID auto-tuning system to optimize the attitude stability of the quadcopter. The tests utilized quadcopter with 18 inch propellers first we obtained the data from MAVLink by LabVIEW then designed an algorithm to control the throttle by the reacting of attitude in order to auto-tune the PID parameters. Self-tuning method will search the optimized PID parameters through the reacting of attitude in real time. The self-tuning system could extend to other quadcopters for future developing and the LabVIEW GUI facilitated the tuning progress. 2015The Authors. Published by Academic Fora. This is an open access article under the CC BY-NC-ND license ( Peer-review under responsibility of the Scientific & Review committee of ECBA Keywords Quadcopter PID Self-Tuning Introduction Unmanned aerial vehicles (UAVs) have been put in the spotlight recent years since their potential applications. When it comes to industry 4.0 internet of things (IOT) and big data we cannot ignore the role of UAVs in the future. This paper utilized a Proportional -Integral-Derivative (PID) algorithm which will make sure the stability error get to zero.the experiment was to build adynamic system which optimize the stability of the quadcopter. First we manually found a better quadcopter build for flight time but it was a large type quadcopter since the axis distance was 890mm and the propellers was 18 inches. This caused the PID parameters were difficult to tune. We basically wanted to tune three basic proportion parameters of roll pitch and yaw attitude to take off stably first and then tuned other 6 parameters to fly stably and finally tuned all 18 parameters to optimize the stability of the quadcopter. This dynamic system was built by LabVIEW which read the data from Mission Planner through Mavlink. When the quadcopter turned on with fewer than 20% throttle the system will auto tune until find optimized parameters. Quadrotor Motion Model Literature Review A quadrotor is an aircraft which has four rotors with fixed pitch angle. A model should be developed for the vehicles to fly in the real world. In the quadrotor the four rotors generated the vertical thrust by each propeller which collective the sum of each motor is U 1 as shown in Fig. 1. There arealso three Euler angles (ϕ θ ψ) [1]like other aircrafts which present Roll Pitch and Yaw angles respectively and this constructed the quadrotor system with 6 outputs (x y z ϕ θ ψ) and 4 input thrust. The pitch motion is to increase (reduce) the speed of the rear motor while reduce (increase) the speed of the front motor and this made the quadcopter lean forward (backward) to move so. The roll motion is to increase (reduce) the speed of the right motor while reduce (increase) the speed of the left motor so that the quadcopter will lean right (left) to rotate. The yaw motion is to increase (decrease) the speed of the front and rear motors together while decreasing (increasing) the speed of the lateral motors together so that the quadcopter will change the heading direction to the left or right. This is showed in Fig. 1.[2] Every input of the flight controller affected the side of the quadrotor modelu 1 affect the altitude (z-axis)u 2 affected the rotation in the roll angle U 3 affected the pitch angle and U 4 affected the yaw angle during the flying process for the model. The number 1 and 4 rotors were counterclockwise and the other two were clockwise for balancing the torque and producing the yaw motions.[2] *All correspondence related to this article should be directed to Chiao-Tzu Huang Department of Industrial Engineering & Management National Chin-Yi University of Technology antex501@gmail.com 2015 The Authors. Published by Academic Fora. This is an open access article under the CC BY-NC-ND license ( Peer-review under responsibility of the Scientific & Review committee of ECBA-2015.

2 The quadrotor is controlled by the dynamic model which used the notationabove describe as following: R xyz = C φ C θ C φ S θ S ψ S φ C ψ C φ S θ C ψ S φ S ψ C φ S θ S φ S θ S ψ C φ C ψ S φ S θ S ψ C φ S ψ S θ C θ S ψ C θ C ψ Where R is the matrix transformation and C φ =cos(ϕ)s θ =sin(θ)etc. Further we can describe the input force as the motion: U 1 = Th 1 Th 2 Th 3 Th 4 m U 2 = l Th 1 Th 2 Th 3 Th 4 I 1 U 3 = l Th 1 Th 2 Th 3 Th 4 I 2 U 4 = C Th 1 Th 2 Th 3 Th 4 I 3 Where U i is the vertical thrust generated by the four rotors Th i is the thrust generated by each rotor and it s the direct control input to the system m is the total mass of the quadcopter l i is the motion of inertia with each axe and C is the force to moment scaling factor.[2][3] PID Control Method Fig. 1: Quadrotor movements The proportional integral derivative (PID) control method is the most popular algorithm which widely used in control situations. PID has lots of advantages that can fit for more than 99% control situations such as feed-forward loops nonlinear gain scheduling and so on. But one of the most difficult things is to tune the parameters of PID controllers so far that s what we aim for in this paper.[4][5][6]. We want to control the plant which is quadcopter in this paper and set a goal which is a desired status to achieve the plant now produces an error which stands for the deviation of current status and the goal. Proportional integral and derivative describe how the error term is handled so the PID controller is how to convert the error into a command.[4][6]. P is proportional which controls the present the error multiplied by a positive constant P so that the output will be proportional to the error.i stands for integral which controls the past the error in the past period of time multiplied by a positive constant I and from the past mean error to find systematic results. D is derivative which controls the future but it would be not necessary when the plant is in very low speed. In the control theory the ideal PID controller structure in the continuous time is shown as following and Fig. 2.:[4] U t = K p e t K i t de(t) e(τ)dτ K d 0 dt 104

3 P - Error I Output D Sensor Quadcopter Implementation Fig. 2: PID Controller Methodology We want to build a quadcopter with long flight time to make sure that our further work will possible to do if we want to make UAVs work with people the flight time is one of the most consideration. We chose carbon fiber to make the frame which used Epoxy to stick them together. Our quadcopter was shown in Fig. 3 and the block diagram was shown in Fig.4. where FC stands for flight control stands for electronic speed control PM is power module and PDBis power distribution board Hardware specification: 1) Motors: 380KV 2) Propellers: 1855 Carbon Fiber 3) Batteries: mah 1C/2C Li-Ion 4) Frame: Carbon Fiber 5) s: 30A Simonk 6) Motor to motor distance: 89cm 433Mhz Radio Telemetry Fig. 3: 1855 Quadcopter implement 105

4 Radio Transmitter FC BATTERY Propeller PM PDB LabVIEW PID Self-Tuning Implement Fig. 4: Block diagram of Quadcopter Fig. 5. Showed the flow chart. The VI communicated with MAVLink first it acquired all the parameters what we need. When pressed the Start button in the UI the auto tuning began. It will arm the quadcopter first and then it will increase throttle by 1% every check and increase the Gain P parameter by 0.1 until the altitude angle meets zero. If theslope angle of quadcopter is greater than 30 degree the throttle will decrease by 1% every check and also increase the Gain P parameter by 0.1 until the altitude angle reaches zero. LabVIEW Acquire Parameter from MAVLink Arm Quadcopter Increase Throttle and Gain P Parameter Decrease Throttle YES UAV Greater than 30 degree NO Attitude Angle is Zero NO Increase Gain P Parameter YES Release Throttle and Update the Parameters Fig. 5: Flow chart of self-tuning by LabVIEW If the altitude angle reaches zero for 15 secs the VI will release the throttle and update the new parameters to the MAVLink and the auto tuning will end. The UI of proposed VI was shown in Fig. 6. The pseudocode of algorithm is shown as following: Input: ϕk_p θk _p ψk _p Initialize scan(p)= default value if setting lower bound < default lower bound then setting lower bound = default lower bound else lower bound = setting lower bound end if 106

5 Altitude (radians) Atitude (radians) Chiao-Tzu Huang /ECBA--2015/Full Paper Proceeding Vol No-24 Issue if ϕθψ= 0 for 15sec. then throttle = 0 else while height > 30 throttle 50% if ϕθ< 30 then throttle 1% ϕk_p θk _p 0.1 else throttle --1% end if if ψ> 50 then ψgain P 0.1 end if end while mend if \ Fig. 6: The self-tuning UI of VI Results Compare Fig. 7. with Fig. 8. the tuning was very difficult and extremely not stable.the altitude angle should close to zero it will make the UAV stable in landing taking off and flight the Fig. 8. showed the simulated result whichindicated those curves closed to zero were much stable than Fig. 7. Updated the parameters in the Mission Planner and implemented in the simulator the result was shown in Fig. 9. It was obviously that roll (red line) and pitch (blue line) were stable enough and ready for flight Response to Step Reference w ith Different Values of Kp 1.4 Response to a Step Disturbance w ith Different Values of Kp Time (seconds) Time (seconds) Fig. 7: The Result for Manual Tuning Fig 8: The Simulated GUI Auto Tuning Resilt 107

6 Fig. 9: Implement in Mission Planner Discussion & Conclusion The VI is easy to set it is also faster and safer than manual tuning. It will be able to apply this VI to most of the quadcopters for tuning the parameters and it would shorten lots of time on tuning than manual were the best part of the proposed self-tuning VI in this paper. We are working on extending this VI for tuning all the 18 parameters in flying not just three for taking off. Acknowledgements Thank to National Chin Yi University of Technology research fund support for this conference paper. References Euler L. N. (1764). Commentarii academiaescientiarum Petropolitanae. Magdi S. Mahmoud Y. Xia. (2012). Applied control systems design. Suraj C. S. (2013). Design of multicopter test bench. Szafranski G. & Czyba R. (2011). Different approaches of PID control UAV type quadrotor. Atheer L. & Salih F. (2010). PID controller design for a UAV quadrotor. Vitul V. (2014). PID based stabilization of gesture controlled drones using HIL Simulation. 108