Running an Experiment - Carleton-SRCL/SPOT GitHub Wiki

Assuming you have successfully performed a simulation and the system behaves as expected, you are now ready to try an experiment. This page will describe the procedure that must be generally followed to conduct an experiment using SPOT.

  1. Turn on the platforms that you plan to use in the experiment. This is done using the power panel on each platform:

image

  1. Once the platforms are on, ensure that the LED on the power panel is BLUE, as shown in the above image. This indicates that the platform has good communication with the emergency stop button, and that the emergency stop is not engaged.

  2. Return to the ground station and the SPOT GUI. You may now navigate to the Direct Hardware Control tab. In this tab, users can directly control each of the platforms. Click on the Step #8: Establish Connection with Selected Platforms button. This will open communication with the platforms that you selected in the Initialize Parameters tab. If successful, you will see the indicator next to the button go green. At this time, this is not a real-time ping and thus you will not be notified if the connection is lost.

image

  1. At this point, the live controls for all of the selected platforms should be enabled, as shown:

image

Each of the platforms has the same controls:

Pucks On: This actuates the valve for the air bearings, which allows the platform to float on the table.

Pucks Off: This turns off the air bearings, causes the platforms to no longer float on the table.

Ping Jetson Xavier: This uses the "ping" command to check if the platform computer is properly turned on. If the computer can be pinged, then the LED will illuminate.

Fire Thrusters in Sequence: This button fires the 8 thrusters on the platform in order (1,2,3...).

Cycle GPIOs ON/OFF: This button cycles the enable state for all of the GPIO pins. This is good for debugging.

Open Remote SSH Command Shell: This button establishes a remote connection via SSH to the target platform. From this terminal, you can send any Linux commands you normally would if you were directly controlling the Jetsons.

There is also an Extras panel, which contains a button to Refresh Software on Platforms. This button completely wipes the MATLAB_ws directory from the computers. If things are running SLOW, you can use this to clean things up. THIS WILL CLEAR ALL EXPERIMENT DATA ON THE PLATFORMS, so make sure you have made a backup!

  1. Follow laboratory preparation procedures to fold the table cover, clean the table, and clean the platform pucks. Recall that to clean the pucks, the platforms must have Pucks ON. Also ensure you have a fundamental understanding of how the emergency stop system works. Always remember that experiments should generally be conducted in pairs, unless you have significant experience.

  2. Once the platforms have been prepared, ensure that all active platforms have air flowing through the bearings, i.e. that "Pucks ON" has been clicked.

  3. Carefully place the active platforms on their approximate initial positions as defined in the GUI. If you do not position the platforms near their initial locations, they will attempt to get there during Phase #2 of the experiment. If their initial location is far enough from their drop location, depending on your gains there may be an overshoot and the platforms could potentially fall of the table. Be vigilant!

  4. After placing one platform, ensure that you have clicked Pucks OFF in the GUI, so that the platform sits down on the table and does not move. Once the first platform is in position, you may place the second platform, then the third (if required).

  5. Once you are satisfied with your experiment setup, you can now move on to the Setup & Run Experiments tab. In this tab, you have all of the controls and visuals you need when running an experiment. Note that you also have a button called Step #8: Establish Connection with Selected Platforms; this button is identical to the one in the Direct Hardware Control tab. You do not need to press it again unless you have lost communication with the hardware, or if the platforms are already on the table.

image

  1. Also in this tab is the Experiment Controls panel:

image

Inside this panel, you have a button called Build Code. When you are ready to deploy your Simulink diagram, simply click this button. This process can take anywhere from 1 to 10 minutes depending on the complexity of your code. The default template should compile in about about 2 minutes (usually). You can monitor the progress of the build procedure in the MATLAB command window. Any errors will also appear here.

  1. Assuming the code has built properly, the next step is to enable the PhaseSpace cameras. The toggle to do so is located right below the Build Code button. Set the toggle for PhaseSpace Cameras to On. You should see the cameras light up, and after a few seconds the LEDs on the platforms should illuminate. You should also see the LED on the GUI illuminate:

image

You will also see a terminal open up and it will display the following information if the cameras are working correctly:

image

Once the cameras are connected, you will also notice a few other things. Below the Experiment Controls panel is a Real-Time PhaseSpace Data panel. This panel allows users to see real-time data from the experiment, which can be useful for troubleshooting. With the live data enabled, you will also get a real-time visualization of the experiment in the Real-Time Visualization panel. If you want to disable real-time data for any reason, just toggle the Enable Real-Time Telemetry switch to Off.

  1. Once the cameras are ON and the code has been deployed, you are ready to start the experiment. Communicate with your lab partner regarding what you expect to happen, and ensure that all sides of the table are covered by someone.

IN AN EMERGENCY, get control of the platforms FIRST. Once you are sure the platforms will not leave the table, you can have someone press the e-stop, and then you can stop the experiment.

  1. To start an experiment, click on the "Start Experiment" button. As soon as you press the button, the internal clock for the experiment will start counting up. By default, the platforms should:
  • Start floating after 10 seconds (Phase #0);
  • Hold a float for 5 seconds (Phase #1);
  • Navigate to their initial positions over a period of 30 seconds (Phase #2);
  • RED & BLUE will track a circle around the center point of the table while BLACK spins in the center at a constant rate, all over 170 seconds (Phase #3);
  • Go to the home position over a period of 30 seconds (Phase #4);
  • Hold the home position for a period of 20 seconds (Phase #5);
  • Turn off the pucks and thrusters;
  1. Once the platforms have stopped floating, you can terminate the experiment by clicking on the "Stop Experiment" button. If the experiment has been successfully ended, the LEDs will turn off.

IF EVER THE GUI IS NOT RESPONDING, HIT CTRL-C IN THE MATLAB COMMAND WINDOW.

  1. Once the LEDs are OFF, only now can you save the experiment data. If you try to save the data too early, you can corrupt and lose the data. When you click on "Save Experiment" it will grab the text files from the platforms (ExpLog*.csv), will import them into MATLAB and convert them into structures, and will save them in separate time-stamped folders under Saved Data.

Congratulations! You've completed your first experiment! You can load in the .mat files into the Data Inspector to see your results at a glance. Feel free to write your own visualization script though! Download this folder for a sample post-processing script - this folder contains saved data for the default experiment and was conducted on September 8th, 2023. When you run the script, you will see 9 plots showing the position and attitude tracking performance for all platforms. You will also notice that the comparison between simulation and experiment - while good - is far from perfect. This is a good time to point out that when you run a simulation and it works, you may then run an experiment and observe differences. Sometimes, these differences can be substantial for any number of reasons.

If you run an experiment and it does not behave like the simulation, do check the Frequently Asked Questions section of this Wiki (located on the Home page). You may find that your issue is known and has a workaround or an explanation.

If this is the end of the day and you need to clean up, follow the shutdown procedure and end of day cleanup.

If you noticed off-nominal behaviour of the laboratory, please update the Current Laboratory Status page or report the behaviour so that others may be notified and repairs may be scheduled.

Click here to go HOME