Developing a Virtual Personal Trainer With LabVIEW

  Print Print

"Using LabVIEW, I was able to create a project of a far higher standard than could have been reached with other programming environments in the same time frame. The more I used LabVIEW, the more I grew to appreciate and utilise its vast array of possibilities."

- Martin O'Reilly , N.U.I. Galway

The Challenge:
Reducing the risk of injury and strain to athletes during weight training by ensuring that they maintain good form and technique during exercises.

The Solution:
Using an application written with NI LabVIEW software to guide the user through an exercise routine and streaming data from body-mounted kinematic sensors to provide both real-time and long-term feedback and motivation.

Author(s):
Martin O'Reilly - N.U.I. Galway

The benefits of training with weights for athletes are extensive and far-reaching. Weight, or resistance, training leads to better athletic performance, builds muscle strength and endurance, and reduces the risk of injury. These benefits also extend to the wider population. There is evidence of a higher quality of life in elderly people who have practised appropriate resistance training throughout their lives. This form of training reduces muscle atrophy so they have more strength to carry out day-to-day activities. 

However, those exercising have had to rely on self-observation and memory in order to ensure that they were maintaining good form throughout their training. This can be unreliable due to lack of training knowledge or focus. Examples of poor form include curving the spine, lifting weights that are too heavy, or moving too quickly through exercises. Poor form increases risk of injury and long-term muscle damage.

To combat these risks, I developed the Virtual Personal Trainer application as my final year project at NUI Galway. The Virtual Personal Trainer helps users without access to a personal trainer to monitor and develop their training sessions. 

The system I developed uses Shimmer™ 9DoF kinematic sensors, which a user can wear. These sensors stream real-time data to a LabVIEW application, using Bluetooth, via the Shimmer LabVIEW drivers. The LabVIEW application acts as the user’s personal strength and conditioning trainer, guiding the user through a goal-specific exercise routine and delivering real-time feedback on training technique and long-term feedback and motivation regarding progress toward training goals.

The System

At the core of the application are the signal analysis and complex 3D joint angle calculations using inertial sensor signals. Each algorithm incorporates a whole range of actions, including in-gym data collection, data analysis, algorithm prototyping, testing, and algorithm evaluation.

 

Figure 1. The easy-to-build user interfaces on LabVIEW give the user real-time feedback.

 

LabVIEW served as the perfect software development tool to reach a large variety of project milestones in my development of the Virtual Personal Trainer. I used the Shimmer LabVIEW Library to develop, test, edit, and evaluate a range of advanced analysis algorithms. In the program, I use the accelerometer, gyroscope, and magnetometer data to compute 2D and 3D body segment inclination and joint angles. I could do this quickly and efficiently with built-in filter libraries and array manipulation tools available in LabVIEW. Another algorithm records the number of exercise repetitions a user completes and offers goal-specific targets such as what weight the user should now be able to lift. Another algorithm monitors the user’s tempo of movement and timing of concentric and eccentric muscular contractions and provides guidance on exercise speed. The user receives feedback on the exact moves done in each repetition of an exercise. The system also detects dangerous movements and updates the user with warnings about these as well as long-term feedback to highlight increases in strength over time.

 

Figure 2. The system accurately tracks bicep curl repetitions and movement.

Developing the Program

I took advantage of the inherent multithreading functionality of LabVIEW to set up the program with a series of parallel tasks, each organised to coordinate a different function of my program. I used the built-in synchronisation functions in LabVIEW, such as queues and notifiers, to share data and settings between these loops, whilst preserving true parallelism.

  1. I used a data acquisition loop to configure, acquire, and synchronise data sent from the Shimmer sensors using Bluetooth packets through the communication ports on my PC. This data was then sent to a graphics loop, which I used to visualise on-screen the orientation of a Shimmer device when connected.

 

Figure 3. Using the Shimmer drivers, LabVIEW can accurately mirror the inclination and orientation of the Shimmer device in motion.

 

  1. I used a second loop to calibrate the raw sensor data, filter it appropriately, and compute each sensor’s real-world position.

 

Figure 4. Users can calibrate raw sensor data with native LabVIEW functions.

 

  1. The Exercise Analysis Loop configured the user interface to guide the user through each exercise and delivered real-time feedback. LabVIEW was incredibly useful and intuitive during the development of an aesthetically pleasing user interface and offered the user clear and easy-to-receive feedback. I wanted to mimic the rapport a real personal trainer builds with a client, so the feedback changes and becomes more tailored throughout exercise.

 

Figure 5. LabVIEW made it easy to develop an intuitive and immersive user interface.

Major Results

The comprehensive and accurate feedback from the Virtual Strength Trainer proved to have a huge effect on the accuracy and safety of the users’ movements when tested on both elite athletes and inexperienced volunteers. Ten participants from each experience level tested the application once it had been built. The number of dangerous knee and back positions performed by the group went down by almost half after they were given access to the application, as compared to ordinary self-observation. This was true for all participants, regardless of previous experience levels.

 

Figure 6. These feedback results show the application’s effectiveness.

 

The Personal Trainer of the Future

Project development time was six months, working around the rest of my undergraduate studies. Using LabVIEW, I was able to create a project of a far higher standard than could have been reached with other programming environments in the same time frame. The more I used LabVIEW, the more I grew to appreciate and utilise its vast array of possibilities.

The application is fully functional, as verified by the system evaluation by twenty subjects. I will continue to use my new LabVIEW expertise as I undertake my doctorate at University College Dublin. My doctorate will focus on further developing the Virtual Strength Trainer by researching opportunities to make the sensor set suitable for all users in all environments, thereby delivering a cost-effective, noninvasive physical training solution. To refine my system, I will use the latest Shimmer3 technology, LabVIEW for testing and data collection, and the NI Data Dashboard for LabVIEW application to produce a smart phone or tablet interface for the personal training system.

Author Information:
Martin O'Reilly
N.U.I. Galway
Rathgar
Dublin 6
Ireland
moreilly91@gmail.com

Bookmark and Share


Explore the NI Developer Community

Discover and collaborate on the latest example code and tutorials with a worldwide community of engineers and scientists.

‌Check‌ out‌ the‌ NI‌ Community


Who is National Instruments?

National Instruments provides a graphical system design platform for test, control, and embedded design applications that is transforming the way engineers and scientists design, prototype, and deploy systems.

‌Learn‌ more‌ about‌ NI