Вы находитесь на странице: 1из 6

Magnetic levitation system

Q1. Explain in detail, the MatLab magnetic levitation model

A. In order to appreciate magnetic levitation and to get a thorough insight into the fundamentals of
feedback control, it is worth exploring m a t l a b s Magnetic Levitation Model. This model
may be accessed by typing vrmaglev on mat labs command window, as is shown below. It
may also be accessed from mat labs virtual reality toolbox.
The Magnetic Levitation Model is meant to demonstrate control problems associated with nonlinear and unstable systems. It comprises of a position sensor connected to an A/D converter, to
sense the steel balls vertical position. The coil is driven by a power amplifier interfaced with a
D/A converter. A pictorial representation of the model itself is given for further clarity.

Fig13. Matlabs Magnetic Levitation Model.

Fig 14. Block Diagram of the Levitation model.

There is provision to vary the signals frequency and amplitude as well.

Fig15.

Obtained by double clicking the signal generator block set.

By double clicking on the scope one can observe how the plants output tracks the chosen
signal. The images that follow will further clarify this point.

Fig16. The plants output trying to track a sinusoidal wave.

Fig 17. The plants output trying to track a square wave.

Fig 18 The plants output trying to track a sawtooth wave.

By double clicking on the PID block, one can change the controllers parameters. These
include KP (proportional gain), KD (derivative gain) and KI (Integral gain).

Simulation of the Controller using


Simulink

The closed loop control system shown in Fig 1 was simulated in MATLAB and the results closely
analysed. The objective of this simulation was to get a better understanding of PID control and
the individual effects of proportional, integral and derivative terms.

Fig 19:
Simulink model of
PID controller

Simulation
Result

When Kp=1, Ki=10 and Kd=0.03, then the output would be like this and the ball will
move between two ends smoothly.

Fig 20output of the


controller

When Kp value is increased to 5,Ki to 15 and Kd to 0.5 then there will be increase in transients
and the ball starts to fluctuate. So as we go on increasing the PID parameters value the
unstability increases. Therefore it is suggested to keep it between this limit.

Fig 21 output of the


controller

Real time
technique

window

targets

The Real-Time Windows Target brings rapid prototyping and hardware-in-the-loop simulation..
It is the most portable solution available today for rapid prototyping and hardware-in-the-loop
simulation this picture shows the basic components of the Real-Time Windows Target. [4]

Fig22. Real-Time Windows (rtwin) Target [1]

Parameter tuning is done interactively, by simply editing Simulink blocks and changing
parameter values. For viewing signals, the Real-Time Windows Target uses standard
Simulink Scope blocks, without any need to alter your Simulink block diagram. Signal data can

also be logged to a file or set of files for later analysis in MATLAB.

The Real-Time Windows Target is often called the "one-box rapid prototyping system," since
both Simulink and the generated code run on the same PC. A run-time interface enables you to
run generated code on the same processor that runs Windows the generated code executes in
real time, allowing W indows to execute when there are free CPU cycles. The Real-Time
Windows Target supports over 100 I/O boards, including ISA, PCI, Compact PCI, and PCMCIA.
Sample rates in excess of 10 to 20 kHz can be achieved on Pentium PCs.

Code Generation
Optimizations

The Simulink code generator included with Real-Time Workshop is packed with optimizations to
help create fast and minimal size code. The optimizations are classified either as cross-block
optimizations, or block specific optimizations. Cross-block optimizations apply to groups of
blocks or the general structure of a model. Block specific optimizations are handled locally by the
object generating code for a given block. Listing each block specific optimization here is not
practical; suffice it to say that the Target Language Compiler technology generates very tight
and fast code for each block in our model.

Fig 23Magnetic Levitation Detailed Non linear model

Вам также может понравиться