Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

PS2 Wireless Game Controller

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
30 postsPage 2 of 21, 2
30 postsPage 2 of 21, 2

Post by i-Bot » Sat May 31, 2008 10:44 am

Post by i-Bot
Sat May 31, 2008 10:44 am

I understand the PS2 supplies 3.3V to all controllers. It think it is just that the others don't mind 5V.

When I tried the Logitech I used a translator cable I made when connecting 3.3V I2C accelerometers. This has a 3.3V 100mA regulator and 2 NMOS FETs to convert 3.3V to 5V bidirectional. Since the PIC is also happy at 3.3V I put this into the ETX ERX conections and it worked OK.

I would suggest to run the a 3.3V regulator the same way in the supply to both the Logitech receiver and the PIC. The PIC has 20mA capable clamp diodes, so putting a 1K resistor in series with ETX and ERX should work instead of FET at this speed.
I understand the PS2 supplies 3.3V to all controllers. It think it is just that the others don't mind 5V.

When I tried the Logitech I used a translator cable I made when connecting 3.3V I2C accelerometers. This has a 3.3V 100mA regulator and 2 NMOS FETs to convert 3.3V to 5V bidirectional. Since the PIC is also happy at 3.3V I put this into the ETX ERX conections and it worked OK.

I would suggest to run the a 3.3V regulator the same way in the supply to both the Logitech receiver and the PIC. The PIC has 20mA capable clamp diodes, so putting a 1K resistor in series with ETX and ERX should work instead of FET at this speed.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by NovaOne » Sat May 31, 2008 5:13 pm

Post by NovaOne
Sat May 31, 2008 5:13 pm

Thanks :D , hope to find some spare time this week to make a circuit board...keep you posted.
Thanks :D , hope to find some spare time this week to make a circuit board...keep you posted.
Last edited by NovaOne on Wed Jun 18, 2008 5:11 pm, edited 1 time in total.
NovaOne
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by NovaOne » Sat Jun 14, 2008 8:06 am

Post by NovaOne
Sat Jun 14, 2008 8:06 am

Progress so far;
PCB design:
Image

Prototype PCB:
Image
Progress so far;
PCB design:
Image

Prototype PCB:
Image
NovaOne
Savvy Roboteer
Savvy Roboteer
Posts: 405
Joined: Thu Jul 05, 2007 7:30 am

Post by Robo1 » Tue Jul 08, 2008 4:44 pm

Post by Robo1
Tue Jul 08, 2008 4:44 pm

Hi I-bot

I'm trying to get my logitech to work. It's hooked up to 3.3V but it I can't get it to connect. What initialization code do you send to it and if you can give me the info on the psclk speed e.g. time for high and low. time between shiftout and time between cmd.

Thanks Bren
Hi I-bot

I'm trying to get my logitech to work. It's hooked up to 3.3V but it I can't get it to connect. What initialization code do you send to it and if you can give me the info on the psclk speed e.g. time for high and low. time between shiftout and time between cmd.

Thanks Bren
Robo1
Savvy Roboteer
Savvy Roboteer
Posts: 501
Joined: Fri Jun 30, 2006 1:00 am
Location: UK - Bristol

Post by i-Bot » Tue Jul 08, 2008 5:01 pm

Post by i-Bot
Tue Jul 08, 2008 5:01 pm

Hi Bren

I didn't find the controllers too picky on speed. I basically went as fast as possible for the serial part (with a 1 MIPs processor !). Some delays are needed between operations.

Look at the Lynxmotion site for some recent good descriptions of how the commands are sent, and the timing.
Hi Bren

I didn't find the controllers too picky on speed. I basically went as fast as possible for the serial part (with a 1 MIPs processor !). Some delays are needed between operations.

Look at the Lynxmotion site for some recent good descriptions of how the commands are sent, and the timing.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by gdubb2 » Thu Sep 25, 2008 8:29 pm

Post by gdubb2
Thu Sep 25, 2008 8:29 pm

Hi i-Bot,

I've been using your PS-2 wireless mod for a little while now, and really like the way it works. The speed and responsiveness is very good for what I'm doing.

I've been wondering about signal degradation at RoboGames, so I thought I would have 2 or 3 usable methods of communication with my bot.
1: The wireless gamepad (done)
2: Bluetooth from the laptop (done but needs a better interface)
3: Something with Zigbee ???

I'm definately not much of a code person (more hardware), but I was thinking about using a wired gamepad to your interface, to an XBee module. On the bot, another XBee module to ETX/ERX. This would give me a wireless gamepad, but using XBee as a transparent connection.

What do you think ???

Thanks
Gary
Hi i-Bot,

I've been using your PS-2 wireless mod for a little while now, and really like the way it works. The speed and responsiveness is very good for what I'm doing.

I've been wondering about signal degradation at RoboGames, so I thought I would have 2 or 3 usable methods of communication with my bot.
1: The wireless gamepad (done)
2: Bluetooth from the laptop (done but needs a better interface)
3: Something with Zigbee ???

I'm definately not much of a code person (more hardware), but I was thinking about using a wired gamepad to your interface, to an XBee module. On the bot, another XBee module to ETX/ERX. This would give me a wireless gamepad, but using XBee as a transparent connection.

What do you think ???

Thanks
Gary
gdubb2
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 57
Joined: Sat Sep 23, 2006 1:00 am
Location: Blackfoot, ID. USA

Post by i-Bot » Thu Sep 25, 2008 11:38 pm

Post by i-Bot
Thu Sep 25, 2008 11:38 pm

It is hard to make fair comparison. The wireless PS2 has not let me down when in competition area shared with bluetooth, zigbee, 2.4G Spektrum and WLAN.
I get the impression that blue tooth is degraded more than the others in heavy 2.4G, but have no factual evidence.
It is hard to make fair comparison. The wireless PS2 has not let me down when in competition area shared with bluetooth, zigbee, 2.4G Spektrum and WLAN.
I get the impression that blue tooth is degraded more than the others in heavy 2.4G, but have no factual evidence.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Gort » Fri Sep 26, 2008 3:08 pm

Post by Gort
Fri Sep 26, 2008 3:08 pm

I notice a few interesting things about the PS/2 and PS/3 controllers at Robogames. Me and Matt had the PS/2 controllers and the Farrell’s had the PS/3 controllers. I never had any problems with signal interference at the games but when Me and Matt turned both of our MADCAT controllers on. One controller would control both robots! The Farrells never had this problem with their PS/3 controllers. They did run into a problem with signal interference from some one else’s robot controller at Robogames. I don’t think that they found out why or who it was from? I had Bluetooth interference off and on at the First Hitec Cup in Phoenix. I think it was from all of the personal Bluetooth device that people where carrying around? David Calkins has a Zigbee remote control that works great. In the Phoenix stadium, he was able to control his robot from over 100 yards away with out any interference. The only problem was that he was so far away that he could not see it!
I notice a few interesting things about the PS/2 and PS/3 controllers at Robogames. Me and Matt had the PS/2 controllers and the Farrell’s had the PS/3 controllers. I never had any problems with signal interference at the games but when Me and Matt turned both of our MADCAT controllers on. One controller would control both robots! The Farrells never had this problem with their PS/3 controllers. They did run into a problem with signal interference from some one else’s robot controller at Robogames. I don’t think that they found out why or who it was from? I had Bluetooth interference off and on at the First Hitec Cup in Phoenix. I think it was from all of the personal Bluetooth device that people where carrying around? David Calkins has a Zigbee remote control that works great. In the Phoenix stadium, he was able to control his robot from over 100 yards away with out any interference. The only problem was that he was so far away that he could not see it!
Gort
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 555
Joined: Wed May 31, 2006 1:00 am
Location: KC, MO, USA

Post by Bullit » Sat Sep 27, 2008 4:01 pm

Post by Bullit
Sat Sep 27, 2008 4:01 pm

RoboGames 2008 is the only place we've seen problems with the PS3 controllers and Bluetooth. At RoboGames 2007 we experienced problems with our PS2 2.4 ghz controllers however, Bluetooth with our class 2 Bluetooth v1.0 cell phones it seemed to be ok. We noticed that the problem was only when we got nearer to the com bot section where everyone has switched to 2.4 ghz DSS (both years). As I understand it, most DSS and all Bluetooth v1.0, when connecting search for an open frequency and grab it. Then the connection remains on that frequency. If the signal is lost it must reconnect. With Bluetooth v2.0 its supposed to continuously switch frequencies as necessary. This makes it much more robust to wifi and other interference etc. The PS3 controllers we use (the SixAxis and DS3) are bluetooth v1.0. They use some small ALPS board to board module. I'm not sure if its class 1 or 2 but we can usually get at least 100ft indoors with them. Since RoboGames we've improved our software to reconnect immediately if such a problem occurs so we only experience delays in the presence of interference which is better but still not great. We're also looking into replacing the Alps module in the PS3 controller with a Bluetooth v2.0 class 1 module.
BTW the Koreans had some Bluetooth problems also. I think they were using Bluetooth v1.0 class 1 modules.

Bluetooth class 1 is higher power generally considered 100M range, class 2 is 10M.
RoboGames 2008 is the only place we've seen problems with the PS3 controllers and Bluetooth. At RoboGames 2007 we experienced problems with our PS2 2.4 ghz controllers however, Bluetooth with our class 2 Bluetooth v1.0 cell phones it seemed to be ok. We noticed that the problem was only when we got nearer to the com bot section where everyone has switched to 2.4 ghz DSS (both years). As I understand it, most DSS and all Bluetooth v1.0, when connecting search for an open frequency and grab it. Then the connection remains on that frequency. If the signal is lost it must reconnect. With Bluetooth v2.0 its supposed to continuously switch frequencies as necessary. This makes it much more robust to wifi and other interference etc. The PS3 controllers we use (the SixAxis and DS3) are bluetooth v1.0. They use some small ALPS board to board module. I'm not sure if its class 1 or 2 but we can usually get at least 100ft indoors with them. Since RoboGames we've improved our software to reconnect immediately if such a problem occurs so we only experience delays in the presence of interference which is better but still not great. We're also looking into replacing the Alps module in the PS3 controller with a Bluetooth v2.0 class 1 module.
BTW the Koreans had some Bluetooth problems also. I think they were using Bluetooth v1.0 class 1 modules.

Bluetooth class 1 is higher power generally considered 100M range, class 2 is 10M.
Bullit
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 291
Joined: Wed May 31, 2006 1:00 am
Location: Near robot

Post by gdubb2 » Sat Sep 27, 2008 8:44 pm

Post by gdubb2
Sat Sep 27, 2008 8:44 pm

Hey Guys,

Good information to know, Thanks.

I think I'll definately pursue a ZigBee solution to add the flexibility my paranoia seems to require.

Thanks again
Gary
Hey Guys,

Good information to know, Thanks.

I think I'll definately pursue a ZigBee solution to add the flexibility my paranoia seems to require.

Thanks again
Gary
gdubb2
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 57
Joined: Sat Sep 23, 2006 1:00 am
Location: Blackfoot, ID. USA

Post by jeffchifu » Sat Nov 27, 2010 4:35 pm

Post by jeffchifu
Sat Nov 27, 2010 4:35 pm

Hi i-Bot,
I success to connect Logitech 2.4GHZ PS2 wireless control.It works at 3.3V only.Can I use analogue Strick Right X and Y?How to use in robobasic?
thanks
jeff
Hi i-Bot,
I success to connect Logitech 2.4GHZ PS2 wireless control.It works at 3.3V only.Can I use analogue Strick Right X and Y?How to use in robobasic?
thanks
jeff
jeffchifu
Robot Builder
Robot Builder
Posts: 20
Joined: Thu Mar 08, 2007 4:16 am

Post by i-Bot » Sun Nov 28, 2010 12:46 am

Post by i-Bot
Sun Nov 28, 2010 12:46 am

It is along time, since I did this, but if you look in the source code, then the "C", "D", "E", "F", requests should return the analogue values for the sticks. It is up to you what you do with them in Robobasic.
It is along time, since I did this, but if you look in the source code, then the "C", "D", "E", "F", requests should return the analogue values for the sticks. It is up to you what you do with them in Robobasic.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by jeffchifu » Mon Nov 29, 2010 8:50 am

Post by jeffchifu
Mon Nov 29, 2010 8:50 am

' Template program for PS2 wireless controller
' Richard Ibbotson November 2007
' PS2 wireless controller in DS2 mode connected to ETX/ERX
DIM rr AS BYTE ' first variable is reserved
DIM txchar AS BYTE ' store for character to send to controller
DIM rxchar AS BYTE
'Empty the ERX buffer
begin:
ERX 19200, rxchar, bemt1
bemt1:
ERX 19200, rxchar, bemt2
bemt2:
' Set the PS2 controller to DS2 mode

'-----------------------------------------------------------------------
' Motion Startup Stuff, note this is special for double knee joints
PTP SETON
PTP ALLON
DIR G6A,1,0,0,0,1,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,1,0,1
'GETMOTORSET G6A,1,1,1,1,1,1
'GETMOTORSET G6B,1,1,1,0,0,0
'GETMOTORSET G6C,1,1,1,0,0,1
'GETMOTORSET G6D,1,1,1,1,1,1
SPEED 5
MOTOR G6A
MOTOR G6B
MOTOR G6C
MOTOR G6D
'Example Gyro Setup Code
GYROSET G6A,0,0,0,0,0,0
GYROSET G6D,0,0,0,0,0,0
GYRODIR G6A,0,1,1,0,1,1
GYRODIR G6D,0,1,1,0,1,1
GYROSENSE G6A,0,200,200,0,0,0
GYROSENSE G6D,0,200,200,0,0,0
GOSUB Standard_pose
'-----------------------------------------------------------------------
MUSIC "CDE"
MAIN:
'Read the PS2 buttons
txchar ="C"
ETX 19200, txchar
GETC:
ERX 19200, rxchar, GETC
TEMPO 230
MUSIC "DDDDDD"
GOTO main
txchar ="e"
ETX 19200, txchar
GETe:
ERX 19200, rxchar, GETe
TEMPO 230
MUSIC "DDDDDD"
GOTO MAIN


'================================================
Standard_Pose:
MOVE G6A, 100,85,90,90,90,100
MOVE G6D, 100,85,90,90,90,100
MOVE G6B, 100,30,80,100,100,100
MOVE G6C, 100,30,80,100,100,100
WAIT
RETURN
'================================================
Hi Bot,
I tried to use "C".It doesn't work to control.
thanks
jeff
' Template program for PS2 wireless controller
' Richard Ibbotson November 2007
' PS2 wireless controller in DS2 mode connected to ETX/ERX
DIM rr AS BYTE ' first variable is reserved
DIM txchar AS BYTE ' store for character to send to controller
DIM rxchar AS BYTE
'Empty the ERX buffer
begin:
ERX 19200, rxchar, bemt1
bemt1:
ERX 19200, rxchar, bemt2
bemt2:
' Set the PS2 controller to DS2 mode

'-----------------------------------------------------------------------
' Motion Startup Stuff, note this is special for double knee joints
PTP SETON
PTP ALLON
DIR G6A,1,0,0,0,1,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,1,0,1
'GETMOTORSET G6A,1,1,1,1,1,1
'GETMOTORSET G6B,1,1,1,0,0,0
'GETMOTORSET G6C,1,1,1,0,0,1
'GETMOTORSET G6D,1,1,1,1,1,1
SPEED 5
MOTOR G6A
MOTOR G6B
MOTOR G6C
MOTOR G6D
'Example Gyro Setup Code
GYROSET G6A,0,0,0,0,0,0
GYROSET G6D,0,0,0,0,0,0
GYRODIR G6A,0,1,1,0,1,1
GYRODIR G6D,0,1,1,0,1,1
GYROSENSE G6A,0,200,200,0,0,0
GYROSENSE G6D,0,200,200,0,0,0
GOSUB Standard_pose
'-----------------------------------------------------------------------
MUSIC "CDE"
MAIN:
'Read the PS2 buttons
txchar ="C"
ETX 19200, txchar
GETC:
ERX 19200, rxchar, GETC
TEMPO 230
MUSIC "DDDDDD"
GOTO main
txchar ="e"
ETX 19200, txchar
GETe:
ERX 19200, rxchar, GETe
TEMPO 230
MUSIC "DDDDDD"
GOTO MAIN


'================================================
Standard_Pose:
MOVE G6A, 100,85,90,90,90,100
MOVE G6D, 100,85,90,90,90,100
MOVE G6B, 100,30,80,100,100,100
MOVE G6C, 100,30,80,100,100,100
WAIT
RETURN
'================================================
Hi Bot,
I tried to use "C".It doesn't work to control.
thanks
jeff
jeffchifu
Robot Builder
Robot Builder
Posts: 20
Joined: Thu Mar 08, 2007 4:16 am

Post by i-Bot » Mon Nov 29, 2010 3:58 pm

Post by i-Bot
Mon Nov 29, 2010 3:58 pm

The byte returned should be a value between 10 and 190 for the position of the joystick for the upper case "CDEF" , or between 33 and 55 for lower case "cdef". When centered it should be around 100 for upper case and 44 for lower case.
To detect movement of the stick you need to compare the rxchar value to determine the movement.

You also need to set the DS or analog mode for it to work. In digital mode the joysticks are the same as some of the buttons, but I can't remember which ones.

Give it another try, or I will get mine out and send a working program.
The byte returned should be a value between 10 and 190 for the position of the joystick for the upper case "CDEF" , or between 33 and 55 for lower case "cdef". When centered it should be around 100 for upper case and 44 for lower case.
To detect movement of the stick you need to compare the rxchar value to determine the movement.

You also need to set the DS or analog mode for it to work. In digital mode the joysticks are the same as some of the buttons, but I can't remember which ones.

Give it another try, or I will get mine out and send a working program.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by Landy » Sat Feb 02, 2013 2:34 pm

Post by Landy
Sat Feb 02, 2013 2:34 pm

I apologize if I open an old post but I wanted to ask if there is a simple method to convert the value of 0-255 of the joystick in a value for the servo motor 10-190.

I want to point out that the controller is the original hitec and not the one shown in the post.



Code: Select all
       

DIM char AS BYTE
DIM e AS BYTE

MOTOR 6

main:     
     char="e"                 'Joy sinistro DX & SX
     ETX 19200,char       'LEFT = 0, RIGHT = 255, centre = 128

loop5:
    ERX 19200,e,loop5
    GOTO move15
..........
.........

move15:

    SERVO 6,e          'the variable contains a value from 0 to 255.
                     'the servomotor accepts only values ​​between 10 and 190.
   
    GOTO main



refer to this table.
http://www.robonova.de/store/files/data ... 136080.pdf

best regard
landyandy
I apologize if I open an old post but I wanted to ask if there is a simple method to convert the value of 0-255 of the joystick in a value for the servo motor 10-190.

I want to point out that the controller is the original hitec and not the one shown in the post.



Code: Select all
       

DIM char AS BYTE
DIM e AS BYTE

MOTOR 6

main:     
     char="e"                 'Joy sinistro DX & SX
     ETX 19200,char       'LEFT = 0, RIGHT = 255, centre = 128

loop5:
    ERX 19200,e,loop5
    GOTO move15
..........
.........

move15:

    SERVO 6,e          'the variable contains a value from 0 to 255.
                     'the servomotor accepts only values ​​between 10 and 190.
   
    GOTO main



refer to this table.
http://www.robonova.de/store/files/data ... 136080.pdf

best regard
landyandy
Landy
Savvy Roboteer
Savvy Roboteer
Posts: 31
Joined: Wed Aug 12, 2009 8:38 pm

Previous
30 postsPage 2 of 21, 2
30 postsPage 2 of 21, 2