1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Sem stauffer FPGA stands for Field Programmable Gate Arrays

77 21 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 77
Dung lượng 1,87 MB

Nội dung

Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays Sem stauffer FPGA stands for Field Programmable Gate Arrays

Yves Stauffer Semester Project EPFL - ASL 8th semester project summary (12 hours/week) June 2004 11 June 2004 Analog PID module Yves Stauffer, Microengineering Assistant 1: Samir Bouabdallah Assistant : Daniel Burnier Professor: Roland Siegwart Flying robots are an increasing center of interest In order to achieve success in this novel domain control has to be perfectly mastered In this context the ASL wanted to develop a fully analog motor PID (Proportional Integral Derivative) controller Initially FPAA was supposed to be used, but it turned out that this fairly recent technology was not yet ready for such challenging tasks The chosen design is composed of two independent modules Command module: Is receiving a digital (I2C) speed command and outputs an analog equivalent speed command This module also provides a stable ± 12V power source from 5V There is a triangle wave generator that will be used later to create the PWM Finally, it is able to drive four different PID modules PID module: Is performing the PID control, the PWM generation and the motor powering Then it also reads and filters the motor’s speed Note that the two modules have been built in a way that all the values (Kp,i,d, the filter gain, …) can be changed and tuned easily Furthermore there is a possibility to work in open-loop as well And one can also operate the H-bridge (used to drive the motor) in two different modes In one mode the possibility of reversing the motor’s direction of rotation is disabled (i.e only breaking) Analog PID module Tests: Both modules were tested thouroughly before a fully operational closed loop PID control was done Figure : open (left) and closed loop response (right) The left part of figure is the open-loop response The motor is commanded to go from rpm to 3500 rpm The step signal is the command and the curve is the motors speed converted in equivalent voltage Observe the steady state error The right part of figure is the same experiment performed in closed loop with “optimal” PID values Observe that the steady-state goes to zero, however the rise time is slightly the same Simulations of both cases were done, and exactly the same curves were obtained Thus the command module and PID module are working correctly Conclusion: It was shown that building and using a fully analog PID controller was feasible Further investigations could lead to an upgrade to FPAA technology Yves Stauffer Analog PID module Semester Project June 2004 Yves Stauffer Semester Project June 2004 Table of content INTRODUCTION 1.1 My project 1.2 How this report is organized 1.3 PID control : short overview 1.4 FPAA? THE DESIGN 11 2.1 Goals 11 2.2 PID and FPAA? 11 2.3 The chosen solution 12 2.4 Advantages of this solution 14 2.5 Other possible solutions 14 THE CENTRAL MODULE: THEORY 15 3.1 5V -> ± 12V 15 3.2 DAC 15 3.3 Triangle wave 16 3.4 Voltage follower 18 3.5 Summary of the used components 19 THE PID MODULE: THEORY 21 4.1 Error = command – feedback 21 4.2 PID 21 4.3 Inverter 23 4.4 PWM 23 4.5 H-Bridge 25 4.6 Motor 26 4.7 Speed encoder 26 4.8 Frequency doubling 27 4.9 Frequency to voltage 27 4.10 Butterworth filter 29 Analog PID module Yves Stauffer Semester Project June 2004 4.11 Open loop control 30 4.12 Fuse 31 4.13 Summary of the used components 31 DESIGNING THE CONTROLLER (KP,I,D) 33 5.1 Simulation model for matlab 33 5.2 Creating the simulink function 34 5.3 Interfacing with Simulink 34 5.4 Complete simulink model 34 5.5 Steady state transfer function (open loop) 35 5.6 Steady state transfer function (closed loop) 36 5.7 Conversion table 37 5.7.1 Closed-loop 37 5.7.2 Open-loop 38 CENTRAL MODULE: TESTS 39 6.1 -> ± 12V 39 6.2 DAC 39 6.2.1 Using a Hirschman board 39 6.2.2 On the PCB 39 6.3 Triangle wave 40 6.4 Consumption 41 PID MODULE : TESTS 43 7.1 Error = command - feedback 43 7.2 PID 43 7.3 PWM 43 7.4 H-bridge 44 7.5 Motor 45 7.6 Speed encoder 45 7.7 Frequency doubler 46 7.8 Frequency to voltage 47 7.8.1 Using a Hirschman board 47 7.8.2 On the PCB 48 7.9 Butterworth filter 50 7.9.1 Using a Hirschman board 50 7.9.2 On the PCB 51 Analog PID module Yves Stauffer Semester Project June 2004 7.10 Consumption 52 OPEN LOOP (WITHOUT PID) 53 CLOSED LOOP: KP ONLY 55 9.1 error = command – speed (Kp = 1) 55 9.2 Kp = 56 10 CLOSED LOOP WITH PID 59 10.1 Non optimal PID values 59 10.2 Better values from Simulink 60 10.3 Overshoot 61 10.3.1 Reverse disabled 61 10.3.2 Reverse enabled 62 10.4 Optimal PID values 64 10.5 Tachymeter test 64 11 CONCLUSION 67 11.1 General conclusion 67 11.2 Are the goals met? 67 11.3 What can be improved 67 11.4 Special thanks to 68 12 BIBLIOGRAPHY 68 13 ANNEXES 69 13.1 Protel schematics 69 13.1.1 Original Central PCB 69 13.1.2 New Central PCB 69 13.1.3 Original PID PCB 69 13.1.4 New PID PCB 69 13.2 ACORT files 69 13.2.1 Central PCB files 69 13.2.2 PID PCB files 69 13.3 Relevant data sheets (extracts) 69 13.3.1 DAC: MAX 520 69 13.3.2 H-Bridge: A 3949 69 13.3.3 Frequency to Voltage converter: LM 2907 69 13.3.4 Motor 69 13.3.5 Speed encoder 69 13.3.6 Reductor 69 13.4 Mathematica code 71 Analog PID module Yves Stauffer Semester Project June 2004 13.5 PCB pictures 71 13.5.1 Central PCB front 71 13.5.2 Central PCB back 73 13.5.3 PID PCB front 75 13.5.4) PID PCB back 77 Analog PID module Yves Stauffer Semester Project June 2004 Introduction Over the past decade flying robots have been an increasing field of studies At EPFL (Ecole Polytechnique Fédérale de Lausanne) and more specifically ASL (Autonomous System Lab) this field is being tackled by several people Two main projects are currently going on The first one is Adaptive Vision-based Flying Robots, which includes the blimp and slow flyers The second is VTOL (Vertical Take-off and Landing), which includes the “flying Alice” and OS4 (Omnidirectional Stationary Flying OUtstretched Robot, see figure 1) Figure : OS4 Flying robots are challenging on several levels, the two most important aspects being lightness and control The latter is even more critical for helicopter like robots such as the OS4 because of the natural instability of the helicopter 1.1 My project One has to be aware that « control » is the key to most technologies While robots need to have it implemented in hardware (or software), the human brain does it « by itself » Indeed, when one is driving and has to turn right, the way one turns the steering wheel will be different if the curve is important or not as it will be different if one is driving at 50km/h or 120km/h on a highway Several kinds of controllers exist, P (for Proportional), I (for Integral) and D (for Derivative) and its combination (PI, PD, …) The most commonly used controller is PID For more theoretical explanations please refer to section 1.3: “ PID control: short overview” The ASL has developed a standard PID module, which is used in various (even not flying) robots The core of this module is based around a PIC microprocessor It is important to know that at the beginning all controllers were implemented in hardware using OA (Operational Amplifiers) Unfortunately this didn’t allow an “on the fly” reconfiguration, in other words, once the values for Kp,i,d were set they could only be changed by switching the values of capacitors or resistors Recently FPAA (Field Programmable Arrays) allowed to control dynamically (in some cases) values of capacitors and/or resistors and thus change Kp,i,d without having to desolder anything Of course this is of great interest for applications that require a fast response time as well as a zero failure rate, this is why ASL proposed as a semester project to develop a PID controller based on this new and promising FPAA technology Analog PID module Yves Stauffer Semester Project June 2004 1.2 How this report is organized Chapter 1: Introduction Chapter 2: The chosen design Chapter 3: Theory on the central PCB (Printed Circuit Board), the one with the DAC Chapter 4: Theory on the PID PCB Chapter 5: Designing the controller, getting the values for Kp,i,d Chapter 6: Test of the central PCB Chapter 7: Test of the PID PCB Chapter 8: Open-loop tests Chapter 9: Closed-loop tests with Kp only Chapter 10: Closed-loop tests with PID Chapter 11: Conclusion Chapter 12: Bibliography Chapter 13: Annexes 1.3 PID control : short overview Doing a complete course on controllers is beyond the scope of this report If needed the reader can report to [1] Control Systems by Niese or [2] Feedback Control Systems by Phillips and Harbor In most problems we are given a Plant (motor for instance coupled with gears, etc) and have to determine what controller has to be chosen in order to meet the goals (settling time, overshoot, rise time, …) A common closed loop system is depicted on figure 1.3a The following vocabulary is needed: System input: user selected value that determines the output (i.e speed) Error: is the input minus the actual value of the considered variable Manipulated variable: output of the controller System output: output of the considered system (i.e shaft speed) Sensor: device that measures the output Manipulated variable System input Error Controller Plant System output + Sensor Figure 1.3a : typical closed loop controller Note: open loop theory won’t be considered in this chapter It is a trivial case where the command is directly connected to the plant and no feedback is provided However this function has been implemented on the hardware design as well Analog PID module Yves Stauffer Semester Project June 2004 In a common design the only “variable” is the controller (the plant and the sensors are usually given) Fortunately a great variety of controllers has been developed and each case is suited for a different one Just to name a few: lag, lead, lag-lead, P, I, D and all the possible combinations of P,I and D As a matter of fact the most used controller is called PID (Proportional, Integral and Derivative) This is the case because it regroups the advantage of P, I and D controllers By setting the right values to Kp, Ki and Kd one can achieve a good response Refer to figure 1.3b for more information K p ⋅ error (t ) Error(t) K i ⋅ ∫ error (t )dt Kd ⋅ Manipulated variable + d error (t ) dt Figure 1.3.b : PID controller Recall that: Kp: compares output with system input Ki: eliminates the steady state offset Kd: anticipates changes by using the derivative, prevents the error of getting too big 1.4 FPAA? FPGA stands for Field Programmable Gate Arrays and are the digital counter part of Field Programmable Analogue Arrays While the former is already a well established and used technology the latter is fairly young As a matter of fact no one used the analog capabilities of these circuits at EPFL Several companies are providing different FPAA chips The ones considered were Anadigm, Lattice and Cypress Explaining how an FPAA works is beyond the scope of this report One simply has to recall the general idea Most FPAA contain a certain number of building blocks, usually made of operational amplifiers (OA), and switched capacitors (i.e capacitors which can change their value) The user can play on several levels: first the inputs and outputs can be selected, second the connectivity between the different OA can be changed, third the value of the capacitors On figure 1.4a one has an overview of Anadigm’s chips, on the left one can observe the inputs Figure 1.4b focuses on the CAB (Configurable Analog Bloc), which can be viewed as building blocks, note the presence of amplifiers and switched capacitors Analog PID module Yves Stauffer Semester Project June 2004 Companies such as Anadigm provide a user friendly design tool which does the linking between the OA and allows a pretty fast evolution Cypress on the other hand asks the user to “root” the layout manually, which offers more flexibility but also requires more knowledge and time Figure 1.4a : Anadigm’s FPAA chip Figure 1.4b : CAB Analog PID module 10 Yves Stauffer Semester Project June 2004 Figure 10.3.2a : closed loop response (PID enabled) Note that if reverse is disabled the distance between the peak overshoot and the part where the speed goes up again is slightly bigger as in the case where reverse is enabled This is what we expected Analog PID module 63 Yves Stauffer Semester Project June 2004 10.4 Optimal PID values By chosing R1 =100000 Ω, R2 = 1200000Ω, C1 = 830pF and C2 = 220nF on gets: Kp =12, Ki = 42, Kd = 0.001 Under these conditions the motor was asked to go from 0rpm to a speed corresponding to a DAC value of 220 Figure 10.4a : closed loop response (PID enabled) Observe that as expected increasing Ki helps to get a faster setting time However in this case the simulation indicates an overshoot whereas tests clearly indicate that there is none We believe that this is due to the fact that our simulation model is quite simple and maybe doesn’t take into account all the parameters and is thus not able to deal with so “aggressive” PID values 10.5 Tachymeter test In order to prove that the motor was turning at the requested speed further tests were done using an infrared tachymeter The following table summarizes the read values Note that the calculated rpm has to be multiplied by 2, because there are two blades on the propeller And there is also a reduction of 3.71 between the motor and the propeller DAC 60 80 100 120 140 160 180 200 220 read propeller rpm 546 736 930 1113 1296 1487 1683 1874 2072 simulink propeller rpm 582.00 782.00 977.00 1173.00 1369.00 1564.00 1760.00 1956.00 2152.00 error % 6.19 5.88 4.81 5.12 5.33 4.92 4.38 4.19 3.72 One can observe that for low speeds the error gets worse, but is constant otherwise Refer to figure 10.5a for a better representation Analog PID module 64 Yves Stauffer Semester Project June 2004 2500 2000 read propeller rpm rpm 1500 simulink propeller rpm 1000 500 80 10 12 14 16 18 20 60 DA C DAC [dec] Figure 10.5a: theoretical and measured rpm Since the helicopter only works at high speed these errors should not be an issue, also maybe the tachymeter was not well calibrated One can also use the following transfer function to get the output speed given a certain DAC value RPM motor = dec _ value ⋅ Vref ⋅ 60 255 ⋅ R1 ⋅ C1 ⋅ N ⋅ Vsup Where: Vref is the DAC reference voltage C1 and R1 are given by the FTV converter N is the number of increments of the speed sensor Dec_value is the decimal value that is sent to the DAC Then converting from motor rpm to propeller rpm simply means dividing the former by 3.71 Pay attention to the fact that there are two blades The following table is obtained if the above equation is used DAC 60 80 100 120 140 160 180 200 220 Analog PID module calculated propeller rpm 572 762 953 1143 1334 1524 1715 1905 2096 read propeller rpm 546 736 930 1113 1296 1487 1683 1874 2072 error % 4.7 3.6 2.4 2.7 2.9 2.5 1.9 1.7 1.2 65 Yves Stauffer Semester Project June 2004 Plotting it gives figure 10.5b 2500 2000 calculated propeller rpm rpm 1500 read propeller rpm 1000 500 80 10 12 14 16 18 20 60 DA C DAC [dec] Figure 10.5b: theoretical and measured rpm In conclusion, the transfer function can be used to calculate the final closed loop speed, it will however assume that the motor will turn at the commanded speed Or simulink can be used, in this case the motor dynamics are better modelled In both cases the calculated value is slightly above the practical one However in the operation range this error is constant and quite small Analog PID module 66 Yves Stauffer Semester Project June 2004 11 Conclusion 11.1 General conclusion One of the first times I met Samir I asked him: “What is hard about this project?” Obviously my ideas on hardware and control were mainly theoretic It turned out that developing a fully operational PID module was quite a delicate task To prove this one simply needs to look at what my PCBs look like after some heavy bonding was done However we achieved to obtain a fully analog module, that is commanded as if it was a digital module, which regulates the speed as expected It was thus shown that building an analog speed controller was feasible and that it could be suited for standard applications Further more we have the feeling that further investigations should be done which could lead to a new standard PID controller module In order to illustrate that the given module is working it was used to optimise the response time of a motor that is comparable to the one available one the OS4, and it worked well On a personal level I have gained valuable knowledge mostly in the analog and automotive field I also learned to use Protel and familiarized myself with the process of getting a PCB done Yves Stauffer 11.2 Are the goals met? Section 2.1 gave guidelines for this project How close are the obtained modules to the desired specifications? 1) The response time is as fast as analog can provide, the FTV being the limiting part 2) Lightness and volume can be quite reduced; the used version is heavy mainly because lot’s of debugging had to be done 3) On the central PCB only two outputs are available, however adding two more is easy 4) The communication protocols are respected 5) The H-bridge can deliver up to 2A and can work with voltages as low as 6.2V 6) The controller gains can’t be changed dynamically of course, but jumpers allow a quite fast tuning 7) The resolution is mainly limited by the DAC and FTV noise levels, theoretically the achievable resolution is around 40mV, which corresponds to 35 rpm (referenced to the motor’s output) increments Immeasurable with the available equipment One can see that the goals are met 11.3 What can be improved The main problem is the lack of direction of rotation sensor This is especially dramatic since the real motor was not used for the tests And because of the small offset in the FTV conversion the error signal was different from zero even though the command signal and speed was zero This resulted in highly unstable behaviour Finally, if wanted a new semester project can be proposed where my design could be upgraded to an FPAA PID Analog PID module 67 Yves Stauffer Semester Project June 2004 11.4 Special thanks to Samir Bouabdallah: for proposing this project, his design advices and availability Daniel Burnier: for hardware advices, soldering help and debugging Gorges Vaucher: for thePCB rooting and overall patience Jacques Fournier: for his filter analysis Andre Decurnex: for his advices on OA Andre Noth: for the modelling part Roland Siegwart: for accepting this challenging project Allegro, TI and Maxim for the samples 12 Bibliography [1] Niese, control systems engineering, 2000 [2] Phillips and Harbor, Feedback Control Systems, 2000 [3] Andre Noth, Synthese et Implementation d’un Controleur pour Micro Helicoptere a Rotors, 2004 Analog PID module 68 Yves Stauffer Semester Project June 2004 13 Annexes 13.1 Protel schematics 13.1.1 Original Central PCB 13.1.2 New Central PCB 13.1.3 Original PID PCB 13.1.4 New PID PCB 13.2 ACORT files 13.2.1 Central PCB files 13.2.2 PID PCB files 13.3 Relevant data sheets (extracts) 13.3.1 DAC: MAX 520 13.3.2 H-Bridge: A 3949 13.3.3 Frequency to Voltage converter: LM 2907 13.3.4 Motor 13.3.5 Speed encoder 13.3.6 Reductor Note: in order to spare paper annexes 13.1 to 13.3 are regrouped in one block Analog PID module 69 Yves Stauffer Analog PID module Semester Project June 2004 70 Yves Stauffer Semester Project June 2004 13.4 Mathematica code Solve[{(R2/R1 +C1/C2) m 5, (1/(R1*C2)) == 10, R2*C1 ==0.001, R1 == 100000},{ R1, R2, C1, C2}] //KpKiKd 13.5 PCB pictures 13.5.1 Central PCB front Figure 13.5.1: central PCB front view Analog PID module 71 Yves Stauffer Analog PID module Semester Project June 2004 72 Yves Stauffer Semester Project June 2004 13.5.2 Central PCB back Figure 13.5.2: central PCB back view Analog PID module 73 Yves Stauffer Analog PID module Semester Project June 2004 74 Yves Stauffer Semester Project June 2004 13.5.3 PID PCB front Figure 13.5.3: PID PCB front view Analog PID module 75 Yves Stauffer Analog PID module Semester Project June 2004 76 Yves Stauffer Semester Project June 2004 13.5.4) PID PCB back Figure 13.5.4: PID PCB back view Analog PID module 77 ...Yves Stauffer Analog PID module Semester Project June 2004 Yves Stauffer Semester Project June 2004 Table of content INTRODUCTION ... was the only available OA in the lab Analog PID module 19 Yves Stauffer Analog PID module Semester Project June 2004 20 Yves Stauffer Semester Project June 2004 The PID module: theory This section... “chosen” component should be changed Analog PID module 41 Yves Stauffer Analog PID module Semester Project June 2004 42 Yves Stauffer Semester Project June 2004 PID module : tests In the following

Ngày đăng: 19/01/2022, 10:02

TỪ KHÓA LIÊN QUAN