Inverted Pendulum Teaching Experiment Platform Based on MATLAB-DSP
暂无分享,去创建一个
This paper presents a new teaching platform for the inverted pendulum based on MATLAB-DSP integrated development environment. The teaching platform shows some advantages, including high efficiency, low cost, friendly interface and the function of testing dynamic process and rework parameters on line. It plays an important role in the teaching of modern control theory. The experiment platform can convert Simulink model to DSP executable code automatically, so the students can specialize in the study control algorithm. After finish this experiment, students not only learn a lot of knowledge, but also lay a good foundation for the future research work. Introduction Inverted pendulum is a natural unstable object and a typical device of the study of control theory. It can effectively reflect many problems of the controlling process, such as nonlinear problems of system, robustness, stabilization and tracking problems. In university, it can help students master control theory through this experiment. It always takes a long time for students to accomplish the real-time control program in traditional control system experiment, so the effect of teaching can’t be guaranteed. This paper presents a new teaching platform for the inverted pendulum based on MATLAB-DSP integrated development environment. The process of system design, simulation and experiment could be conducted smoothly in one integration platform. After finish this experiment, students can learn a lot of knowledge, for example: MATLAB modeling and simulation, DSP TMS320F2812, CCS software, mathematical modeling and others. Design of the Experiment Platform The experimental platform combines MATLAB software and DSP development environment as a whole, it mainly used in the teaching work of undergraduate and graduate students. First of all, hardware and software platform of inverted pendulum control system must be settled up. The hardware design was based on DSP and CPLD, which could achieve data acquisition, control motor, protect system and other functions. The software design was based on MATLAB-DSP integrated development environment, and it needed to build the Simulink models and create custom device driver modules according to the hardware. MATLAB-DSP integrated development environment can convert Simulink model to DSP executable code. The method is that Simulink model converted to C code first, which compiled into assembly code aimed at DSP target board, and then download the executable code to DSP. The design personnel need not care about how the MATLAB program convert to C code and how the C program convert to assembly code and the conversion step how to achieve. The reason is that these steps can be done by MATLAB automatically [1]. Especially for the people who specialize in the study control algorithm, they need not familiar with DSP hardware structure, function, DSP International Conference on Education Technology and Information System (ICETIS 2013) © 2013. The authors Published by Atlantis Press 768 memory configuration and so on. In this integrated development environment, you can test the control algorithm in DSP target board directly [2]. A. The composition of the Experimental Platform The hardware structure of the whole system is shown as Figure 1. Inverted pendulum car is powered by 12V DC motor through a conveyor, Displacement and angle signals were measured by the photoelectric encoder, then this signal were transferred to DSP. According to control algorithm we settled before, the DSP send the corresponding signals to Motor driver board and control the inverted pendulum car. Our experiment’s target is the rod of pendulum can steadily upside down on the car. Fig.1. Block diagram of Platform The experimental platform is mainly composed of hardware platform and software platform. The hardware platform is designed, which include three main parts: the DSP TMS320F2812, the incremental rotary encoder detection circuit based on CPLD and the motor drive circuit based on HIP4080; the software platform include windows XP, MATLAB2011, Code Composer Studio v3.3. B. The generate of DSP code The automatic generation of DSP code is the core of MATLAB-DSP integrated development environment, Developer’s Kit for TI DSP is development kit based on Simulink and Real-Time Workshop belongs to MathWorks Company and Texas Instruments (TI) Company. With this Development Kit, the user can set the algorithm model of control system in Simulink environment [3]. The process of generating embedded code from rapid prototype is a key link based on the MATLAB-DSP integrated development environment. There are four stages for generating code automatically [4]: a) Establish the model of MATLAB/Simulink model “model.mdl”, Real-time Workshop read the model file and compiled into “model.rtw”. b) TLC target language read the information of “model.rtw” file, compiler the model into source code. c) Generate the code of specified target. d) Link to development environment of CCS which the program needed The Design of the Controller and Simulation The primary task is to build mathematical model in the study of inverted pendulum system. This is the foundation of controller and simulation. According to the principle of dynamics, we setup a mathematical model for the first level inverted pendulum with Newtonian mechanics method. Combining with the actual data of the inverted pendulum, we can get the state equation and output equation as shown below: X AX Bu Y CX = + =
[1] Pieter J. Mosterman,et al. Embedded Real-Time Control via MATLAB, Simulink, and xPC Target , 2005, Handbook of Networked and Embedded Control Systems.
[2] Shaoqiang Yuan,et al. The Design of Matlab-DSP Development Environment for Control System , 2012, 2012 Third International Conference on Digital Manufacturing & Automation.