Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

13
Wireless Internet Enabled Device for the Recording of Exercise Performance on Home Fitness Equipment Overview This describes the use and operation of a device that connects a slightly modified plate selectorized type of home gym equipment via a wireless home network to a remote web host. The idea is that the device records important workout parameters such as weight used, reps performed, time spent exercising and detailed range-of-motion data for the exercises being performed on the fitness machine while guiding the user through a custom designed workout. The device is connected to the user’s wireless router via its own built-in wireless web-server and communicates with a remote web server over the Internet via the TCP/IP protocol. The remote web host functions as an information/service hub for the exercise equipment user by providing web based applications to manage and design their workouts, graphically view the completed workout data, view all previous workouts and receive guidance and help from online personal trainers. The device employs an 8-bit microcontroller to monitor and store data from an 8-bit incremental magnetic rotary encoder that reads the main weight stack pulley, and an IR emitter/detector combo positioned just above the weight stack. The rotary encoder is used to track the position of the weight stack, while the IR sensors are used to determine how much weight is being moved during the performance of an exercise.

Transcript of Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

Page 1: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

Wireless Internet Enabled Device for the Recording of Exercise Performance on Home Fitness Equipment

Overview

This describes the use and operation of a device that connects a slightly modified plate selectorized type of home gym equipment via a wireless home network to a remote web host. The idea is that the device records important workout parameters such as weight used, reps performed, time spent exercising and detailed range-of-motion data for the exercises being performed on the fitness machine while guiding the user through a custom designed workout. The device is connected to the user’s wireless router via its own built-in wireless web-server and communicates with a remote web server over the Internet via the TCP/IP protocol.

The remote web host functions as an information/service hub for the exercise equipment user by providing web based applications to manage and design their workouts, graphically view the completed workout data, view all previous workouts and receive guidance and help from online personal trainers.

The device employs an 8-bit microcontroller to monitor and store data from an 8-bit incremental magnetic rotary encoder that reads the main weight stack pulley, and an IR emitter/detector combo positioned just above the weight stack. The rotary encoder is used to track the position of the weight stack, while the IR sensors are used to determine how much weight is being moved during the performance of an exercise.

The data is collected during the entirety of the workout session, and then sent over the internet via a wireless/wired embedded web server. The embedded web server is DHCP capable so that it will work with most home WiFi networks, or can employ the use of a Cat-5 cable to connect to a home router. Broadband service is required for this system to work.

The typical use and operation of the system would be as follows:

The user logs into the website and creates an online profile for their device. This only needs to be done once.

The user creates one of up to 4 custom workout files using the Workout Designer software app. These workout files contain the exercises, weights and repetitions that the

Page 2: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

user wishes to perform for their workouts. This could also be done by a certified online personal trainer as an additional service.

The user’s profile residing on the remote web host will track their completed workouts and their custom workouts to be downloaded to their fitness machine device.

The user logs off and turns on the fitness machine device in preparation for a workout.

The fitness machine device connects to the user’s home wireless router and logs on to the remote web host.

The fitness machine downloads up to 4 profiles stored on the remote web server and displays them to the user.

The user selects the appropriate profile, at which time the device “looks” for custom workout files stored in the user’s directory and downloads any custom workout files present for that user profile.

The device disconnects from the remote web server.

The user selects which workout they wish to perform using the fitness machine device.

The exercise to be performed, how many reps and how much weight to use is displayed on a large 80 character LCD screen.

As soon as exercise is initiated the fitness device begins tracking and recording the weight, the range of motion and calculates the number of reps performed.

On completion of the workout, the fitness device automatically re-connects to the remote web server and downloads all the recorded exercise parameters to a data file in the user’s directory.

The data file is then automatically converted to an XML formatted file for reading by the FitView Software.

The device disconnects from the remote web server and the user can now power down the device.

The user can now log onto the remote web server with his/her home computer and view charts and graphs of his/her completed workout, past workouts, goals etc.

The completed workout can also be viewed and analyzed by a qualified fitness trainer to help guide their client’s progress.

Page 3: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

Fitness Device Features

Designed to be fitted to most single weight stack home multi-gyms with minimal modification of the equipment’s design

System has built-in wireless 11mpbs networking capability with full data encryption capability (WPA, WEP) as well as DHCP for compatibility with most home wireless routers.

Device can track range of motion accurately to within a degree, depending on the exercise performed - suitable for physical therapy.

Device accurately counts repetitions after each set and has a set time-out feature.

Device uses low cost components to minimize costs. No expensive processors or flash memory are used.

High quality, large LCD display used to view and control device. Custom characters and graphics can be easily developed for the device.

Use of XML files allows completed workout data to be ported to other applications for viewing.

Theory of Operation

The device is essentially an 8-bit microcontroller data acquisition system that uses an embedded wireless device server to provide TCP/IP communications. The embedded server used for the prototype is a Lantronix WiPort. The device monitors the various sensors in real-time at a rate of 2 KHz while driving an intelligent serial LCD display. The microcontroller communicates via RS232 with the LCD and WiPort at a rate of 19.2 K Baud.

The device uses an 8-bit magnetic rotary encoder that reads the position of the main weight stack pulley and an IR emitter/receiver pair that reads the number of plates being used for exercise. The sensors are interfaced to the port pins of an Atmel 89s8252 8-bit microcontroller. The microcontroller uses these sensors to compute the range-of-motion, weight used, repetitions performed and the initiation and completion of each set. The data is recorded in an external 64kbyte (32kbyte used in prototype) SRAM IC. The microcontroller uses an 8-bit bidirectional data/addressing bus tied to a ‘373 type latch to address/read/write data to the SRAM.

Page 4: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

For the prototype system, the WiPort is mounted on a separate board (evaluation board) that has its own 3.3vdc power supply. To communicate with the WiPort board, the microcontroller requires an RS232 level converter chip, such as the MAX202. A production system would house all components on the same board, probably using 3.3vdc power for all components. The RS232 Transceiver should not be required at that point.

The prototype currently uses a 16 character by 2 line intelligent serial LCD display to act as the fitness machine information display. This display is capable of displaying alphanumeric information as well as some crude graphics. It is currently planned that a larger 20 character by 4 line LCD would be used in a production device.

Software

The microcontroller controls all functions of the device except for the TCP/IP Wireless communications. This includes sending characters to the LCD, controlling the external SRAM, reading the sensors and keypad, and performing the necessary calculations.

The microcontroller software is written in assembly because of the limited program memory of the 8051 architecture chip. The program operates as follows:

Perform check of external SRAM by writing 55h to every address and then reading it back

Command the WiPort to connect to WLAN and to remote internet host

Query the remote host for all profiles associated with device and store the profiles in SRAM.

Display profile names on LCD and read keyboard so user can select proper profile

Download the applicable custom workout from remote internet host

Disconnect from remote host.

Sensors

There are currently two main types of sensors used for reading data from the exercise machine:

Austria Microsystems AS5305 8-bit incremental magnetic rotary encoder for the main weight stack pulley.

IR Emitter/Receiver pair is used to read the number of weight stack plates.

Page 5: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

Reading Position of the Pulley

The magnetic rotary encoder is read at a rate of approximately 2000 Hz through two port pins of the micro. The port pins are read at all times in order to determine whether a set has commenced. Once the encoder count has exceeded a set threshold the micro software enters into the main encoder read routine. At this point the LED control port pin is brought LOW, which turns on the IR LED for the weight stack plate reader (explained later.)

The encoder read routine reads the encoder inputs and increments, decrements or does nothing to the 16 bit counter. This is accomplished at a rate of 2000 Hz. While this is occurring, another count tracks how many encoder reads take place. Once 75 read loops take place, the 16 bit counter is divided by 6 and the result is stored in the external SRAM. This results in a stored sample rate of 27Hz.

During the encoder read routine the 16 bit counter is checked after every read to see if it is under the timeout threshold count. If the count is under the threshold a timeout count is initiated in the timeout loop. The timeout count currently lasts 4 seconds, that is if the weight stack is at rest for 4 seconds, the set is considered over. If the 16 bit counter count exceeds the threshold count during the timeout period, the timeout routine is exited and the main encoder read routine is re-entered.

Reading Number of Plates

During the encoder read routine the IR LED is used along with the IR Detector to read the number of plates in motion. The plates are only scanned once during each set. At the beginning of the encoder read routine when the IR LED is turned on by clearing the port pin connected to the base of the PNP transistor. The IR LED is aimed at the IR detector positioned on the other side of the plates. This causes the detector to conduct and put a low on the micro port pin. As the plates move up, the detector is blocked from the IR source and turns off, putting a high on the port pin. During the time the port pin is high, the encoder count is stored in a temp register until the port pin is again low (the plates have passed the IR emitter/detector, unblocking the IR beam.)

A flag is set to prevent the plates from being read more than once during a set. The count in the temp register is then divided by 2 to ensure an 8-bit result and stored in SRAM as the weight plate index used to later compute the amount of weight used for that set. The IR LED is turned off after the plates are read by bringing the micro port pin going to the PNP transistor high.

The 8 bit value that results from the weight stack read will typically fall into a range of numbers for a given number of plates. For example, for one set two plates may give a value of 31. For the next set a value of 30 may result. This requires that a lookup table

Page 6: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

be used in the microcontroller software that converts these ranges of numbers into consistent plate values of 1, 2, 3 and so on. Thus for a 15 plate system, a 15 would be the value stored in SRAM if all plates are used for a set. This way the web based software can be tailored to give an actual weight value (i.e. say 225 lbs) based on how much a plate weighs for that specific machine. Thus, the data sent by the fitness machine simply states how many plates were used; it is up to the web based software to figure out how much weight that translates to.

Next Steps

New Pulley / Encoder System

The problem with the pulley/encoder setup used in the development system is that a complex arrangement of a pulley keyed to a rotating shaft must be used in order for the Austria Microsystems magnetic encoder to be used. The keyed pulley/shaft also requires expensive roller bearing blocks and shaft collars to keep everything stationary in the horizontal plane. A much better setup would be to use a typical exercise machine pulley rotating on a bolt so that a minimum of modification is required to the exercise machine.

In order to make the standard pulley setup possible, metallic strips must be glued to the pulley, and two inductive sensors placed near the pulley. The inductive sensors must be

Page 7: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

positioned in such a way as to cause a 90 degree phase difference in the readings of the two sensors. This is allows the system to function as an incremental rotary encoder using quadrature and is easy to integrate into the current fitness device system.

Pictures/Diagrams:

Figure 1: Machine in development of device

Page 8: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

Figure 2: New main pulley with magnetic rotary encoder on right

Page 9: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

Figure 3: Example of small LCD display

Figure 4: Development machine

Page 10: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

Figure 5: Breadboard and LCD/Keypad box

Page 11: Internet Enabled Device For The Recording of Exercise Performance on Home Fitness Equipment

Figure 6: Schematic 1 of device main board