Build Your Own Arcade Controls Forum

Main => Main Forum => Topic started by: TacticalChaos on May 14, 2015, 01:30:03 pm

Title: How to get only positive values out of a pot?
Post by: TacticalChaos on May 14, 2015, 01:30:03 pm
The controller I made used a logitech wheel board in it. I'm trying to use the X-axis for a turnable knob, but the problem is the pot outputs values from about -1 to 1 and the python code I'm using only accepts positive values for this input (WHY they put this stupid limitation on it I don't know, the code accepts negatives for other inputs).  So there's two options I see,
 1. Rewire the pot somehow to only show positives, 2. Hook the pot up to something like one of the pedal axis's (assuming they only have positive values?).
I also noticed a standard gamepad pot does the same thing so changing the board wouldn't do me any good.

Title: Re: How to get only positive values out of a pot?
Post by: mgb on May 15, 2015, 07:49:51 pm
I'm not sure I completely follow and hopefully someone else has a better idea.
But maybe you should post pics and how it's wired currently.
I may have missed something or misunderstood what you meant but a standard potentiometer doesn't really give a negative or positive value. It changes resistance.
What other interface is in place here and what exactly is it interfacing to and controlling.
Also with Python, is there library that will suit your needs maybe
Title: Re: How to get only positive values out of a pot?
Post by: TacticalChaos on May 15, 2015, 07:58:16 pm
Well I have found a work around, and like I thought it is using one of the pedal axis's.
I found that if I set the pedals to combined the brake axis then only reports positive ranges.
Had I used anything other than a wheel board I wouldn't of had this option because evidently negative and positive values are standard for joysticks.
Title: Re: How to get only positive values out of a pot?
Post by: Slippyblade on May 15, 2015, 09:12:13 pm
Pots don't output anything at all.  They are just resistors and they will act as a voltage divider.  That voltage gets fed into an ADC usually that outputs a value.  I know it's a nitpick thing, but something that might address the issue.
Title: Re: How to get only positive values out of a pot?
Post by: TacticalChaos on May 16, 2015, 05:29:30 pm
Ok the work around is great in theory, actually getting it hooked up correctly is another matter since I never possessed the pedals for the board to begin with. I have pieced together from online sources the info I need to know what trace on the board does what for the pedals. The issue is I'm only using one pot, and the pots in the pedals were wired together and seem to give a different reading when you only hook one up (and by different reading I mean it does stuff like move the wheel axis for half and then a pedal for the rest, don't even know why).
SO, does anyone know how to wire up just one pot so that it acts just like the other one was still there (albeit minus any input from the missing one). Here's a diagram of the pot pedals in question (that I found, so hopefully it's correct). (http://shrani.si/f/3L/hh/o8NVUzh/logitechwingmanforcegp.png)

Also could someone move this thread to the racing cab section? I think that would be more appropriate since we are dealing with hardware that was originally a steering wheel and thus get better results.
Title: Re: How to get only positive values out of a pot?
Post by: johnrt on May 16, 2015, 06:12:18 pm
This is the schematic for your setup:
(http://forum.arcadecontrols.com/index.php?action=dlattach;topic=136713.0;attach=329114;image)

It really doesn't make any sense without knowing the rest of the circuit. And it can definitely not be recreated with just ONE pot.
Title: Re: How to get only positive values out of a pot?
Post by: TacticalChaos on May 16, 2015, 06:25:43 pm
   Ok, well anyway I thought the following info might be helpful.
Green =Accelerator  On    Red=Brake On
Black (Yellow)=Accelerator Ground    Black (White) =Brake Ground
Title: Re: How to get only positive values out of a pot?
Post by: TacticalChaos on May 16, 2015, 06:42:03 pm
I just figured out the python code to make it do what I want. Evidently when use a negative you have to also use a plush sign on the positive (normally there isn't when dealing with all positives) like this (-1,+1) NOT (-1,1) as I was doing.
Anyway the schematic up there is for a logitech wingman force gp if anyone finds this later and needs that image.
Title: Re: How to get only positive values out of a pot?
Post by: PL1 on May 16, 2015, 06:43:57 pm
[EDIT:  Looks like you found an easier answer just before I posted.  :lol]

Are you sure it isn't wired like the single axis example below?

(http://forum.arcadecontrols.com/index.php?action=dlattach;topic=119608.0;attach=185110;image)

If it is connected that way, you can wire your pot like the "brake pot" below, but with a fixed resistor with the same resistance value as the "brake pot" in place of the "gas pot".

The fixed resistor/"gas pot" drops 1/2 the total voltage so the "brake pot" wiper outputs between 1/2 of Vcc and Vcc, depending on the position of the "brake pot" wiper.

To tell which tab (1 or 3) the resistor should be on, remove power from the board (unless you don't mind frying your multimeter  :o), turn the pot in the direction that currently gives negative readings, and compare the resistance between tabs 2+3 to the resistance between tabs 1+3.

The pair with the lower resistance tells you which tab (1 or 3) to put the resistor on.

(http://forum.arcadecontrols.com/index.php?action=dlattach;topic=121700.0;attach=249765;image)


Scott
Title: Re: How to get only positive values out of a pot?
Post by: TacticalChaos on May 16, 2015, 06:54:58 pm
I did see that wiring setup mentioned else where for other pedals. And for all I know they made the other one wrong. I won't know if that would of actually worked as I'm not going to monkey with it anymore since I fixed the code to do what I want. I already had it crash some .dll while messing with the connections and had to restart my system before it recognized the controller again, so I'd rather not risk anything more now that I don't have to, but thanks for the diagram.