LabVIEW Coding

 

The LabVIEW coding was of course essential to the entire project, because without proper programming the rest of the system would become useless. Even with the sensors mounted, wired, and working properly, without a running program it would be impossible to obtain any useful data.

In the early planning stages of the project it was decided what should be included in the program in order to allow the user to use the product and get data that was meaningful to them. Ultimately, the main focus of the program was to output force data from each sensor, as well as the combined total force output. The group also wanted to include a diagram of the foot that had different areas overlaid with colored squares. These squares would correspond to the different sensors on the insole and change color depending on the amount of force exerted on each sensor. This type of visual display would be easier for the user to understand, and could be viewed in real-time as the user was running. In addition to the aforementioned outputs, resistance and voltage graphs would be included so that the integrity of the sensors could be checked at any time.

Figure 25 : LabVIEW Coding Flow Diagram

 

Programming Approach

 

There were eight different sensors, but the programming for each would be almost identical. Thus the first step was to figure out the programming for just one of the sensors. The programming for one sensor was then broken into its separate parts: VI configuration, conversion of raw data to voltage, conversion to a load, and display of colored squares (on foot diagram) according to load applied on the sensor.

The VI (virtual instrument) had to be configured within LabVIEW in order to obtain the raw resistance data from the sensor. The VI was configured to obtain the sensor's analog data and convert it to digital data that could be manipulated in the LabVIEW programming language. Configuring the VI also required determining which ports on the National Instruments connector block to plug the sensor outputs to. Besides this other options had to be determined to complete the configuration, including the number of samples to be taken and the sampling rate (in Hz).

Once the VI was configured, the resistance data could be converted to a voltage. The voltage that would be calculated represents the voltage out from the Wheatstone Bridge, since the sensors only output resistance. The voltage out was easily calculated from the Wheatstone Bridge equation:

 

Where Vin is the voltage input from the battery (9V), R1 through R3 are the known resistors of the Wheatstone Bridge, and Rg is the resistance of the sensor.

To convert the signal to a load, calibration of the sensors was necessary. Unfortunately this had to be done because the correlation provided by the sensor providers (Interlink Electronics) proved to be inaccurate. The group learned this when we placed different known weights onto the sensors and did not get the resistance, voltage, or force values that were expected. Thus we created our own equations for the sensors by placing two known weights on the sensors, and modeling the resistance curve as (where y is the resistance in ohms, and x is the mass of the weight in grams). With the weight on the sensor, the resistance was directly observed from the VI, and the mass and resistance were plugged back in for y and x . Canceling C out of the two equations gives:

 

 

Since n is the only unknown it can be solved for. Once n is known, C can be solved for. Three equations were found for each different size sensor:

 

 

Once the equations were established they were implemented in LabVIEW to convert the resistance to a mass, which was then converted to a load (lbs).

Once the loads were known, attention was focused on implementing the foot diagram with the colored squares. Eight square pictures were created and laid onto the original picture of the foot. These squares changed color depending on the weight applied to the sensor. From low to high loading the color scheme is: dark blue, light blue, green, yellow, orange, and red.

The completion of all of these tasks was then repeated for the other seven sensors. After all of the sensors were programmed, the load values from each sensor were added together to find the total load.

Figure 26 : LabVIEW User Panel

The above picture is a screen shot of the front end of the program. There is a start and stop button, a visual display of the load vs. time, and foot diagram with color coded loading.