Exercise Bike as Controller for MT Bike Simulator

Discussion in 'The Projects Forum' started by jvj, Apr 25, 2013.

  1. jvj

    Thread Starter New Member

    Apr 25, 2013
    5
    0
    I've had this old exercise bike lying around for a long time as I have been wanting to do this for some time. So gf asked me to throw it out and that kind of triggered me to have a closer look at actually turning it into a bike game/simulator controller. While old, I can't say it's got much mechanical wear :rolleyes: ..

    So this is the plan:

    Modify the bike and add sensors for pedal rpm, steering, breaks and add some motor control for the load tensioner.

    I'll need to replace the existing fixed handle bars with something that actually turns.

    Find some existing games that will work with such a device. Or just make my own 3D simulator with reasonable accurate physics, I mean how hard can that be :D


    I know there are commercial simulators like this available, but they are insanely expensive:


    [​IMG]

    That one is $7,000 !! :eek: and it only comes with a tiny monitor.


    Anyway, this is what I've got to work with:


    [​IMG]


    Of course I could just take my real MTB for a spin, but that's not the point :D
     
  2. jvj

    Thread Starter New Member

    Apr 25, 2013
    5
    0
    As the first step I want to have a look at being able to control the tension through USB, for that to happen I need to add a motor on the currently manual tensioner.

    This is how it works on this old bike:


    [​IMG]


    There is a felt belt that is just tightened against the flywheel, the tension is controlled by twisting the knob on top:


    [​IMG]


    [​IMG]


    This is the motor I want to use, it's tiny and I'm not sure it's powerful enough, but I think it will be ok as it's geared plus the tensioner is geared.


    [​IMG]
     
  3. jvj

    Thread Starter New Member

    Apr 25, 2013
    5
    0
    Quick design of a motor coupler:

    [​IMG]

    And a motor mount:

    [​IMG]

    My 3D printer comes in handy here.
     
  4. jvj

    Thread Starter New Member

    Apr 25, 2013
    5
    0
    Everything printed and motor mounted:

    [​IMG]

    [​IMG]


    Now I just need to write a small piece of code to see if it turns and if it's got enough power.

    It's fairly simple, the controller is nothing more than an ULN2003 driver, simply darlington coupled transistors in a package with build in diodes to prevent reverse voltage spikes.

    4 output ports are needed for control, the step sequence is like this:

    0001
    0011
    0010
    0110
    0100
    1100
    1000
    1001

    Repeat that sequence to make the motor turn clockwise, for counter clockwise, run the sequence backwards.
     
  5. jvj

    Thread Starter New Member

    Apr 25, 2013
    5
    0
    A fairly simple controller board:

    [​IMG]

    It's based on the PIC24H, a bit overkill for this purpose as it's really just sampling a number of analog and digital inputs plus controlling the stepper motor.

    Analog inputs are:

    Steering
    Front Brake
    Rear Brake
    Gear Selector

    Digital inputs:

    Pedal pulse sensor
    Keyboard (up, down, left, right, select, back)

    UART I/O
    And 4 ports for Steps

    Here doing a bit of testing:

    [​IMG]
     
Loading...