Data Collection and Simulation Comparison

From Distributed Autonomous and Networked Control Lab
Revision as of 00:59, 2 August 2016 by Pfuhing (talk | contribs)
Jump to navigation Jump to search

This page will take you though setting up and testing RADA, retrieving the log file and other necessary data to run a simulation of that test and processing the data in MATLAB. Then actually running the simulation of RADA in Simulink.

Setting Up a RADA Test

Testing RADA is not overly difficult once you get the hang of the steps to setup RADA. The following steps may seem like a long process to go from starting the testing process to having completed simulation and plotting of the test results but this whole test procedure (with the exception of battery charging) can be completed in about 15-20 minutes. These steps are meant to be as detailed as possible in order to help new users of RADA to get up and running as quickly as possible.

NOTE: Always run RADA with at least 2 people! The pendulum arm can crash into the ground if the network starts to drop packets and one person cannot give commands to RADA and spot the pendulum. This is a safety issue for both you and the RADA platform.

Charging batteries

The lab currently uses mostly Hyperion batteries. We charge our batteries with a Hyperion EOS 1420i Net3 battery charger. For some general information about how to use this charger see this video.. In the lab we power this charger using the old Kepco Power supplu because it is the only power supply that we have that can supply enough current. Make sure that the power supply is set to an output voltage between 10.5V-29V.

Kepco Power Supply off. Kepco Power Supply on with correct voltage supply range.

While the YouTube video linked above should explain how to use the charger. Currently three different Lithium polymer batteries (Lipo): 1600 mAh 2-cell Lipo for the wheels, 2600 mAh 2-cell Lipo for the electronics of Eris, and a 2600 mAh 4-cell Lipo. The 1600 mAh 2-cell Lipo can be charged using memory slot 2 of the charger. The 2600 mAh 2-cell Lipos can be charged using memory slot 3 for fast charging and memory slot 4 for slower charging (use this if the battery gets run really low for 10-20 minutes then switch to fast charging). The 2600 mAh 4-cell Lipo can be charged using memory slot 8. The 1600 mAh 2-cell and 2600 mAr 4-cell generally charge in 10-20 minutes apiece while I generally fine it takes the 2600 mAh 2-cell up to 70 minutes to charge fully.

Setting up the camera system

The camera system is run on the windows computer CO3050-07. You can log into this computer using a local microcart username and password which is not posted here for security reasons but any one who works in the lab should know it. Once logged in look for Tracking Tools in the start menu or look for the shortcut shown below:

Tracking Tools shortcut

Once the program opens the screen should look something like this:

In the Tracking Tools Quick Start pop up menu select Open Existing Project and then navigate to D:\Optitrack_Configuration (It should open to this directory by default) and select the most recent Tracking Tools project. It should be named like TrackingToolsProject YYYY-MM-DD timeStamp.ttp. This is normally the most recently edited file when sorting by data modified. The most recent one as of August 1st, 2016 is TrackingToolsProject 2015-09-23 2.30pm.ttp.

You should notice that the cameras shown in main project scree arrange themselves like out camera configuration once the project has been opened. Now the constellations need to be loaded. This can be done by going to File->Open and another pop up window will open. Navigate back to D:\Optitrack_Configuration (It should open to this directory by default) and select the most recently dated set of RADA trackables. They are named like RADA_entireSystem_M_D_YYYY.tra. The most recent one as of August 1st, 2016 is RADA_entireSystem_7_8_2016.tra.

Once the project and trackless are open the cameras should appear in their constellation (square) and there should be two constellations under Project Explorer->Trackables. One Named UAV for the pendulum and one named ERIS for the ground vehicle. In order to get additional information about each constellation left click on the the name of the desired trackable.

Once a trackable is selected more information about it is available in the Trackables Tab on the right side of the screen. For the current position and orientation look at the Real-Time Info sub -tab. This gives the orientation in the wrong order for how we currently use the Euler angles. When two or three of the angles are near zero you can switch yaw and pitch to get roughly the correct orientation.

Now we need check to make sure the system is zeroed.

1. Hold RADA so that the front of the ground robot (ERIS is facing the wall with the white boards (east)). The front side of Eris is labeled. If it isn't it is the side opposite of the switches and the side with the trackable constellation on it. 
2. Make sure that the motor with the red motor mount is also facing the wall with the white boards.
3. Make sure the quad system is aligned along Eris Axis by standing behind the system and seeing if you can use the pole to block mounting bolts of the front propeller motor mount when looking at the pole while facing the east wall.
4. While holding the pendulum approximately vertical see if the camera system reads zeros for the pendulum (UAV) pitch and roll (yaw and roll in Real-Time Info). If yaw is off by a few degrees that is fine.
5. Compare the yaw of the UAV to that of ERIS (Remember this is pitch in REal-Time Info). If they are both near zero and with in a few degrees and the pendulum's pitch/roll were also near zero then you are ready to use the camera system. Otherwise go to the next step.
6. You need to zero the pendulum. 
  - Align ERIS so it is near zero yaw first (eye ball it).
  - Get a level and a friend. Have your friend use a level to ensure that the pendulum is level in both directs and hold it there.
  - With the UAV constellation selected go to the  Orientation tab (next to Real-Time Info tab) and click on Reset To Current Orientation button 
  - Now your friend can set the pendulum down and you can zero ERIS the same way.
7. Save the new trackable orientation by going to File->Save Trakables... and save a file using the same naming conventions as the trackable file you opened earlier except use the current data so you don't have to re-zero the system the next time you test.


Building Software

The development environment for running RADA is hosted on CO3050-11, a Linux Red Hat environment. This computer has a local ucart user name that you should use. The password isn't put here for security reasons. In order to ensure that the RADA software is setup correctly for the test you want to run. To do this you will need to open the main.cpp and logger.cpp files and make sure all of the compile time macros you want are defined correctly. All of the c++ files you should need to edit are in the directory ~/Desktop/rada_research_project/ErisResearchCode/CppProjects/MainProgram_PacketLoss/src/Korebot Below is a compiler macro options for main.cpp:

*H2ctrl : This will cause the system to enter H2 controller mode where the whole RADA system is controlled by an H2 controller. 
 *ssTracking : H2ctrl must also be defined for this macro to do anything. This macro will has the system to be controlled by a tracking H2 controller.
 *ssMotors : H2ctrl must also be defined for this macro to do anything. This macro will has the system to be controlled by an H2 contorller that contains propeller states. This also cause the system to "Dance."
*ssDrop : Cause the system to go into packet drop controller mode. This mode allows controllers designed for lossy networks to be tested. Based off of other definitions how lossy the network is can be simulated. If nothing else is defined this controller becomes basically a H2 controller.
 *drop10 : Will put the packet drop mode into 10% loss mode and use a controller designed for 10% loss. 
 *drop30 : Will put the packet drop mode into 30% loss mode and use a controller designed for 30% loss. 
 *drop50 : Will put the packet drop mode into 50% loss mode and use a controller designed for 50% loss. 
*mot50
*RADAlqi
*RADAlqi_est
*rada_lqg
*rada_split_lqg
*rada_split_lqg_ol
*yaw_off
*accR
*posRamp

Turing on RADA

Connecting to RADA

Testing RADA

Running the first test after power up

Running additional tests

Measuring battery voltages

Locating and retrieving log files

Post processing and Simulation

Using the MATLAB data parsing tool

Adding additional data for simulations

Setting up the MATLAB workspace for simulation

Running simulations and storing results

Plotting results