http://s18.postimg.org/ghj7hcndl/img.png
Analyzing and debugging live data is a crucial part of robotics. VCAT robotics has been working on a way of getting live data from the vex cortex without the need for any extra electronics. In order to do so, we needed to use the UART0 channel to transmit data from the cortex to the PC. This can be done wirelessly via the vex Joystick, or wired via USB to the cortex. This means live data can be viewed during competition. This is legal in VEX U; I’m not sure about VRC.
This method of sending data is based on JPearman’s example below:
https://vexforum.com/showpost.php?p=319321&postcount=125
By using this method we send 20 variables to the seral port of the PC, we later interpret those 20 variables via a matlab GUI.
Here is the GUI in action. In this video the cortex was sending dummy sine waves.
https://www.youtube.com/watch?v=oAh3lp9VWAE
Features of VDAQ:
-
Live Debug, Plot of up to 20 variables
-
Save graph as PNG
-
Export data as a CSV file.
-
Getting everything to work:
-
RobotC – Download Cortex code to robot
https://goo.gl/YHj2G6
It is important to note that because we are using UART0 we have to be able to enable or disable data being sent. Mainly because UART0 needs to be clear if we want to download new code or have RobotC debug functions open. Once you are done downloading code and close debugger, you can turn on you data. In my example we used a limit switch to turn ON/OFF data.
-
Have matlab already installed? (Tested on R2013a)
If you already have matlab installed just open main.m and hit the play button at the top. make sure main.fig is also on the same folder.
https://goo.gl/gAC1zK -
No matlab
Install their Runtime library (R2013a 8.1)
http://www.mathworks.com/products/compiler/mcr/
Then just run the 64Bit exe. (32Bit will be available later on)
[https://goo.gl/XIo5AN
Once everything is ready to go and GUI is open
-Select the COM port your vex device is connected to from the available devices
-If you don’t know it, you can open computer management and click on device manager. Expand Port (COM & LPT), and your COM port should be shown here.
- Select Variables you want to graph
- You can select multiple variables by using CTRL key
- Click Connect
- Once connected, a green RECEIVING will be display under the connect button.
- If it says NO VEX DATA then you probably forgot to turn on data on the cortex (Limit Switch)
- You can change variables that you want plotted live as well.
Save Graph Button: Saves an image of the current graph
Export Data: Saves ALL the data received for ALL variables in a CSV file.](https://goo.gl/XIo5AN)