Brief Manual of 2DOF Helicopter Experiment

 

1. Introduction

The 2 Degrees of Freedom (2DOF) helicopter model is fixed to a vertically mounted shaft that is free to rotate to left and right giving it a degree of freedom in Yaw (changing of y , or direction). The vehicle is suspended in a frame on the vertical shaft so that it is free to swing up and down giving it a degree of freedom in Pitch (changing of q , or angle). [1]

For more information, you can visit:

http://www.quanser.com/english/html/challenges/fs_chall_specialty_flash.htm

And click Specialty->2 DOF Helicopter .

1.1 Hardware

The 2DOF helicopter model is a system with 2 inputs and 2 outputs. The target PC gets two encoder inputs from the direction and angle detectors, and uses two D/A channels to control the DC motors.

The 2D flight simulator consists of a simplified model of a helicopter mounted on a fixed base with the associated Hardware and Software needed to achieve control in direction and angle. Position and rate feedbacks are obtained from measurements taken from Incremental Encoders mounted on the hinges, which send the change of q and y to the controller (target PC). Servo Actuation is achieved by two small reversible electric drive systems driven from two separate power amplifiers. System level inputs and outputs are handled using the MultiQ3 I/O board, which is plugged in the target PC.

1.2 Software Packages

With client-server structure, a developing platform and a target platform are needed for the experiment. Both of them have Windows operating system.

The developing platform is used to design the digital controller of the helicopter system. It also offers a GUI to display graphical outputs and to get user's input in real time. You can visually design the control system block diagrams by using Matlab and Simulink. All the basic digital control units and hardware driver blocks are available in WinCon toolbox for Simulink. You can focus your time and energy on the digital controller design.

When system block diagram is completed, you can simply switch to the WinCon menu in Simulink and press ¡°Build¡±. Then the WinCon server will launch the ¡°Matlab Real-time work shop¡±, which is a source code generator to generate C source codes from the Simulink block diagram. After source code generation, WinCon server will evoke Microsoft Visual C++ to compile the source codes. Finally, WinCon server will send the binary code to WinCon client.

The target machine gets binary codes form the server and physically controls the helicopter via the MultiQ3 I/O board. Target machine has a real time system extension named RTX installed under Windows OS. Normal applications without time constraints are still scheduled by Windows, but the applications with Real-time constraints are scheduled by RTX instead to have better real-time performance. RTX also accesses the helicopter hardware through the hardware drivers.

RTX adds a real-time subsystem, known as RTSS , to Windows NT, Windows 2000, and Windows XP (see the figure below). RTSS is conceptually similar to other Windows subsystems (such as Win32, POSIX, WOW, and DOS) in that it supports its own execution environment and API . RTSS differs in one important area, though: Instead of using the Windows scheduler, RTSS performs its own real-time thread scheduling. Furthermore, in a uniprocessor environment, all RTSS thread scheduling occurs ahead of all Windows scheduling, including Windows-managed interrupts and Deferred Procedure Calls (DPCs). RTX includes a real-time enabled Hardware Abstraction Layer ( HAL ) extension. This extension maintains interrupt isolation between RTSS and Windows. Windows cannot mask (at the interrupt controller level) interrupts managed by RTSS. Windows interrupts are masked during RTSS processing. The real-time HAL extension supports high-resolution clocks and timers for RTSS, while it also supports non real-time clocks and timers for Windows. Other real-time HAL extension features include a software interrupt mechanism between RTSS and Windows, basic exception management, and various enhancements for determinism. [2]

Windows and RTX working together, source from Venturcom RTX Documentation.

There are some possible combinations of the development and target machines. You can have one developing machine to work with one or more than one target machine(s). You can also install all the listed software on one PC and use it as both developing and target machines. In this demonstration experiment, one PC solution is used.


2. Experiment

It is a demonstration experiment. The main purposes are as follows:

1) To provide a practical experience working on real time loop-back control system

2) To understand the developing, debugging and testing procedures of a real time system

2.1 Working Files and Directory

Before you start to run or modify the controller software, please copy the directory from: My Documents\ projects\heli2d_F1 to My Documents\student\yourname\heli2d. And you can do anything under the path. But, please do not modify anything under My Documents\ projects\heli2d_F1.

Since only a group account is provided to students, i.e. they will use the same account, it shall cause their directories unsecured. When another students login, they can see all files under 'My Documents\projects\'. In this case, we suggest that:

 

2.2 Run the binary code only

1) Start WinCon Client by clicking Program->WinCon 3.3-> WinCon Client

2) Start WinCon Sever by clicking Program->WinCon 3.3-> WinCon Server

3) In WinCon Server window: File->Open

¡°My Documents\projects\heli2d_F1\heli2.wcp ¡±

If there is an error message like ¡°cannot download¡±, you need to use the WinCon client to download by clicking File->Open :

¡°My Documents\ projects\heli2d_F1\q_heli2d.wcl¡±

4) Make sure to power on the two power amplifiers.

5) Press ¡°Start¡± in WinCon server to start the program.

6) In WinCon server's control panel window, you can press the buttons to switch program/joy stick and normal/landing modes.

7) Press ¡°Stop¡± in WinCon server or client to stop the code. It is better to switch to landing mode by clicking the ¡°Land¡± button in WinCon Client first, but please make sure you switch back to normal mode before next take off.

8) If you want to observe some values inside the digital controller, you can insert scopes, X-Y graphs, digital meters and thermometers.

9) If you like to modify some control parameters on the fly, you could click Control-> Insert Control in WinCon Server to add buttons, sliders and multiple selects and relate them with your control parameters.

2.3 Modify the control system

1) Start WinCon Client by clicking Program->WinCon 3.3-> WinCon Client

2) Start WinCon Sever by clicking Program->WinCon 3.3-> WinCon Server

3) Click " Go to Matlab " icon to launch Matlab, in Matlab,

File->Open : load ¡°My Documents\ projects\heli2d_F1\d_heli2d.m¡±

You can see the Path Description diagram and the CMD diagram. Do modifications as you wish, and run the .m file. This ¡°.m¡± assigned some initial values of the parameters used in Simulink block diagrams. You must execute it at least once before you evoke Simulink and build your project.

4) Launch Simulink by: typing 'Simulink' in Matlab command window, or by clicking ¡° Go to Simulink¡± in WinCon Server window load:

¡°My Documents\ projects\heli2d_F1\q_heli2d.mdl¡± in Simulink

5) Click WinCon->Build in Simulink window. If there is no error(s), WinCon Server will load the binary code to your WinCon Client automatically. Sometimes you might need to click the WinCon->Clean to clean up before building.

6) Make sure to power on the two power amplifiers. Then you can run the binary code by clicking the ¡°Start¡± button to start the helicopter.

2.4 Exit

1) Close WinCon Server, it will close your WinCon client automatically.

2) If you do not add scopes, meters or controls in WinCon server, please do not save it to .wcp file. Sometimes, it will cause some problems.

3) Turn off the powers of the amplifiers if you are the last one to leave the lab.

Note: Before you stop the controller, please switch to the joystick control and ¡®land' the helicopter or support the helicopter body by your hand. Or the helicopter may crash by the sudden stop.

3.Known problem(s)

1) If Matlab and Simulink are running and you have ever used ¡°build¡± command in WinCon menu in Simulink, then there will be an error message when you try to load the binary code by using WinCon server. And sometime the code will not be loaded into client machine. This problem was caused by the version conflict between Matlab and WinCon server. It might be solved in future versions.

Temporary solution:

Start the binary code by switching to WinCon Client, load the code, and press Start in WinCon client window.

Reference:

[1] Product manual of 2DOF Helicopters , by Quanser Consultant Inc. http://www.quanser.com/english/downloads/products/Specialty/Quanser_2DOF_Helicoper_PIS.pdf

[2] Venturcom RTX Documentation,http://www.vci.com/downloads/rtx/rtxdocs.asp