Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    New Member
    Join Date
    Mar 2008
    Location
    United States
    Posts
    2
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Throttle input from bicycle crank

    How do I get throttle input from a bicycle crank? I am trying to create a human-powered airplane simulator with Microsoft Flight Simulator 9.

    In other words, the pilot must pedal a stationary bicycle, a sensor measures the RPMs of the wheel, and those RPMs must be sent to Flight Simulator to adjust the throttle. If the pilot pedals faster and faster, the throttle will increase.

    I don't know where to begin with the coding in FS9, nor how to get this to work. Does anyone have any suggestions?

  2. #2
    1000+ Poster - Fantastic Contributor AndyT's Avatar
    Join Date
    Jun 2006
    Location
    Oahu, Hawaii
    Posts
    1,236
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    From 0 to 5 RPM is 5% throttle, 6-10 is 10%...
    Have the sensor feed into a small PC, Notebook or something and then have the software in it do the translation to FSUIPC.
    God's in command, I'm just the Pilot.
    http://www.geocities.com/andytulenko/

  3. #3
    2000+ Poster - Never Leaves the Sim Michael Carter's Avatar
    Join Date
    Oct 2006
    Location
    Southern Illinois, USA
    Posts
    2,887
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Fred Flintstone might know.

    He and Barney did a lot of pedaling in the Flintmobile.

    If you're for real, I'd really like to see this while shooting an approach to Innsbruck in bad weather. Please put this on U-Tube!
    Last edited by Michael Carter; 03-03-2008 at 03:24 AM.
    Boeing Skunk Works
    Remember...140, 250, and REALLY FAST!

    We don't need no stinkin' ETOPS!



    Powered by FS9 & BOEING

  4. #4
    150+ Forum Groupie
    Join Date
    Jan 2007
    Location
    Saskatchewan,Canada
    Posts
    229
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Could a person get a rotary encoder to act as a throttle?

    Something like,, every pulse would give 10% power ? Four pulses within say .5 sec. would give 50% power,,, 10 pulses every .5 sec would give 80% power,, etc ???

    I wonder if that could be set with Fsuipc ?

  5. #5
    New Member
    Join Date
    Mar 2008
    Location
    United States
    Posts
    2
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    How do I edit it the lines of code for input in FSUIPC? What lines of code that dictates the throttle in Flight Simulator should I look for? I have the unregistered version of FSUIPC version 3.4.8 installed.

    This is for a college project. The last thing I need is users thinking this as a joke. We are building an actual airplane. The simulator is for training the pilot. YouTube videos will follow once I get this thing to work.

  6. #6
    1000+ Poster - Fantastic Contributor AndyT's Avatar
    Join Date
    Jun 2006
    Location
    Oahu, Hawaii
    Posts
    1,236
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    No need to program FSUIPC.
    As I said, use a second PC to do the translation and then send that to FSUIPC.

    Serial input on PC2 = X RPM (Or digital input depends on your choice of interface)
    If X RPM is within (Z to Y range then Throttle = Speed
    Set throttle to Speed
    (Look at how a hardware throttle works, just translate the raw data)
    Send Throttle info to PC1 with FSUIPC.

    Yes, I know its a bit more than this, but this will do it quite nicely.
    Program it in BASIC if need be. GWBASIC if you cant handle VB6.
    God's in command, I'm just the Pilot.
    http://www.geocities.com/andytulenko/

  7. #7
    300+ Forum Addict



    Join Date
    Feb 2007
    Location
    California, USA
    Posts
    380
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Biz,

    If you don't already have a sensor on your bike crank, you might consider an optical interrupter. This is a fairly cheap arrangement of an LED and phototransistor. If something is in the gap between the two blocking the light, the output is high. If the LED shines on the phototransistor, the output is low.

    If you position the optical interrupter so that the bike crank gear teeth pass though the interrupter's optical path, you get a series of output pulses with a frequency that varies with the crank RPM.

    Mouser, Digikey, Jameco, etc. all carry optical interrupters.

    A cheap micro controller like a PIC16F648A can accept the pulses from the interrupter and, every 50 msec or so, send a message to the PC serial port. This can be as simple as the pulse count since the last message. The PIC16F648A has internal harware to handling serial communication.

    You can find documentation on the PIC16F648A on the Microchip website www.microchip.com. Look specifically for the PIC16F648A manual and the Mid Range Micro Controller Family manual. They have snippets of sample code.

    The easiest way to flash program a PIC micro controller is to use the PICKit2 USB programmer. It's available from the Microchip website. Check under development tools.

    A good reference for coding the PC serial port under the Win32 API is "Serial Communications in Win32" by Allen Denver available here: http://msdn2.microsoft.com/en-us/library/ms810467.aspx (If you prefer to work with managed code, there is a serial port object under .NET2.0 and later.)

    FSUIPC comes with a great deal of documentation. If you dig through the developer's guide you'll find a "Hello world" sample. This sample extracts data from FS, but getting it running is 90% of the way to pushing data INTO FS. To control the throttle, you have to first find the "offset" for the throttle position. The offset is numerical identifier for the throttle variable. Offsets are listed in the FSUIPC documentation. The documentation also describes the data format of the throttle variable. The documentation is available here: http://www.schiratti.com/dowson.html Look for FSUIPC SDK.

    To summarize, you will have to develop a small program that receives data through the serial port, interprets that data and scales it to a throttle value, formats the data as required by FS, passes it to FSUIPC, then tells FSUIPC to write the data to FS.

    BTW, FSUIPC is not a necessity. If you use MSFSX, you can use SimConnect, an API that ships with the deluxe version of FSX.

  8. #8
    75+ Posting Member Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    124
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Smile Kiwi stuff

    Aaaaahh Sounds like a mission for a kiwi ,,,,

    Fit a bike dynamo to the bike (normally they are 6 volt for the bike lights)
    Get a few resistors, a pot, a couple of capacitors and if you really want to be fussy,, also get a 5 volt zener diode.
    If the dynamo is AC (some are) then you will need a diode as well.

    Configure the above so at MAXIMUM pedalling the output is 5 volts.
    You may have to apply some filtering.
    You will probably have to have some load on the output of the dynamo ,, (A bike light)

    Get a joystick ,, check that while it is plugged in there is 5 volts across a pot ,, unwire the wire that goes to the pots wiper and also the one that goes to the - of the pot,,, fit a 100k resistor between them ,, now join the + wire from the dynamo to the wire that was from the slider and the - wire to the frame of the bike. (or the - of the dynamo if it comes out seperate)

    Calabrate the joystick etc in windows and set its assignment in FS2004 (or FSX) to be used as the throttle.

    No need for FSUIPC or any "external" programming at all. !!!

    Start pedalling !!!

    Jim NZ
    Last edited by Jim NZ; 03-03-2008 at 04:09 PM. Reason: added more detail
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  9. #9
    1000+ Poster - Fantastic Contributor Bob Reed's Avatar
    Join Date
    Oct 2005
    Location
    Holley, New York U.S.A.
    Posts
    1,776
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Quote Originally Posted by Biz View Post
    How do I edit it the lines of code for input in FSUIPC? What lines of code that dictates the throttle in Flight Simulator should I look for? I have the unregistered version of FSUIPC version 3.4.8 installed.

    This is for a college project. The last thing I need is users thinking this as a joke. We are building an actual airplane. The simulator is for training the pilot. YouTube videos will follow once I get this thing to work.
    Also if you are going to use FSUIPC you will need the registered version.
    Bob Reed

  10. #10
    300+ Forum Addict



    Join Date
    Feb 2007
    Location
    California, USA
    Posts
    380
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Jim NZ,

    I could point out that your solution is far too simple and elegant for a university project, but that would just be jealousy speaking.

    Great idea!

Page 1 of 2 12 LastLast

Similar Threads

  1. Sound input
    By props in forum Cockpit Sounds
    Replies: 5
    Last Post: 10-23-2009, 04:51 AM
  2. need some input
    By djcevera20 in forum General Builder Questions All Aircraft Types
    Replies: 4
    Last Post: 05-07-2009, 02:58 PM
  3. input reverse
    By aviaparts in forum FS2Phidget Users
    Replies: 1
    Last Post: 04-02-2008, 04:53 PM