POSTS
TruRow
What does it do?
TruRow uses sensors to measure a rower’s power output in a boat. It takes potentiometer measurements and calculates the angle the oar makes over one stroke and also calculates the force applied to the oarlock itself by the oar. The oar acts as a lever arm, and pushes against the oarlock during a stroke. A load cell is placed on the oarlock to calculate the force applied and the angle and force measurements are used to calculate power output. It’s a kit containing and oarlock with load cell and potentiometer as well as a control box that does all the computation and then outputs to and OLED screen so you can see real time data when you’re rowing.
Who’s done what beforehand?
The Peach system, the standard for rowing around the world, uses a similar system, to calculate angle and power output of multiple rowers. It uses sensors to measure power output and synchronization of rowers in a boat.
Idea is to make a system that uses sensors to measure force, acceleration, and angles and figure out metrics of an individal rower in a boat of several rowers on the water. The plan is to make a pseudo system that is simulated with a resistance band as opposed to water.
The actual peach system puts sensors on the oarlock:
and outputs a ton of data as shown below.
What did you design?
I designed a board that reads potentiometer and load cell data and sends the information to a second board that reads the data and outputs to an OLED screen and the serial monitor. I designed gears that work together and spin the potentiometer according to the oarlock spinning.
What materials and components were used?
Atmega328p, steel pipe, plastic pipe for pivot point, OLED screen, potentiometer, Load cell and amplifier, aluminum oarlock (Waterjet), scrap wood, hot glue, wires, resistors, capacitors, other basic board components.
Where did they come from?
All electronic parts came from EDS with the exception of the load cell and amplifier which came from the CBA.
Other parts were scrap parts found in EDS. Steel pipe from CBA.
How much did they cost?
Basic electronic parts cost ones of dollars. Other scrap parts are on the order of cents because they are scrap parts ()
load cell costs anywhere from 60-70 dollars:
load cell amplifier costs $9.95 from digikey:
Steel pipe costs around 15-20 bucks.
What parts and systems were made?
Main boards were made from scratch. I designed and 3D printed the gears. I waterjetted and designed the oarlock.
Wired together everything into a control box that is placed next to the oarlock so the rower can see when rowing.
What processes were used?
3D printing, waterjetting, milling, soldering, programming, networking, input and output device interaction, lathe, band saw, drilling, other basic manual processes including filing and sanding.
What questions were answered?
Is it possible to make a working system for rowers in a boat for under a few hundred dollars?
- YES!
Can it be real time so the rower can see it when working out?
- YES!
Can they take it with them in a box/kit to their practice?
- Sort of..not waterproofed yet and it’s a bit bulky.
How fast is real time data using serial communication between boards? - Fast! It’s almost exactly real time data.
How was it evaluated?
It’s a very effective system but the calculations and precise mechanical details are not perfect. Those details are quite important in creating a system like this and in order to compete with the peach system. The hardware, software, firmware, and networking all work very well. The mechanical system itself is pretty good for a pseudo system (not in a real boat) but it could be improved quite a bit.
What are the implications?
It was great to complete a project like this in only a few months, but I realized that making these measurements is really hard and it makes sense that the peach system is so expensive. I do, however, think it’s possible to make this system more accurate and actually become a product rowers can use and afford.
First off, what’s rowing?
Final Project: Cost effective peach system for rowers
Here’s a hand wavy drawing of the boat and oar and how the system might interact with the boat:
From there I could make calculations on power from the energy over time. I can calculate energy (work) by solving for force over time.
I realized this entire setup won’t really work because I’m not considering the resistance of the water and I’m only using acceleration of the rower’s body in combination with force on the oarlock. Ideally a system that directly calculates the force of the oar on the water would work best.
A load cell is one way I can calculate the force on the oar directly, but I don’t know how accurately.
The first step of this was to use a potentiometer to get the angle values of the oar over the course of a stroke. I used my board from week5: electronics design to add a pot and do some basic pin readout and print to the serial terminal.
During input week I worked on getting both the load cell and pot to work on one board (so mostly figuring out how to make things work in software and dealing with a new board later)
Here’s the load cell and amplifier:
I soldered to the board and glued header pins to the back (realized milling a new board may have been easier)
This is the whole system with load cell and pot.
This is the output in the serial terminal
The next step is to figure out how to write this data to an SD card, which I’m still working on.
I made Neil’s SD card board and flashed his code to test out reading an SD card which was tricky and buggy but eventually worked.
Timeline:
I’m currently working on getting output from the load cell.
The next step is to work next week on outputting data to an SD card and then plot data/curve on an OLED screen.
Simultaneously I need to work on the mechanical design for the system. I’ll probably bolt the load cell (50 kg) in a steel ring and then bolt that to a wall. I can then sit against the wall and pull the oar against a resistance band. This is all fairly hand wavy and is an urgent step I need to get started on.
I also need to figure out how I’ll include my potentiometer data in the mechanical system. Maybe I’ll tie the pot to something that swivels so I can easily get angle data.
Then I’ll put force and angle into a “black box” and get power output.
My outline of a block diagram for the final project is the following:
Here’s a schematic and board of the first board in the block diagram. It will read inputs from the potentiometer and load cell and then write to an SD card.
I’ll then take that SD card, plug into my laptop, process the data and do all the complex math in matlab/python most likely, and then board number 2 will read the processed data from the SD card and print onto an OLED screen.
I upgraded my boards to have Atmegas instead of Attinys because I needed a lot more space. I chose the Atmega16u4 over the Atmega16u2 because the u4 has several ADC pins and the u2 has none, and I need 3 ADC pins for the pot and load cell.
Before milling I realized I routed a resistor directly underneath the atmel chip. I may have been a little tired that day.
Here’s the updated eagle file.
I milled and soldered the board:
I decided to keep the potentiometer separate and attach it using header pins because it’s likely that I’ll have to move the pot around and I don’t want to have to also move the board around.
I unfortunately spent time debugging and then realized I was using ATxmega 16AU4 vs atmega 16u4. I switched it out but still no results.
Debugging:
Using simple code to test toggling RX pin and nothing happens:
int main(void) {
while(1) {
set(serial_port, serial_pin_out);
output(serial_direction, serial_pin_out);
_delay_ms(1000);
clear(serial_port, serial_pin_out);
_delay_ms(1000);
}
Kept getting the same verification error when flashing the board:
Reading | ################################################## | 100% 0.36s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x0c
avrdude: verification error; content mismatch
avrdude: safemode: Fuses OK (E:F3, H:99, L:5E)
avrdude done. Thank you.
finalbrd.make:30: recipe for target 'program-usbtiny' failed
make: *** [program-usbtiny] Error 1
I tried switching from 20mhz to 8mhz because I read in the datasheet that the max frequency for 2.7V (and my board is running at 3.3) is 8mhz.
From spec section of datasheet: Maximum Frequency – 8MHz at 2.7V - Industrial range – 16MHz at 4.5V - Industrial range
I still got the same verification error. At this point I decided to switch to the 328p because I’ve probably spent too many hours debugging the 16u4 and haven’t gotten anywhere. And life is short.
I re-eagled the board with a 328p on it and milled/soldered again.
New board:
Getting error when making fuses though and nothing prints to the serial monitor, so more debugging to do.
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x07
avrdude: verification error; content mismatch
avrdude: safemode: efuse changed! Was 7, and is now ff
Would you like this fuse to be changed back? [y/n] y
When programming my board to get pot values to read I had to make sure and use AVCC which can be found in the datasheet:
ADMUX |= (1 << 6); //REFS0
ADMUX |= (0 << 7); //REFS1
Now I’m putting my load cell together. I’m getting a million library errors because apparently there’s a file path difference from the last time I used a load cell but it doesn’t make sense because there isn’t actually a difference.
I put the files in a local location vs in a folder and those errors went away but now I’m getting a million more errors specific to the library. So something is quite screwed up here.
I realized I was missing a few commands in my makefile:
PROJECT=hello.ftdi.44.echo_premila_load_cell
SOURCES=$(PROJECT).c $(wildcard arduino_c/*.c*)
MMCU=attiny44
F_CPU = 20000000
CFLAGS=-mmcu=$(MMCU) -Wall -Os -DF_CPU=$(F_CPU) -std=c++11 -I./ -DRADIO_NUM=0 -Wno-write-strings -DARDUINO=162 -I./arduino_headers -fdata-sections -ffunction-sections -Wl,-gc-sections
Also, make sure to specify that you’re using c++ instead of gcc because of the arduino libraries being used.
$(PROJECT).out: $(SOURCES)
avr-c++ $(CFLAGS) -o $(PROJECT).out $(SOURCES)
Then go to the arduino download folder, navigate here and pull the correct header files according to your board specifically for pin_header.h (and then make sure to use the arduino pinout headers that match the board you’re using)
I realized the point of this system is real time data so I skipped the SD card and switched over to serial communication between my boards.
I struggled with this for a while because I was making really simple mistakes- this process is pretty intuitive though. I sent data out from my potentiometer/load cell board on the TX line, which I created new boards to debug more easily (so I could both program and send data at the same time). The second board receives data on the RX line, prints to the OLED, and then sends data to my laptop through an FTDI.
Board 1 writes pot data and load cell data and sends it:
while (1) {
int potValue = readADC(potValue);
serial_putd(potValue);
put_char(&serial_port, serial_pin_out, 10);
_delay_ms(100);
if (scale.is_ready()) {
long reading = scale.read();
serial_putd(reading);
put_char(&serial_port, serial_pin_out, 10); // new line
_delay_ms(100);
}
Board 2 reads the data. prints to the OLED screen and sends to the serial monitor.
while (1) {
int count = 3;
index =0;
chr = 0;
while (chr != 10) {
get_char(&serial_pins, serial_pin_in, &chr);
str[index] = chr;
index ++;
count --;
}
// val = atoi(chr);
str[index] = 0;
OLED7x8string(0,0,"PotVALUE!");
OLED7x8string(2,0,str);
int count1 = 4;
index1 =0;
chr = 0;
while (chr != 10) {
get_char(&serial_pins, serial_pin_in, &chr);
str1[index1] = chr;
index1 ++;
count1 --;
}
str1[index1] = 0;
OLED7x8string(4,0,"Load Cell");
OLED7x8string(6,0,str1);
put_string(&serial_port, serial_pin_out, str);
put_string(&serial_port, serial_pin_out, str1);
The original workflow was this:
Breaking out GND, VCC, TX and RX pins in order to both program and send/receive data. It became annoying after a few hours of debugging.
Made new boards to help fix that.
I 3D printed parts for my system. I needed two gears to get the potentiometer to twist in relation to the oarlock twisting.
I used the lathe to make a pivot point for my oarlock.
Lathe:
I drilled my oarlock to fit the part I just cut:
I attached my potentiometer to my gear to attach to the oarlock:
Here’s the final setup with the parts assembled. The oarlock sits on the pivot point and the gears are attached accordingly, and the boards and wired up so that I can capture data from both input devices and output to my OLED in the ‘control’ box beneath.
Here are my final boards and the final system:
My data being printed serially to my oled screen
I added some wooden blocks around the steel pipe in order to stop it from moving in and out of the oarlock- a key point in rowing. Power needs to be directly in the horizontal x direction for efficiency.
Here’s the final system setup.
Here’s the final wiring/soldering to clean up the control box:
I’m demonstrating using the system here: