Turbo Trainer Generator

Introduction: Turbo Trainer Generator

About: Did Physics for my undergraduate, absolutely love building things particularly electronics projects

Generating electricity by pedal power has always fascinated me. Here's my take on it.

Step 1: Unique Selling Point

I’m using a VESC6 motor controller and a 192KV outrunner working as a regenerative brake. This is fairly unique as pedal generators go but there’s a further part to this project that I think is novel.

When cycling on the road you have inertia and this keeps the rotation of the pedals very constant throughout a revolution. Turbo trainers have very little inertia so when pushing on the pedals the wheel accelerates/decelerates quickly and this feels unnatural. Flywheels are employed in an attempt to smooth out these speed fluctuations. Stationary bike trainers weigh a tonne for this reason.

I have thought up an alternative solution to this problem. The motor controller is configured to spin the outrunner in “constant speed mode”. The Arduino connects to the VESC6 via UART and reads the motor current (which is directly proportional to wheel torque). The Arduino adjusts the motor RPM setpoint gradually to simulate the inertia and drag you’d experience cycling on a road. It can even simulate freewheeling down a hill by operating as a motor to keep the wheel spinning.

It works brilliantly as evidenced by the graph above showing the motor RPM. I stopped cycling just before 2105 seconds. You can see over the next 8 seconds, the wheel speed gradually decays just like it would if you stopped pedalling up a slight incline.

There still are very slight speed variations with the pedal strokes. But that’s also true to life and simulated correctly.

Step 2: Testing Power Output

Cycling is the most effective way of doing mechanical work. I used the VESC tool to measure real time power output. I zeroed the readings before cycling for exactly 2 minutes. I pedalled at an intensity that I think I could have maintained for about 30 minutes.

After 2 minutes you can see I produced 6.15 Wh. Which corresponds to an average power output of 185 W. I think that’s fairly good given the losses involved.

You can see the motor currents in the graph above. They are rapidly adjusted by the VESC6 to maintain a constant motor RPM despite the fluctuating torque exerted by the pedalling.

When the pedalling stops the motor starts consuming a tiny bit of power to keep the wheel spinning. At least until the Arduino notices you're not pedalling and stops the motor altogether. The battery current appears to be almost zero just before shutdown so the power must be at most a couple watts to actually spin the wheel actively.

Step 3: Looking at the Efficiency

Using the VESC6 improves the efficiency hugely. It converts the motor’s AC power to DC power considerably better than a full bridge rectifier. I reckon it’s over 95% efficient.

The friction drive is probably the weak point as far as efficiency is concerned. After cycling for 5 minutes I took some thermal images.

The motor got to about 45 degrees celsius in a 10 degree room. The bike tyre would have dissipated heat too. Belt driven systems would outperform this turbo generator in this regard.

I did a second 10 minute test that averaged 180 W. After this the motor was too hot to touch for a long time. Probably about 60 degrees. And some of the bolts through the 3D printed plastic were loosened! There was also a thin film of red rubber dust on the surrounding floor. Friction drive systems suck!

Step 4: Simulating Inertia and Drag

The software is fairly simple and is here on GitHub. The overall function is determined by this line:

RPM = RPM + (a*Motor_Current - b*RPM - c*RPM*RPM - GRADIENT);

This incrementally adjusts the next RPM setpoint (ie. our speed) based on the simulated force exerted. Since this runs 25 times/second it’s effectively integrating the force over time. The overall force is simulated as this:

Force = Pedal_Force - Laminar_Drag - Turbulent_Drag - Gradient_Force

Rolling resistance is essentially included in the gradient term.

Step 5: A Few Other Boring Points

I had to adjust the PID Speed control parameters of the VESC to get better RPM holds. That was easy enough.

Step 6: ​What I’ve Learnt

I’ve learnt that friction drive mechanisms suck. After only 20 minutes of cycling I can see visible tyre wear and rubber dust. They’re also inefficient. The rest of the system works a dream. I reckon a belt driven generator could get an extra 10-20% efficiency especially with higher RPMs. Higher RPMs would reduce the motor currents and produce higher voltages which I think would improve efficiency in this case.

I don't have enough space in my house to setup a belt driven system atm.

Be the First to Share


    • Photography Challenge

      Photography Challenge
    • Raspberry Pi Contest

      Raspberry Pi Contest
    • One Board Contest

      One Board Contest



    4 months ago

    Will be trying this, installing magnets and coils, see how much load I can introduce to it and use it as a generator and control the loading with it instead of the friction brakes it has right now.


    5 months ago

    Hi. which vesc did you use?


    Reply 5 months ago

    The VESC 6 by benjamin vedder


    8 months ago

    Could be work with zwift? Maybe you can use a LG washing machine bldc motor an build a trainer as Tacx Neo