Data Collection and Simulation Comparison
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:
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 : This macro over-rides all other macros. If this is turned on the wheels will not run and the propllers will be run at 50% command. This is used for measuring the effective battery voltage seen by the ESCs. This is always run after a test. -RADAlqi : This macro will cause the system to use an LQI controller on the whole system. The linear velocity states are calculated with no filter and the angular velocity states are calculated with filters. -RADAlqi_est : This macro will cause the system to use an LQI controller on the whole system. A traditional estimator is used to estimate the states. -rada_lqg : This macro will cause the entire system to be controlled by a LQG controller/estimator system. -rada_split_lqg : This macro will cause the pendulum and ground robot to be controlled by their own LQG systems. -rada_split_lqg_ol : This macro will cause the pendulum to be controlled by an LQG controller, the yaw of the ground robot to be controlled by a PID controller, and the ground robot linear velocities to be controlled with open-loop commands. -yaw_off : This macro will cause the yaw control to be disabled on some controllers. *accR : This macro will cause the PID linear velocity controllers to be given ramps to acclerate from one velocity to another instead of steps. -posRamp : This macro will cause the linear velocities of RADA to be controlled by position PIDs with ramp reference instead of velocity commands. -If no controller selection is made all controllers revert to PID controllers
All of these macros can be defined simply by uncommenting the corresponding define statement in main.cpp. The macros in the logger.cpp can be seen below:
-ssDrop : This macro puts the logger into packed drop controller mode and logs the correct values for the packet drop controllers. -RADAlqi : This macro puts the logger into full system LQI controller logging mode. -RADAlqi_est : This macro puts the logger into full system LQI controller plus estimator logging mode. -rada_lqg : This puts the logger into full system LQG controller logging mode. -rada_split_lqg : This macro causes the logger to log data about the subsystem LQG controllers. -rada_split_lqg_ol : This cause the system to log data about the pendulum LQG system and the open-loop linear velocity commands. -H2ctrl : This macro causes the logger to log data about the full system H2 controllers. -If no logging mode is selected then the logger will default to logging PID data.
Because the system only calculates controllers for one set of controllers it is important to ensure that the logger is in the correct mode based off of what is defined in main.cpp. As of August 1st, 2016 the defines in main.cpp are not seen in logger.cpp.
Finally in a command prompt navigate to the driectroy: ~/Desktop/rada_research_project/ErisResearchCode/CppProjects/MainProgram_PacketLoss
Here just type: make. The code will compile for your desired mode. FOr setting up a new development directory see Setting up a new development environment from the RADA senior Design wiki.
The corect define