Results 1 to 10 of 14
-
03-03-2008, 02:56 AM #1
- Join Date
- Mar 2008
- Location
- United States
- Posts
- 2
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?
-
03-03-2008, 03:02 AM #2
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.
-
03-03-2008, 03:20 AM #3
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
-
03-03-2008, 03:28 AM #4
- Join Date
- Jan 2007
- Location
- Saskatchewan,Canada
- Posts
- 226
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 ?
-
03-03-2008, 03:35 AM #5
- Join Date
- Mar 2008
- Location
- United States
- Posts
- 2
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.
-
03-03-2008, 04:10 AM #6
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.
-
03-03-2008, 12:16 PM #7
- Join Date
- Feb 2007
- Location
- California, USA
- Posts
- 377
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.
-
03-03-2008, 04:02 PM #8
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 NZLast 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 ! !
-
03-03-2008, 04:47 PM #9
-
03-03-2008, 05:21 PM #10
- Join Date
- Feb 2007
- Location
- California, USA
- Posts
- 377
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!
Similar Threads
-
Sound input
By props in forum Cockpit SoundsReplies: 5Last Post: 10-23-2009, 04:51 AM -
need some input
By djcevera20 in forum General Builder Questions All Aircraft TypesReplies: 4Last Post: 05-07-2009, 02:58 PM -
input reverse
By aviaparts in forum FS2Phidget UsersReplies: 1Last Post: 04-02-2008, 04:53 PM
Dating for Sex. Best realistic sex game
JH startup on Client PC