|
Post by Frisbone on Jul 23, 2013 13:01:12 GMT -5
The PWM outputs use a circuit with two resistors (1500 ohm and 2000 ohm) and a capacitor (10 uF). I assume this is a filtering circuit of some kind. On the resister side of the circuit is the input (from RPi), on the outbound side is the connection to the controller board. The diagram Huub Smeitink has shows these connected as follows: Left Trigger - 14 Right Trigger - 15 Left Joystick X - 19 Left Joystick Y - 18 Right Joystick X - 17 Right Joystick Y - 16 These are the pin numbers on his ribbon cable - useful in finding the contacts on the controller we need to connect to. For digital I/O there is a 10,000 ohm resister connected to the base of a transistor. The collector is tied to ground while the emitter is tied to the pad on the controller we are trying to trigger. Attachments:
|
|
|
Post by Frisbone on Jul 29, 2013 6:55:50 GMT -5
I've been working on wiring the digital outputs for almost a week now and can't seem to emulate the success of the XBOX to PC guy where he uses only a single lead drawn off of the controller board from each of the switches (for example, the top part of the "A" and "B" buttons) and wire them to the collector of a transistor.
His diagram showed the emitter tied to ground and the base tied to our micro-controller (through a 10k resistor - but this was only shown in his schematic).
Unfortunately even though the transistor is switching current - it doesn't trigger the button action on the controller's MC. I even added a resistor to match the "to ground" resistance on the other side of the contact - no luck. Also tried adding my own 1.6V and switching to the ground contact on the X-box controller - it switched the current - but didn't enable the switch.
The only thing I got to work was connecting the transistor across the switch. In doing this I was able to reduce the current down to around 30uA by going up to 100kOhms on the resistor from the MC.
So now I'm thinking that I can actually just go with this plan. Why not solder the transistor's C & E directly across the switches, then have the base come off it tied direct to the resistor then tied to wire exiting the board? It kills two birds with 1 stone, now I won't need to find a place for the transistors so long as I can make it low-profile enough.
|
|
|
Post by Frisbone on Jul 31, 2013 13:37:58 GMT -5
I determined that I might need to avoid using PWM to control the triggers because going with DAC I can only control two of them - which would be my two axis. Here is my thoughts on approach for emulating a POT with just a digital signal:
I need to wire up both triggers as outputs. Believe that all we should need are two specific valued resistors and a transistor to emulate the POT. What we do is this:
(see next post for Image)
Originally I thought all I needed was the right side - but this doesn't really emulate a potentiometer as a voltage wouldn't always be present. The problem with this approach is that I might need to invert the output because I'm unsure which relative resistance value produces a "zero" state.
|
|
|
Post by Frisbone on Jul 31, 2013 14:30:23 GMT -5
POT replacement figure attached Attachments:
|
|
|
Post by Frisbone on Aug 1, 2013 6:41:20 GMT -5
When I connected this up in a breadboard circuit I had Duke Nukem Forever running so I could test out all of my button mappings. When I connected up my circuit it did nothing. So then I figured that I would connect the resistor up directly to the leads on the board to see the results. The results were odd. The LT was supposed to be a "zoom" mode. The RT was supposed to be the fire button for the weapon. Now I think its possible that I didn't have a weapon - so it shouldn't have done anything. However on RT what I got with a small resistor was the free-look rotating to the right a small amount every time I touched it. For the LT (still small 220ohm resistor) it seemed to crouch - but hard to say for sure that it wasn't zoom since I was facing down. After thinking about it this morning I think I wired things up incorrectly. There were three leads and I think I simply forgot how a pot works. I assumed it was being used just as a pot, but when I thought about it in the context of the application - it is probably used as a voltage divider - using all three leads. So I'm not sure my plan above would work. If internally the pot's two resistor values are being used and the "tap" is the voltage divider position, then I can't easily emulate that by simply "replacing" a resistor due to a lower current flow. Best I can come up with is the diagram attached - and it has a lot of components. Starting to think that avoiding PWM may not be the best idea. Attachments:
|
|
|
Post by Frisbone on Aug 24, 2013 12:12:18 GMT -5
Here is the final mapping for outputs (female header wires):
Digital --------- RB==>white LB==>blue Y==>green RSTK==>yellow A==>purple B==>red X==>black LED==>grey/brown
Note: I'm not confident of the last three, need to double check with my other notebook.
PWM -------
Colors are the same as befor but mapped to connector as follows:
Yellow==>white Purple==>yellow Red==>pink Green==>shield/gnd/black
|
|