Main > Main Forum
How to interface an ANALOG Race Drivin Shifter???
<< < (2/4) > >>
mark shaker:

Stephen,

Thank you for pointing towards a good hardware solution.

I will have to read-up on "voltage comparators" to see how flexiable they are, because moving the shifter does not rotate the pot a full 270 degrees, so the resistance range is actually a much smaller than from 0K - 5K.

I am still hoping that someone has a software solution, as I know that all the necessary hardware is already in the PC's joystick ports. It's just a matter of reading and reacting to the data.

If I can't find a software solution, I will definatly go this route.  

Thanks again!


 - Mark




--- Quote from: StephenH on June 08, 2003, 02:45:55 am ---You could certainly use the POT inputs, by swapping 5K for 100K, and connect to the PCs Game Port, or a USB based Analog input.

Also, you can build a A to D circuit, that would "turn on" digital outputs" at certain voltage levels.  Assuming the Race Drivin Shifter pattern is 3X3 (Reverse plus 1-4), as follows:

Assuming a +5V input to the pots, and the range the pots output was 0-5V, and assuming the "in gear areas" are symmetrical (as refered to pot positions), you would need three voltage comparators that turn on if the input voltage was between 0 and 1.66V, 1.67V and 3.33V and 3.33V and 5V, respectively per axis (6 comparators in all).

Assuming the top is 0V and the bottom is 5V on the Y axis, and the Left is 0V and the right is 5V on the X axis.   So, the voltage pattern of the gears is:

1st: When the X axis and Y axis  voltage is between 0V and 1.66V

2nd: When the X axis voltage is between 0V and 1.66V and the Y axis voltage is between 3.33V and 5V.

3rd: When the X axis voltage is between 1.67V and 3.33V and the Y sxis voltage is between 0V and 1.66V.

4th: When the X axis voltage is between 1.67V and 3.33V and the Y voltage between 3.33V and 5V.

Reverse:  When both the X and Y axis voltages are between 3.33V and 5V.

Neutral:  When the Y Axis voltage is between 1.67V and 3.33V.  The X Axis voltage does not matter.

Once you have these comparators for the correct voltages, you then connect their outputs with AND gates, as above, and connect these AND gate outputs to your "gear keys"


As for the magnet, it is a force feedback device to lock the shift position, if the clutch was not in.  To implement this, you would need to get the voltage, and connect your analog clutch's pot (the other side, as you want it to be energised when the clutch is OUT), to a MOSFET or relay, and then connect that output to it and a power source of the correct voltage and current for the magnet.    The other possibility is to modify the software to send this output or clutch position to the keyboard lights, or some time of parallel or USB port output, and connect the output to a relay or MOSFET controller, with the proper voltage and amperage power source.

--- End quote ---
StephenH:
If it does not rotate the pots fully, modify the above voltages, with the correct "High" and "Low" points, and divide by 3.   You can connect a voltmeter to the Pots, and shift to different positions, and read the X and Y voltages, and modify the comparators accordingly.
u_rebelscum:

--- Quote from: mark shaker on June 08, 2003, 08:47:09 am ---I am still hoping that someone has a software solution, as I know that all the necessary hardware is already in the PC's joystick ports. It's just a matter of reading and reacting to the data.

--- End quote ---

As mentioned earilier, you can hook the analog shifter to the computer as a normal analog joystick, and mame is already correctly set up for an analog joystick as the gear shift in race drivin.  No software hacks needed.  No hardware hacks besides the normal "attach an analog joystick" hack.

Also, mame already can take analog inputs and translate them into digital-like inputs.  The "switching point" can be adjusted by increasing/decreasing the "a2d_deadzone" setting in mame.ini or mame32.  So no need for the hardware circuit mentioned above for mame.  Other emus, I don't know, but mame is already set up for analog gear (joystick) inputs for games originally with digital gear shifts.  (err, if mame didn't simulate the original momentary switch as a toggle switch for easy keyboard use.)

If you have an analog joystick, test the above out, with the analog stick mapped to the gear shift.
mark shaker:

Please correct me if I'm wrong, but I think that this solution only works with Hard Drivin and Race Drivin, as they seem to be the only games set-up for an Analog Shifter.

Ex: How could I set-up Sprint or Drag Race to shift to 3 gear when the analog shifter moved from any position to the top right corner?

If I shift from 1'th to 3'rd the movement is -X then +Y, +X.
If I shift from 2'nd to 3'rd the movement is +X, +Y.    
If I shift from 4'th to 3'rd the movement is "no X", -Y.  
 
   - Mark


--- Quote from: u_rebelscum on June 09, 2003, 12:56:08 am ---
Also, mame already can take analog inputs and translate them into digital-like inputs.  The "switching point" can be adjusted by increasing/decreasing the "a2d_deadzone" setting in mame.ini or mame32.  So no need for the hardware circuit mentioned above for mame.  Other emus, I don't know, but mame is already set up for analog gear (joystick) inputs for games originally with digital gear shifts.  (err, if mame didn't simulate the original momentary switch as a toggle switch for easy keyboard use.)

--- End quote ---
u_rebelscum:
Sprint and Drag Race should be fine.  (I'll assume normal, non-reveresed POTs of X- = left and Y- = up, and going by the drawing on your first post.)  Using ctrlr ini of the old [tab] way of remapping inputs, set:[*]game gear 1 to the device's first gear position (looks like joy X- and joy Y-),
[*]game gear 2 to device second gear position (looks like joy X- and joy Y-)
[*]game gear 3 to device third gear position (looks like joy Y- not joy X- not joy X+)
[*]game gear 4 to device forth gear position (looks like joy Y+ not joy X- not joy X+)[/list]
Notice only the position matters, not the relative movement, as far as the device's inputs are concerned.  If the original game had an engine die (or something) with a 1st to 4th gear shift, the ROM will know what to do; mame does not worry about that.

BTW, netural in drag race looks a little harder to map.  I think a "gas pedal/button not joy Y- not joy Y+ OR joy X+ not joy Y- not joy y+ OR joy X- not joy Y- not joy y+" will work, but IIRC there's a limit of eight stuff mapped to one input.  :-\  In which case "joy X+ not joy Y- not joy y+ OR joy X- not joy Y- not joy y+" should be okay.

Again noting from my past post, you might need to adjust (increase most likely) the a2d_deadzone setting (in mame.ini for mame or controller tab setting in mame32) so the game doesn't shift too early or late.


--- Quote from: mark shaker on June 10, 2003, 07:26:04 pm ---Please correct me if I'm wrong, but I think that this solution only works with Hard Drivin and Race Drivin, as they seem to be the only games set-up for an Analog Shifter.

Ex: How could I set-up Sprint or Drag Race to shift to 3 gear when the analog shifter moved from any position to the top right corner?

If I shift from 1'th to 3'rd the movement is -X then +Y, +X.
If I shift from 2'nd to 3'rd the movement is +X, +Y.    
If I shift from 4'th to 3'rd the movement is "no X", -Y.  
 
   - Mark


--- Quote from: u_rebelscum on June 09, 2003, 12:56:08 am ---
Also, mame already can take analog inputs and translate them into digital-like inputs.  The "switching point" can be adjusted by increasing/decreasing the "a2d_deadzone" setting in mame.ini or mame32.  So no need for the hardware circuit mentioned above for mame.  Other emus, I don't know, but mame is already set up for analog gear (joystick) inputs for games originally with digital gear shifts.  (err, if mame didn't simulate the original momentary switch as a toggle switch for easy keyboard use.)

--- End quote ---

--- End quote ---
Navigation
Message Index
Next page
Previous page

Go to full version