Exercise bicycle

Hello, new to odrive and automation in general. I have written a bicycling videogame and would like to now implement an exercise bike like device where the pedaling resistance can be varied based on the terrain (and other factors) in the game. Is this possible with the odrive? If so can anyone offer suggestions as to what I should be looking at purchasing drive and motor and resistor wise, and how I would go about producing this effect with the drive.

Thank you!

Adam

Hi there!

Super cool application! Yes, this is absolutely possible with an ODrive - chances are the S1 is your best bet.

First things to figure out are the RPM and torque that you’ll need to oppose with a motor. That can inform your motor selection (note you’ll probably need to use a gear, belt, or chain reduction, since motors typically like going at higher speeds and lower torque). You can assume that a motor that’s able to provide some amount of torque at a certain speed can also resist that amount of torque at that speed.

From there, once you know your peak and continuous power, you can find a brake resistor that would would for your application.

If you’re able to provide the maximum torque and RPM numbers for the bike, happy to suggest a motor!

The ODrive is able to produce arbitrary motoring and braking torques, so your software would just have to compute the pedaling resistance the user should experience (given simulated bike speed, slope, gear ratio, pedal RPM, etc) and provide that as a torque command to the ODrive.

Thanks for your response! I’m glad to hear that this is possible.

Reading this: https://physicalcycling.com/pedaling-force I would say a maximum of 500 newtons and 120 rpm is a good place to start, with average being 200 newtons or less and 60-80 rpm. A 4:1 gear reduction is easily acheived using stock bicycle chainrings and sprockets, but that could be increased with not much difficulty.

Cheers,

Adam

Given crank lengths of 175mm we’re looking at max 87.5 ish Nm without any gear reduction, and 35 average.

Okay, so 87.5 Nm at 120 RPM? That sounds like a lot but it’s actually not too bad :slight_smile: just around a kW. The hardest part is the fact you want as small / efficient of a reduction as possible so that the gear/linkage resistance is extremely low.

It’s a little pricy, but maybe something like this with a 1:9 or 1:10 reduction? https://www.cubemars.com/goods-945-R100.html

Could absolutely also achieve something similar with the M8325s: Motor with encoder magnet - M8325s 100KV — ODrive

A high efficiency two-stage chain or belt reduction could probably get the job done.

Though if you have a budget in mind, happy to try to recommend a solution !

Thank you! For my education how do you come up with the 1kw number? The second motor is definitely more in my budget. Would something like this work:

BANLICALI Electric Hub Motor, Aluminium Alloy Ebike Motor Mid Drive Motor Rear Wheel Hub Motor Conversion Kit Black 1000W 48V 460RMP https://a.co/d/hC9tIFn

Or this: Ebike Motor Wheel, Bike Electric Wheels, Brushless Gearless Motors, Electric Bicycle Threaded Rear Wheel Hub Motor (48V - 1500W) Amazon.com

I didn’t even think about that, those are really good ideas! The gearless one would be best, I’d imagine. Two things to note:

  1. Transferring torque from the pedal to the motor might be a bit tricky - you’d likely have to machine a custom sprocket to connect to where the spokes nominally tie into the motor, or something like that. Luckily, you can laser cut or waterjet a sprocket with something like Sendcutsend
  2. That motor only has a hall sensor encoder, which are pretty low resolution - so at low speeds the torque control might feel a bit rough. If you can add an additional external encoder (like a cheap incremental), the S1 can use that in conjunction with the hall sensors to improve motor control.

If you can find a bike wheel hub motor that also has parallel sprockets, then you could just use those sprockets, and have the wheel mounted in the normal rear wheel position. Then the wheel can just be braking from its normal position.

I don’t know if something like this reacts the motor torque into the sprockets or the frame, but I assume the frame?

https://www.amazon.com/Futchoy-Threaded-Brushless-Gearless-Electric/dp/B0BRQG3T88

Gentlemen, you are awesome! Thank you so much for the input. I will order the S1 and I think I should be able to make the motor with the sprockets work. One last question I have (for now) is how to size the braking resistor? Thank you again. I will report back with progress!

Adam

1 Like

Hmm the S1 with screw terminals is out of stock any idea when those will be available?

Some time next week! Doing our best to get things back in stock :slight_smile:

If you’re going to be only ever running regen, then you just need something that can absorb a human’s max peak / continuous power output :slight_smile: I think some people can go 1kW for a few seconds, and a few hundred watts continuous? So about 500W of resistance should probably be just fine. Note you also want to make sure you’re getting the right resistance of brake resistor - we have a guide for this for the regen clamp, but it also applies to S1 (I need to make it its own page) ODrive Regen Clamp Datasheet — ODrive Documentation 0.6.9 documentation

OK guys I finally got everything mounted and hooked up. When I try and calibrate the motor turns slowly for about a 90% rotation and I get the ILLEGAL_HALL_STATE error. Any ideas?

Also the motor spins backwards when I run calibration.

Help?

Do you require the motor to run forwards during calibration? With halls, you should only ever need to calibrate once.

You can try this for the hall state issue: ODrive API Reference — ODrive Documentation 0.6.9 documentation