Society of Robots - Robot Forum

General Misc => Misc => Topic started by: hoosier122 on May 09, 2011, 04:39:05 AM

Title: Steps to "hack" a controller for the $50 robot
Post by: hoosier122 on May 09, 2011, 04:39:05 AM
I want to use a wired Microsoft Sidewinder controller to navigate the $50 dollar bot which I've already built. I believe it's a 9-pin connector. I can salvage the correct header/port from a broken motherboard.

Hopefully. I can find a pinout diagram otherwise how do I determine the power and ground pins for the controller? That's step one.

After that, how do I decode the digital output signal from the controller or would it be better to crack open the controller and go straight from analog signals when the buttons are pressed to the robot?

Should I bypass the robots microcontroller all together amd just connect to the servo rails?

I know this is kind of a step backwards, but In the future I think it could be iseful for testing and other things.

Thanks1
Title: Re: Steps to "hack" a controller for the $50 robot
Post by: voyager2 on May 09, 2011, 05:10:18 AM
I was looking into this a few days ago...

Wikipedia has a good explanation:
here! (http://en.wikipedia.org/wiki/Game_port)

Lots of info out there, just search "game port" + whatever you want to know.
And no you can't bypass the MCU directly, servos can't process to required data.

Anyway...
What model side Sidewinder do you have?
Would it just happen to be a 3D Pro? Part # 63545
Title: Re: Steps to "hack" a controller for the $50 robot
Post by: hoosier122 on May 10, 2011, 12:55:02 AM
It's not the 3D model. It's model No.  90873, 15 pin plug, 5v, 12mA...

It's actually the 15-pin version. It has a left and right trigger.

I know using two buttons to control each servo individually would be easy, so I think I'm going to figure out how to use the directional pad...thats the most logical way IMO.

Maybe I'll even rig a flashlight (LED) to turn on after pressing a button. We'll see.

My model (http://www.quickerbuy.com/assets/photo/avatar/220288/microsoft-90873-sidewinder-game-pad.jpg)
Title: Re: Steps to "hack" a controller for the $50 robot
Post by: voyager2 on May 10, 2011, 09:53:05 PM
Almost all game port joysticks/pads are the same.
I have a 3D pro, the directional pad should use some analogue out-put, just like a resistor:
Pin outs (from wiki):
Code: [Select]
Pin 1 +5V +5V DC
Pin 2 B1 Button 1
Pin 3 X1 X axis for joystick 1 (0–100 kΩ)
Pin 4 GND Ground for B1
Pin 5 GND Ground for B2
Pin 6 Y1 Y axis for joystick 1 (0–100 kΩ)
Pin 7 B2 Button 2
Pin 8 +5V +5V DC
Pin 9 +5V +5V DC
Pin 10 B4 Button 4
Pin 11 X2 X axis for joystick 2 (0–100 kΩ)
Pin 12 GND Ground for buttons 3 and 4 (or MIDI out)
Pin 13 Y2 Y axis for joystick 2 (0–100 kΩ)
Pin 14 B3 Button 3
Pin 15 +5 V +5 V DC (or MIDI in, sometimes unconnected)

Since yours has ALL 15 pins I'll bet the X/Y axis for joystick 2 is connected to left/right triggers.
It would be best to get a DA-15 female connector and probe the outputs for yourself.
The joystick outputs are going to be between 0-5v, so they should be fine for a standard 5v micro-controller ADC input (like the photo-resistors on the $50 robot).
Heck, you could wire this joystick directly to the photo-resistor inputs!

Anyway, good luck!
Voyager
Title: Re: Steps to "hack" a controller for the $50 robot
Post by: hoosier122 on May 11, 2011, 03:21:24 AM
I only need to send 5v to pin 1, correct? I see pin 15 can also use 5v, but I have no reason for midi stiff.

After using my solder-remover heat gun -- the $10 one from Radioshack that uses a hand-pump vaccum to suck hot solder -- I'm trying to think of a clean/neat install for the port which I salvaged from a busted computer MOBO.

Any ideas?

I plan to post a guide with photos for this process. Do you all think that's a time-worthy venture that would help other newbies like me?

I know it's not a wireless controller, but slow, basic robots don't need more than 5 feet from the controller. Plus I think it's a debugging tool -- specifically for balanced servos and steering.

I'll try to do this asap, but be patient. Spring is my busy time at my real job.

Is this post helpful to the commmunity? Has anyone else considered doing this with a controller or keyboard?

Thanks for your time.
Title: Re: Steps to "hack" a controller for the $50 robot
Post by: voyager2 on May 11, 2011, 05:13:01 AM
According to Wikipedia, just connect +5v to pins 1,8,9 and pins 4,5,12 to Gnd.
Joystick X/Y should go to your micro-controllers ADC.
Joystick 2  X/Y is for the shoulder pads [I think]
Joystick outputs should be linear varying between 0-100 ohms, so remember to adjust your $50 robot code!
Buttons will output ~5v when pressed, as per the pin out table :)

Quote
Is this post helpful to the community?
Defiantly a helpful post!

Best of luck with your project ;D

Voyager
Title: Re: Steps to "hack" a controller for the $50 robot
Post by: Soeren on May 13, 2011, 12:47:35 PM
Hi,

Joystick outputs should be linear varying between 0-100 ohms, so remember to adjust your $50 robot code!
No, it's (approximately) 0..100kOhm.


Buttons will output ~5v when pressed, as per the pin out table :)
No, the buttons pull to ground (i.e. ~5V when not pressed).