You are on page 1of 6

Control System Design Process by VisSim

Dr.Byamakesh Nayak,Faculty, Electrical KIIT University

About VisSim

Simple sin with plot

VisSim is a block diagram language for creating complex nonlinear dynamic systems. To create a model, simply drag blocks in the workspace and connect them with wires. Then click the Go button to initiate your simulation. The response is instantaneous. You can choose to display your response in 2D or 3D plots, gauges, bar charts, meters, digital readouts, and even 3D animated scenes. All are driven in real time using the VisSim engine. VisSim's highly tuned math engine executes your diagram directly with no compilation delay. In addition to accelerating development with rapid turnaround for changes, VisSim's fast execution speed is perfect for model based operator training, off-line controller tuning, and hardware-in-the-loop testing. Its efficient C code generator makes it an ideal platform for model-based embedded system development. By combining the simplicity and clarity of a block diagram interface with a high-performance mathematical engine, VisSim provides fast and accurate solutions for linear, nonlinear, continuous time, discrete time, SISO, MIMO, multirate, and hybrid systems. With VisSim's wide selection of block operations and expression handling, complex sysems can be quickly entered into VisSim.

Simple AM+FM modulation diagram with plot

VisSim's tightly integrated development platform makes it easy to pass freely among the stages of model construction, simulation, optimization, and validation. This means you can create virtual prototypes on your desktop and make sure they're working properly before committing to the design. And because VisSim eliminates traditional programming, your learning time is minimal.

VisSim has libraries of preconstructed components giving you access to high level models of subsystems like HVAC units, AC and DC electric motors, hydraulic components, gas turbines, human respiration and blood flow, 6-DOF airframe dynamics, counters, timers, logic, and much more. Just right click to get a dialog box, configure to your system parameters, connect the wires and go.

Control System Design Process


The first step in designing a controller is the development of a high-fidelity model of the plant to be controlled. Then a controller can be designed to control the plant within design specifications. To do this, VisSim supplies tools like VisSim/Analyze, a frequency domain analysis model and VisSim/OptimizePro, a global parameter optimizer.

Modeling the Plant


The VisSim mathematical engine provides fast and accurate solutions for linear, nonlinear, continuous time, discrete time, time varying, and hybrid systems. VisSim lets you easily build plant models by simply selecting and connecting function blocks. Models can be linear, nonlinear, continuous, discrete, hybrid, SISO or MIMO.

VisSim supports hierarchical design by letting you group blocks into compound block subsystems. You can also create custom blocks using C, Fortran or Pascal and add them to the VisSim block library. There is virtually no limit to model size or complexity. Once assembled, a click of the GO button simulates the plant model. VisSim data import blocks allow easy comparison of model output to actual plant output. In VisSim, responses are immediately visualized with plots, stripcharts, meters and gauges. The plant model can be refined until the model accurately reflects the desired response. Plant models can also be derived through system identification methods which "reverse engineer" the plant model from measured plant data.

Frequency Domain Analysis


After the plant model is verified, the dynamics of a plant can be analyzed with VisSim's Analyze option. VisSim/Analyze approximates the dynamics of a nonlinear system by linearizing the system about the current operating point. Linearized systems can be represented in ABCD state-space or transfer function form. With

VisSim/Analyze, you can easily access transfer function information, edit zeros and poles, and obtain Nyquist, Bode, and root locus plots.

Parameter optimization of PID gains using the VisSim global optimizer

Controller Design
The next step is to design a controller for the plant model by interactively editing compensator zeroes and poles, and observing their combined behavior in Bode and root locus plots. Once the desired responses are obtained, the pole placement controller block is simply inserted into the VisSim diagram. The preliminary pole placement controller is then connected to the plant model creating a feedforward or a feedback control loop. A simulation is run and the results of the simulation can be viewed in the form of plots. The stability of the closed-loop system can then be determined using Nyquist plots. In addition to pole placement controllers, VisSim provides pre-configured PI, PD and PID controllers that can be easily customized or optimized for specific user requirements.

Simulation
Simulations can be set up to run in interactive, batch, or single-step modes. VisSim's highly interactive interface makes it easy to perform "what if" simulations. For example, you can dynamically change parameter values like controller gains and VisSim will immediately display the corresponding changes in system behavior. Both linear and nonlinear systems can be simulated with VisSim. Nine different integration algorithm options are available that offer a trade-off between speed and accuracy.

Control experiment by VisSim

Simple Control Experiment

This is a simple, low cost experiment using easy to obtain materials that demonstrates closed-loop feedback control. It takes encoder input for vane angle and uses PID control to regulate a PWM signal applied to a power transistor connected to a DC motor that spins a fan blade. A set point is entered to command the motor to hold a specific vane angle. If improper gains are selected, the vane will bounce and not hold set point. With proper control, the vane will smoothly hold set point despite disturbances in air flow, or box pitch. The vane can be pushed or pulled resulting in speedup or slow down of the fan. There is also a diagram "fanSimFx.vsm" that includes a full nonlinear model of the plant in the loop with a fixed point model of the controller. The vane effective cross sectional area varies with the cosine of the vane angle, and vane restoring torque due to gravity varies with the sin of the vane angle, not to mention the turbulence of the air flow used to set the vane angle.

VisSim diagram of fan-vane plant

Bill of Materials for Fan experiment

Box - Sterilite -Wal-Mart 1/4" dowel - Home Depot Encoder - US Digital S4-256-B Tel: 800-736-0194 www.usdigital.com Propeller (Cox 994 - 3 blade - around 2.5" radius) - Hobby Shop

Motor - High Speed 12VDC - Radio Shack Pipe Hanger for 1" pipe 6" long - Home Depot Machine Screw 10/24 x 1/4 Round head - Home Depot Nylon Lock Nut #10-24 - Home Depot TIP120 Darlington - Radio Shack Heat Sink TO220 - Radio Shack Screw/Nut/washer to attach TIP120+Heatsink to box - Radio Shack Coaxial DC Power Jack 5.5mm O.D 2.1mm I.D. - Radio Shack 3.5mm Mono Audio Jack (for control signal) - Radio Shack 3/8 O.D. 1/4 I.D. Vinyl Tube (to attach 1/4 dowel to encoder) - Home Depot 1K resistor (from control plug to left leg of darlington) - Radio Shack 10K resistor (from control lpugs gnd to left leg of darlington) - Radio Shack 10uF Capacitor across PWR and GND of Coaxial DC Power Jack 2x .05 uF Capacitors across encoder A/B signals and GND Diode 1N4003 (across leads of motor) - Radio Shack

Cables From Controller to Box

40 Pin Ribbon cable (34 Pin if connecting to EVM) Cable for encoder - DA-3286-6FT US Digital Control wire - cable with 3.5MM Jack - CAT# CB-361 All Electronics Tel: 800-826-5432 or www.allelectronics.com

Power for Fan Motor 12V 1Amp AC-DC adapter (Can be 9 - 15v) Assembly

Cut out front and back. (router bit on a Dremel tool works best. A knife tends to crack the plastic) Save the plastic cut outs for later use as the paddle Drill holes for dowel to hold vane - (a Dremel boring bit works well) Place the dowel pivot holes about 1/2 inch from top and front. Make sure the holes for the encoder and dowel line up so paddle will be level and swing smoothly.

3/8 - hole for encoder - boring bit 1/4 - hole opposite encoder to hold dowel - boring bit 1/4 - hole for control plug - boring bit 7/16 - hole for power plug - boring bit 1/8 - hole for heat sink 3/16 - holes for motor mounting - I try to position so motor will be centered in box - use the pipe hanger to help position holes

Connections

Solder wires to the power transistor then mount and soldering to other components. Right leg of darlington (seen from top with legs pointing down) to ground of power plug and ground of control plug. Middle leg of darlington to one leg of motor Left leg of darlington to control plug. Solder resistors to wire with 1K resistor to control and 10K resistor in to ground. Power lead of power plug to one leg of motor NOTE: Wait to solder the leads and diode to the motor until experiment is ready. Then attach by hand to figure out which way spinning the motor to properly blow air to push the paddle.

Attach the propeller to motor. If the diameter of the motor shaft must be increased, speaker wire insulation can be pushed over the shaft of the motor gives the diameter (almost) needed to hold the propeller. I also add a couple of thin strips of electrical tape to the after adding the insulation. Push the propeller over the motor shaft.

Motor mounting Bend the pipe hanger about 2.25" down from where base of motor would be held. You don't want propeller to hit base or top of box. Attach pipe hanger to base using the 10/24 screws and lock nuts - Have the bend located at the box center. Vane Trim one of the cutout pieces so it will easily fit through the hole. Glue to 1/4 dowel with hot glue gun. (cut to mate with encoder shaft and poke out other side of box) Attach to dowel to encoder shaft using about 1" of clear plastic tubing. Wiring from DSP card to box For eZdsp use a 40 pin ribbon cable. One end will have a standard IDE connector to fit onto board, the other end must be modified to connect to fan experiment. Use sharp blade to separate the wires used in the ribbon cable for about 1.5 inches. Strip wires and solder according to the pin number from the table below. I find it easiest to wire the capacitors first. Conclusion VisSim/OptimizePro can determine optimal values for design variables subject to user-defined constraints starting from initial user guess values. For example, VisSim/OptimizePRO can automatically calculate optimal PID controller gains that give minimal time to setpoint, plus minimal overshoot. It allows user-specified cost functions that can consider controller behavior, such as steady-state error, overshoot and rise and settling times. VisSim/OptimizePRO can even work with a physical system when coupled with VisSim's hardware analog I/O interface (VisSim/RealTimePRO). References: Visual Solution incorporated VisSim

You might also like