P08027: Wireless Assistive Control System


Table of Contents

This section discusses debugging the BioRadio.

BioRadio setup

  1. Initially install the BioRadio software.
  2. Setup the Amplifier gain and sampling
  3. Open the labview file.
  4. Place the probes on the necessary muscles for driving the car.
  5. Turn the car on
  6. Run the labview code, the user should be able to simulate muscle movements in order to move the car.

Debugging in Matlab

In developing the GUI in MATLAB, there were a few problems that are worth noting to ensure a better understanding as to why it works the way it does. The major problems dealt with the text box, data collection time, the first enabled channel, saving the data, and recognizing the correct USB port that the BioRadio is connected to.

The first problem encountered was with the text display located above the graph of the signals on the GUI. This text was put there to describe the action to be preformed by the user when a specific button was pushed. The issue was that the text was not changing when the buttons were pressed. By doing some research on the MATLAB uicontrol properties, it was discovered that the problem was in the 'Style' assignment in BioRadio_SDK_Matlab\guiVi.m (located under Testing and Refinement, on the Home node, in the MATLAB Data Collection Link)on Line 65. This is where the text panel in generated for the GUI. The assignment, which is the string immediately following the 'Style' string, was originally 'text'. The text property doesn't allow for any changes in a callback routine (type help uicontrol into the MATLAB prompt, click the link to the doc uicontrol, find the first mention of the word 'text' for further description). Therefore, to be able to change it, the Style property was changed to 'edit'. This allowed for the text to change when the one of the buttons was pressed thus invoking a the callback routine BioRadio_SDK_Matlab\button_callback.m. However, this property also allows the user to directly click on the text box on the GUI and type in changes. This was not a concern since the GUI would be mostly used by group members that would avoid changing the text box that way.

The second problem with the GUI development was providing the ability to collect data for a specified finite amount of time. The issue arose from how the connection, data collection, and disconnection process of the BioRadio150 with MATLAB. In general the functions available when executed simply either start recording data or stop recording without any reference to time. Using that method, the user would need to press a button to start then press another to stop data collection. To avoid this, a counter was placed in the BioRadio_SDK_Matlab\collectdata.m function so that the specified time indicated in the Time and Units fields on the GUI would be the time between when the data collection began and when it ended. The counter was implemented using the tic toc functions in MATLAB in which tic begins the timer and toc retrieves the elapsed time. Because of how the information in the time field is collected, only whole numbers can be entered into the field i.e. no decimals or fractions. This was also not a huge concern since all of our data was to be collected in terms of seconds.

Another problem dealt with the first enabled channel on the BioRadio. Further description of this problem is discussed the Debugging the BioRadio section. In the MATLAB GUI it meant simply creating the configure files in BioRadio Capture Lite (the program that came with the installation of the BioRadio) such that it would enable five channels, but only the last four channels' data would be saved and plotted.

A fourth problem, that come up during the fatigue testing, was that the excel files that the MATLAB program would be saving all the data to could not save more than about 20 seconds worth of data using our sampling rate of 960Hz. This problem was easily solved by having the program save all the data to a mat file instead. MATLAB can write more data to a mat file than an excel file and the data can also be more explicitly labeled within the file. The naming convention of the data and mat files is further explained in the MATLAB Data Collection section.

Another issue occurred when the port that the BioRadio was connected to changed. Initially, the port name was hard coded into the program. However, to eliminate confusion and allow for the program to work on any computer with the proper software and hardware requirements, an additional prompt was added to the start up of the GUI asking for the port name which the BioRadio is connected to.

Debugging the BioRadio

Aside from some issues with Labview and Matlab, there were some issues with the BioRadio in general.

BioRadio Latency issues

When working with the BioRadio, there can be an issue of it timing out. This meaning that the device will stop communicating with the computer and there will be about 5 seconds before the two devices sync up again.

Image:../bioradio/latency timer.JPG

This problem was solved by changing the latency timer from 16msecs to 1msec on the USB port. The following document can be used as a guide to change the latency.

BioRadio Channel 1 Issues

There was always something odd about channel one with the BioRadio.

Image:../bioradio/Channel Issue.JPG

Channel 1 is the white (thumb) and channel 2 is red (forearm). As you can see, the red signal seems to be something like the integral of channel 1. At first glance this was feared to be crosstalk. Cross talk is the issue where when a person moves one muscle, there is a biopotential for that muscle and another one. When we selected the muscles, we choose them to avoid crosstalk so the team examined the problem more throughly.

After further observation, it was seen that only channels 1 & 2 had the crosstalk problem. This was odd because the same muscles were used on each arm. To try to isolate the problem, the wires for channels 1 and 5 were swapped. After the swap, the same following error appeared. This proved the thought of crosstalk as incorrect, but that still left the signal following problem in software.

Next, the configuration file was changed to use channels 2 and 3 instead of 1 and 2. This would prove if there was an error with channel 1. With this change, the error was still there. This means that the first enabled channel might have an error.

Finally, channels 1,2, and 3 were enabled and channel 1 was not connected. This configuration proved to work.