• Tidak ada hasil yang ditemukan

Design and Implementation of Spartan 6 Series FPGA Board and Application of PID Controller for Robots

N/A
N/A
Protected

Academic year: 2024

Membagikan "Design and Implementation of Spartan 6 Series FPGA Board and Application of PID Controller for Robots"

Copied!
6
0
0

Teks penuh

(1)

________________________________________________________________________________________________

Design and Implementation of Spartan 6 Series FPGA Board and Application of PID Controller for Robots

1Ramya.C.B, 2Chethan.C.M, 3Praveen.S.G, 4Rakshith S RNS Institute of Technology, Bangalore-560061

Email: 1[email protected], 2[email protected], 3[email protected], 4[email protected]

Abstract--The Spartan-6 family of Field- Programmable Gate Arrays is one of the latest devices and specifically designed to meet the needs of high volume, cost-sensitive consumer electronic applications. The thirteen-member family offers densities ranging from 3,840 to 147,443 logic cells, system gates. The Spartan-6 family builds on the success of the earlier Spartan-IIE family by increasing the amount of logic resources, the capacity of internal RAM, the total number of I/O’s, and the overall level of performance as well as by improving clock management functions. Numerous enhancements derive from the Vertex- II platform technology. These Spartan-3 FPGA enhancements, combined with advanced process technology, deliver more functionality and bandwidth per dollar than was previously possible, settng new standards in the programmable logic industry. Design and implementation of Spartan-6 series FPGA board is envisaged in the proposed work. The design of the proposed Card is being undertaken as a replacement for Spantan-3 Card currently used in Electronic Jacquard.

The Card would feature LX9, 16 or 25 FPGA with a gate count of about 500,000; LED displays, Push button/Slide switch inputs, LEDs, UART, On-board SRAM, Flash memory, RS232 and 96 User programmable Inputs/Outputs.

Keywords: Field Programmable Gate Array (FPGA), Spartan-6 family, LX9, 16 or 25 FPGA, Applications and PID controller, RS232.

I. INTRODUCTION

Spartan 3 series FPGAs is being phased out by Xilinx. Therefore, we need to have an alternative that retains many of the features available on the present Spartan 3 board that is used in some of the projects in SJB Research Foundation Labs. The proposed project fulfils this requirement. The Design work involves circuit design and testing it on proto board, and fabrication of PCB, assembly of FPGA and other components, write Verilog codes and finally test the FPGA board. Spartan-6 FPGAs are ideally suited for a wide range of consumer-industrial electronics applications including bio-medical equipments, weaving machine controls, video codec’s, broadband access, home networking, display/projection and digital television equipment, some of which are being developed in-house. The Spartan-6 family is a superior alternative to mask programmed ASICs. FPGAs

avoid the high initial cost, the lengthy development cycles, and the inherent inflexibility of conventional ASICs. Also, FPGA programmability permits design upgrades in the field with no hardware replacement necessary, an impossibility with ASICs. Spartan 6 series FPGAs are one of the latest devices that can replace the Spartan 3 devices that are slowly getting obsolete.

II. BLOCK DIAGRAM OF SPARTAN 6 FPGA

Spartan-6 family provides leading system integration capabilities with the lowest total cost for high-volume applications. The thirteen-member family delivers expanded densities ranging from 3,840 to 147,443 logic cells, with half the power consumption of previous Spartan families, and faster, more comprehensive connectivity. Built on a mature 45 nm low-power copper process technology that delivers the optimal balance of cost, power, and performance, the Spartan-6 family offers a new, more efficient, dual-register 6-input lookup table (LUT) logic and a rich selection of built-in system-level blocks. These include 18 Kb (2 x 9 Kb) block RAMs, SDRAM memory controllers, enhanced mixed-mode clock management blocks, etc. These features provide a low cost programmable alternative to custom ASIC products with unprecedented ease of use. Spartan-6

FPGAs offer the best solution for high-volume logic designs, consumer-oriented DSP designs, and cost- sensitive embedded applications. Fig 2.1 Block Diagram of Spartan 6 Series FPGA Board Spartan-6

FPGAs are the programmable silicon foundation for Targeted Design Platforms that deliver integrated software and hardware that enable designers to focus on innovation as soon as their development cycle begins.

A block diagram of the proposed FPGA Board, whose features were summarized in Objectives earlier, is presented in the following. The core of the board is an FPGA (1), which can be either LX9 or LX16 or LX25 depending upon the chip capacity required by the User suited for an application. Spartan-6 FPGAs store the customized configuration data in SRAM-type internal latches. The number of configuration bits is between 3 Mb and 33 Mb

(2)

________________________________________________________________________________________________

depending on device size and user-design implementation options. The configuration storage is volatile and must be reloaded whenever the FPGA is powered up.

Fig 2.1

This storage can also be reloaded at any time by Flash ROM Platform Flash. The JTAG pins use boundary-scan protocols to load the bit-serial configuration data. The bit stream configuration information is generated by the Xilinx Design Suite software using a program called Bit Gen. The configuration process typically executes the following sequence:

• Detects power-up (power-on reset).

• Clears the whole configuration memory.

• Samples the mode pins to determine the configuration mode : master or slave, bit-serial or parallel.

• Loads the configuration data starting with the bus- width detection pattern followed by a synchronization word, checks for the proper device code, and ends with a cyclic redundancy check (CRC) of the complete bit stream.

The Spartan-6 FPGA configures itself from a directly attached industry-standard SPI serial flash PROM.

Hardware used:

Rs-232 connector, Power LED’S, Power regulators, 7 segment display, 8 slide switches, JTAG connectors Software:

ModelSim PE 10.2, Design Suite 13.4 of Xilinx,

Xilinx's IMPACT.

III. APPLICATIONS

Spartan 6 involves in many applications such as in electronic devices, defence, aerospace, motor development and many more it is everywhere in electronic devices it has thousands of applications. The FPGA application controls which configuration to load next and when to load it. Spartan-6 FPGAs also include a unique, factory-programmed Device DNA identifier that is useful for tracking purposes, anti-cloning designs, or IP protection. In the largest devices, bit streams can be copy protected using AES encryption. One of the specific application of this FPGA is PID controller which is very much required for robotic application.

IV. PID CLOSED LOOP CONTROL FOR ROBOTICS

PID (Proportional, Integral and Derivative) control laws will give you more control over your robot’s performance. While the most immediate robot applications would probably be for steering and speed control, the techniques can be applied to any kinds of motion. There are two basic types of control we can use:

dead reckoning, in which we estimate the commands necessary to achieve a goal, such as applying 45% PWM to go forward at 6 inches per second and hope that the robot will travel at this speed; or we can monitor the results of the robot’s action and correct the commands to ensure that the goal is achieved. The more time the robot is correcting its performance rather than just charging ahead, the more accurate performance you’re going to get. PID control systems provide continuous control. Hence, whenever we can operate under PID control, the performance will be much more reliable.

The goal should be to operate under PID type control as much as possible and to save dead reckoning for only those times when there isn’t adequate sensor information available to do PID.Control systems- There are two basic types of control systems. Open- loop control systems are those in which your controller tells your system to do something, but doesn’t use the result of that action to verify the results or modify the commands to see that the job is done properly. Closed- loop control continuously monitors the performance of your system and changes the commands as necessary to stay on track. Open-loop control- Examples of open-loop control might be sending a PWM signal to your drive motor which you know will normally cause it to go forward at 6 inches per second, but not measuring the actual speed and therefore not knowing that the robot ran into a chair, or is climbing a slope, and isn’t really managing to go 6 inches per second. So you tell the robot to go forward for 10 seconds then turn right, expecting it to go 5 feet and enter a doorway. But it doesn’t make 5 feet and crashes into the wall. Or telling the robot to go straight forward for a distance by setting the steering position to center, and the robot

(3)

slowly veers off to the side and crashes into the wall again.

Fig 4.1

The above block diagram shows the components of an open-loop control system. The “input reference” is the signal sent to the controller saying, perhaps, proceed forward at 6 inches per second. The “controller” block represents the calculations done to control some servo or motor or something on the robot. “Plant” is a control systems term that means everything that is affected by the controller. This may include a servo motor, the steering system of the robot and the motion of the robot in response to the steering and even the resulting position of the robot in its world. The “controlled variable” is whatever part of the plant your input reference is trying to control to. It can be the servo position, the steering angles or the position in the world.

On a robot, the input reference, the controller function and parts of the plant may all be done by your microcontroller. From the earlier example, the input reference might be a command to go 6 inches/second, and the controlled variable can be the actual speed achieved which may, or may not be 6 inches/second.

Open-loop control is what dead reckoning is all about.

Unfortunately, no matter how carefully we calibrate our motor and steering and other actuation devices of the robot such that the input reference should provide the desired result, there will always be errors which will cause the result to be different than what was planned.

And since errors are usually cumulative over time, the longer you run in dead reckoning mode, the farther you’ll be from what you planned. But, if open loop operations are short enough (and nothing keeps the robot from operating normally, like a chair), open loop control may provide adequate performance for many tasks.

Closed-loop control- Closed-loop control starts out like open-loop in that you send an input reference to the system, but then feedback is used to monitor the performance resulting from the command; and if the performance is different than desired, changes are made to the command to get back on track. This is done by comparing the input reference to the feedback signal and computing an error from the reference. The controller then has equations which adjust the commands to the plant to reduce the error.

Fig 4.2

Closed loop control is often approximated by doing long dead reckoning actions, then stopping and looking around, or finding a wall or corner in a known location, and using that reference to figure out how to get back on track. True closed loop control is continuously checking on performance (location, speed, whatever) so that the robot never gets significantly off track. For instance, to do wall following, the distance to the wall would be measured continuously and the steering adjusted continuously to maintain that distance.

Or, in the speed control example above, if the reference speed is 6 inches per second, and the feedback signal indicates the robot is only moving at 5 ½ inches per second, the controller would see the error signal and increase the power to the motor. To pick an example we can all identify with, steering a real car along a road is like a wall or line following exercise. You are fairly continuously changing the steering to keep the car centred in the lane. Imagine steering by aiming the car then closing your eyes and only opening them for a quick glimpse every 5 seconds or so to make a correction. It’s not only difficult, it’s scary. Because you’re afraid you might run into something during your dead reckoning phase. Same thing for a robot. There are two aspects to this continuous control: one is the word continuous, and the second is the equations to do the control. “Continuous” really only exists in an analog world. Most of us are doing our robot control with digital computers, which can only calculate a command after some time period. But if you calculate the output often enough, it’s close enough to continuous to give the same effect. For example, my current robot computes its steering commands 20 times a second. Effectively, it’s doing 1/20 of a second of dead reckoning followed by a control command update. Fortunately, it’s hard to get in much trouble dead reckoning for 1/20 of a second. A sophisticated set of control equations will have many functions which are dependent on the rate at which they are calculated. For example: integrators, derivatives and filters are all time dependent. For this reason, it is necessary to have a software program (or at least part of the program) which executes at the desired repetition rate. This takes some type of a real-time operating system. This doesn’t have to be something you buy, or even something complicated. It can be done by polling (executing your software every time a timer says the desired time has come), or by a real time

(4)

________________________________________________________________________________________________

interrupt which automatically runs your software when the time comes. The interrupt is more flexible as you can have the software which is required to execute at a specific rate run when the interrupt occurs; and run other, non-time critical software in the background.

Either of the two schemes above will do the job.

Effectively what you are doing is implementing a multi-tasking system. Each time the real time software is called, a small slice of many jobs may be performed.

You may be controlling motor speed, controlling steering, controlling sonar and several other things, all at 20 times a second. You will find that writing software where subroutines are entered repetitively to do a single job is a little different than usual. For example, when a job is first started, it may be necessary to initialize the equations. But, not to initialize them on subsequent entries. This may require other higher level software to set a flag indicating first pass (which the subroutine can reset after doing the initialization) or for the higher level software itself to do the initialization.

PID equations come out a branch of mathematics/engineering called “feedback and control theory”. The study of this is highly mathematical and gets really into differential equations, LaPlace transforms, Nyquist, Root-Locus and Bode analysis and other wonderful things. This entire math is necessary to achieve optimal performance with good system stability.

However, I believe that for most simple systems (and most of our systems are simple), a good understanding of what the three equations (P, I and D) do will allow you to hack an adequate solution by trial and error.

PID stands for Proportional, Integral, and Derivative.

These are three basic calculations that can be used to control a system. You may find you can use just one, two or three to do a job.

Proportional control:

The first and most basic part is the P, for proportional control. This entire means is that if you have a reference you are trying to control to, you provide a control output proportional to the error from your reference.

Fig 4.3

(Note: K is commonly used to represent such gain factors, and is usually given with a subscript indicating which gain is meant. E.g. Ksteering ). As a standard robot example (assuming a front wheel steering robot), if you are trying to follow a wall using a sensor that can measure the distance to the wall (e.g. sonar), you would turn your steering system to return you to the reference. If you are 2 inches to the right, you might

turn your steering 4 degrees to the left. If 4 inches to the right, then turn the steering 8 degrees to the left. That is the proportional part. A block diagram of this operation might look like:

Fig 4.4

The drawing indicates that the reference distance (the distance from the wall that you want the robot to stay at) is subtracted from the sonar distance. This gives you an error signal showing the distance from where you want to be in inches (or feet or whatever you want). The “O”

where the two signals come together is called a summation point. The “+” indicates that the reference signal is added; and the “-“ means that the sonar sensor is subtracted to get the error signal. That is:

Error = reference distance – sonar distance.

The steering gain block represents just a multiplier to get the desired amount of steering per inch of error. The whole thing can be written as:

Steering angle command = Ksteering * (reference distance – sonar distance) So what this equation does is to steer the robot back toward the reference distance. Sounds like a good idea, but in reality, this isn’t enough. What will happen if we try to steer this way? If the robot starts out dead center on the reference, it will continue to roll straight ahead. Very good, except in the real world, it won’t stay exactly on center. It will get off a bit to one side or the other. When it does it will turn back toward the reference; and will continue to keep turning until it gets back to the reference. And while the amount of steering gets smaller as it approaches the reference, it’s still turning in the same direction. So when it gets back to the reference, it’s now pointed in a direction to deviate onto the other side. As it goes out the other side, it will cause steering commands to turn back again, but it will just lead to the same problem of overshooting onto the original side. If you make your gain fairly high, to get fast accurate performance, this simple proportional control law will probably be unstable causing the robot to go back and forth from side to side following a path similar to a sinusoid. Now if you make your gains low enough, it may be that the robot will stay “close” to the reference.

But in reality the robot will be continuously dithering back and forth from one side to the other. It may be a

(5)

small acceptable amount of dither. The trade-off would be that with low gains, your robot will probably be slow to return to the reference if errors occur, and may even go unstable with large deviations. (Actually, as it was dithering back and forth, it never was really stable anyway.) Later in this paper, there will be a computer simulation of a robot steering system where you can see this performance.

V. CONCLUSION

A digital PID controller implemented in FPGA technology is a configurable controller in terms of latency, resolution and parallelism. The speed or execution or latency of the controller can be precisely controlled with the amount of reuse of arithmetic elements such as the speed of execution of FPGA based PID controller can be less than 100 ns if desired for high throughput requirements.

Implementing PID controllers on FPGAs features speed, accuracy, power, compactness, and cost improvement over other digital implementation techniques. In a future fork we plan to investigate implementation of fuzzy logic controllers on FPGAs. Also we plan to explore embedded soft processors, such as MicroBlaze, and study some applications in which design partitioning between software and hardware provides better implementations. Today’s high-speed and high-density FPGAs provide viable design alternatives to ASIC and microprocessor based implementations. Several building modules for implementing PID controllers on these FPGAs are constructed in this work. These modules are tested successfully through two experimental platforms. Algorithms and implementations are described in sufficient details from a practical point of view for readers to digest the addressed subject and replicate the work. The VHDL code of all presented modules and examples may be obtained directly from the author. Implementing PID controllers on FPGAs features speed, accuracy, power, compactness, and cost improvement over other digital implementation techniques.

REFERENCES

[1] G. Martin and H. Chang, “System-on-Chip design”, Proceedings of the 4th international Conference on ASIC, Oct. 2001, pp. 12-17.

[2] Anthony Cataldo, “Low-priced FPGA options set to expand” Electronic Engineering Times Journal, N 1361, PP 38-45, USA 2005.

[3] Xilinx,“Spartan-

3FPGAFamily:CompleteDataSheet”2004.

http://www.xilinx.com/bvdocs/publications/ds09 9.pdf

[4]

Digilent,Inc.,“DigilentSpartan3System.\,Board”,J une,

2004.http://www.digilentinc.com/Data/Products/

S3B OARD/S3BOARD-brochure.pdf

[5] Gordon Hands, “Optimised FPGAs vs dedicated DSPs”, Electronic Product Design Journal, V 25, N

12, UK December 2004. 17

[6] R. Jastrzebski, A. Napieralski,O. Pyrhonen, H.

Saren, “Implementation and simulation of fast inverter control algorithms with the use of FPGA circuit”, 2003 NanotechnologyConference and Trade Show, pp 238-241, Nanotech 2003.

[7] Lin, F.S.; Chen, J.F.; Liang, T.J.; Lin, R.L.; Kuo, Y.C. “Design and implementation of FPGA- based single stage photovoltaic energy conversion system”, Proceedings of IEEE Asia- Pacific Conference on Circuits and Systems, pp 745-748, Taiwan, Dec. 2004.

[8] Bouzid Aliane and Aladin Sabanovic, “Design and implementation of digital bandpass FIR filter in FPGA”, Computers in Education Journal, v14, p 76- 81, 2004.

[9] M. Canet, F. Vicedo,V. Almenar, J. Valls, “FPGA implementation of an IF transceiver for OFDM- based WLAN”, IEEEWorkshop on Signal Processing Systems, SiPS: Design and Implementation, PP 227- 232, USA 2004.

[10] Xizhi Li, Tiecai Li, “ECOMIPS: An economic MIPS CPU design on FPGA”, Proceedings- 4th IEEE International Workshop on System-on-Chip for Real- Time Applications, PP 291-294, Canada 2004.

[11] R. Gao, D. Xu,J. P. Bentley, “Reconfigurable hardware implementation of an improved parallel architecture for MPEG-4 motion estimation in mobile applications”, IEEE Transactions on Consumer Electronics, V49, N4, November 2003.

[12] H. D. Maheshappa, R. D. Samuel, A. Prakashan,

“Digital PID controller for speed control of DC motors”, IETE Technical Review Journal, V6, N3, PP171-176, India 1989.

[13] J. Tang, “PID controller using the TMS320C31 DSK with on-line parameter adjustment for real- time DC motor speed and position control”, IEEE International Symposium on Industrial Electronics, V2, PP 786-791, Pusan 2001.

[14] Y. F. Chan, M. Moallem, W. Wang, “Efficient implementation of PID control algorithm using FPGA technology”, Proceedings of the 43ed IEEE Conference on Decision and Control, V5, PP. 4885-4890, Bahamas 2004.

[15] Bao-Sheng Hu, Jing Li, “Fuzzy PID gain conditioner: Algorithm, architecture and FPGA implementation”, Journal of Engineering and Applied Science, PP 621-624, US 1996.

(6)

________________________________________________________________________________________________

[16] Wei Jiang, Jianbo Luo, “Realization of fuzzy controller with parameters PID self tuning by combination of software and hardware”, Proceedings of the Second International Symposium on Instrumentation Science and Technology, V1, PP 407-410, China 2002. 18 [17] D. Deng, S. Chen,G. Joos, “FPGA

implementation of PWM pattern generators”, Canadian Conference on Electrical and Computer Engineering, V1, PP 225-230 May 2001. and Electronics Engineers Inc.

[18] K. Nurdan, T. Conka-Nurdana, H. J. Beschc, B.

Freislebenb, N. A. Pavelc, A. H.Walentac,

“FPGA- based data acquisition system for a Compton camera”, Proceedings of the 2nd International Symposium on Applications of Particle Detectors in Medicine, Biology and Astrophysics, V510, N1, PP. 122-125, Sep 2003.

[19] S. Poussier, H. Rabah, S. Weber, “Smart Adaptable Strain Gage Conditioner:

Hardware/Software Implementation”, IEEE Sensors Journal, V4, N2, April 2004.

[20] Analog Devices Inc., “2.7 V to 5.5 V, 5 . s, 8-Bit ADC in 8-Lead microSOIC/DIP”, 2000.

http://www.analog.com/UploadedFiles/Data Sheets/216007123AD7823 c.pdf

[21] Analog Devices Inc., “+2.7 V to +5.5 V, Serial Input, Dual Voltage Output 8-Bit DAC”, 1997.

http://www.analog.com/UploadedFiles/Data Sheets/48853020AD7303 0.pdf

[22] S. Holle, “Incremental Encoder Basics”, Sensors, April 1990, pp.22-30.

[23] J. Detrey, “A VHDL Library of Parametrisable Floating-Point and LNS Operators for FPGA”,

2003. http://perso.ens-

lyon.fr/jeremie.detrey/FPLibrary/FPLibrary- 0.9.tgz [24] Transtech DSP, “Quixilica Floating

Point FPGA Cores”, 2002.

http://www.transtech- dsp.com/datasheets/qx- dsp001-fp hm v1.pdf

[25] G. Franklin, J. Powell, and A. Emami-Naeini,

“Feedback control of dynamic systems”,Addison- Wesley, 4th ed., 2002.

[26] R. Coughlin and F. Driscoll, “Operational Amplifiers and Linear Integrated Circuits”,

[27] Maxwell, J.C. (1868). "On ". Proceedings of the Royal Society of London 16: 270–

283. doi:10.1098/rspl.1867.0055. JSTOR 112510.

[28] Routh, E.J.; Fuller, A.T. (1975). Stability of motion. Taylor & Francis.

[29] Routh, E.J. (1877). A Treatise on the Stability of a Given State of Motion, Particularly Steady Motion: Particularly Steady Motion. Macmillan and co.

[30] Hurwitz, A. (1964). "On The Conditions Under Which An Equation Has Only Roots With Negative Real Parts". Selected Papers on Mathematical Trends in Control Theory.

[31] Donald M Wiberg. State space & linear systems.

Schaum's outline series. McGraw Hill. ISBN 0-07- 070096-6.

[32] Liu, Jie; Wang, Golnaraghi, Kubica (2010). "A novel fuzzy framework for nonlinear system control". Fuzzy Sets and Systems 161 (21):

2746– 2759. doi:10.1016/j.fss.2010.04.009.



Referensi

Dokumen terkait

The development of an upper limb robotic arm is passively important and needed to research based on the type of application perform, actuator and the controller.. The

To compensate the output voltage from the input voltage and load current disturbances, feedback controller gain for Poles 7x and (iL22, 100vC22) is proven to produce the best

But the major function of the liquid level control system using PLC controller is to measure the liquid level in tank continuously, not depend on the highest

The method used is to design a dryer model using temperature control with the PID controller method to obtain good drying performance because it can achieve and be

The proposed model based controller in current regulator side of IFOC for robustness and stability controller using SMC is compared with PI controller in variable

The designed DDR Controller supports data width of 64 bits, Burst Length of 4 and CAS Column Address Strobe latency of 2.DDR Controller provides a synchronous command interface to the

PID Controller The Proportional Integral Derivative PID controller, widely employed in industrial control systems, is a feedback mechanism designed to minimize error over time by

Figure 4.3 Speed used as a parameter for controlling motion Information exchange between cooperating robots ensures that each robot knows the position of other robot in an operational