Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Extra Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=68)
-   -   pic: PS2 Driven Robot (http://www.chiefdelphi.com/forums/showthread.php?t=39394)

Not2B 22-08-2005 22:43

Re: pic: PS2 Driven Robot
 
Quote:

Originally Posted by jakep
We are working on drawing power from the OI using the LED driver pins, since the circuit only draws around 6 miliamps of current.


Hey Jake (or anyone else) - I heard that you can damage the OI if you draw too much current from it. Is that true? How much? Just want to keep that in mind before we start to blow up OIs.

GhostInTheShell 22-08-2005 22:46

Re: pic: PS2 Driven Robot
 
the rumble motor will work, it has to me a signal read by the PIC and sent oto the PS2 controller on the command line (data to the controller)

GhostInTheShell 22-08-2005 22:47

Re: pic: PS2 Driven Robot
 
yes u can blow the internal fuses by drawing too much current, we are gonna put an adapter that goes between the power port and the OI

mechanicalbrain 22-08-2005 22:49

Re: pic: PS2 Driven Robot
 
If you can go for it but I'm not sure you can get the necessary power. Also can the game ports output signals?

GhostInTheShell 22-08-2005 22:58

Re: pic: PS2 Driven Robot
 


heres the schematic for our current one

Al Skierkiewicz 22-08-2005 23:45

Re: pic: PS2 Driven Robot
 
Quote:

Originally Posted by Billfred
Well, good question. Here's the rule.



I have to admit, even I forgot about the part about portable computing devices connected to the joystick ports.

This then brings about the question of what exactly they meant by the rule. Did they mean to explicitly ban everything but pots and switches and the things they're housed in, or was the rule intended to block things like PDAs and laptops (which the average guy on the street would consider a portable computing device)?

In any event, nice work.


I think the rule is fairly clear that something as powerful as a laptop or PDA is the target of the rule. A dedicated controller feeding digipots and with no intelligence otherwise should be allowed.
The output current on the LED outputs is current limited to 10ma, but I wouldn't want to depend on using two of them in parallel to get higher current. All it would take is a few startup/init where one of the outputs comes on before the other and you would be dumping power supply current from one output to the other. Two diodes (one in series with each output) might work but you would have a voltage drop in the diodes that would be 0.6 volts below the OI 5 volt rail. Don't forget that the majority of the current demand occurs at the switching point of the proc so a simple averaging meter might be too slow to respond for accuracy. Your 6 ma might actually be close to current limit. You might be able to supply the digipots from one output and the proc from another and stay inside a safe current area. A lot of testing will tell for sure. Nice solution, I like the way you guys work and think.

emarion 23-08-2005 00:55

Re: pic: PS2 Driven Robot
 
I am one of the three main people working on the PS2 controller project. I believe Derek emailed First and asked about the controller being a "Portable computing devices" and First said that it was okay, but that of course the rules might be different in the next game. This is all assuming that the circuit can grab power from the OI, I believe.

I coded the asm on the pic chip (about 250 lines I believe), and will post it as soon as I completely fix it up. The circuit connects one of the digital outs (aux I believe) directly to ground. Because it is impossible for the normal joysticks to do this (they only uses different digital outs), the software on the robot should be able to figure out if a normal joystick or the PS2 adapter are plugged in, without requiring a physical switch on the OI or the robot to be programmed in only one mode. This would possibly allow hot-plugging of what is controlling the robot, assuming that one disables the robot when changing the cords.

So far if the PS2 controller is not pluged in to the circuit, or if it is not in analog mode, the circuit will output "nothing" to the OI (i.e. don't move the wheels or do anything). Hopefully in the future the circuit will be able to automatically put the PS2 controller in analog mode, like some PS2 games. This way the driver won't have to hit the "analog" button every time they turn on the OI.

The two digipots are ds1267's. Each digipot IC contains two 256-step digital potentiometers. The microcontroller is a pic16f688. Basically, the PS2 sends all its data digitally in serial to the microcontroller over one pin. This is how even if the PS2 controller uses 10k pots (which I'm not sure about) the circuit would still output using the correct 100k pots. L1, L2, R1, R2, the diamond, the circle, and if the driver is pressing down on the joysticks are sent from the PS2 controller to the OI. This is done by sending these eight digital inputs over two analogs. This is done by setting the 4 most signifigant bits of each analog (aux and wheel) to the correct value, and setting the least signifigant bits to 0111. This allows the "value" of the analog to vary by +8/-7, and have it all still work. The analogs "x" and "y" are used for the y value of the left and right PS2 joystick, respectively.

jrukes 23-08-2005 09:12

Re: pic: PS2 Driven Robot
 
emarion,

Congratulations to your team on a great addition to the OI! I'm very impressed that you created your own programmer and wrote your own downloader. That info could be very useful for teams interested in starting to use PICs.

You mentioned that you'd like to have the joystick automatically go into "analog" mode. Here are the commands you'll need.
0x01, 0x43, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 //enter config mode
0x01, 0x44, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00 // set to analog mode and lock out the mode button
0x01, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 //exit config mode

***Note: All of the values are in hexadecimal format.

Good luck,
Jason

GhostInTheShell 23-08-2005 10:37

Re: pic: PS2 Driven Robot
 
wow, thanks, weve been looking for that, it helps alot because if the controller goes digital, the robot goes nuts

Alan Anderson 23-08-2005 11:11

Re: pic: PS2 Driven Robot
 
Quote:

Originally Posted by emarion
...The circuit connects one of the digital outs (aux I believe) directly to ground. Because it is impossible for the normal joysticks to do this (they only uses different digital outs), the software on the robot should be able to figure out if a normal joystick or the PS2 adapter are plugged in, without requiring a physical switch on the OI or the robot to be programmed in only one mode...

The OI has a pull-down resistor on each analog input. It will interpret your ground as a disconnected joystick, and will send a "neutral" value of 127 to the robot. You won't be able to distinguish things based on that.

You might try connecting +5v instead. Very few joysticks are capable of getting the analog value above 250, so you might be able to detect a higher value as indicating the existence of your special circuit. Or you could try to find the proper mid-range voltage to make the OI send out "0" without triggering its open circuit detector (see if a 100K or 120K resistor to +5v works).

emarion 23-08-2005 12:14

Re: pic: PS2 Driven Robot
 
Quote:

Originally Posted by Alan Anderson
The OI has a pull-down resistor on each analog input. It will interpret your ground as a disconnected joystick, and will send a "neutral" value of 127 to the robot..

We're using a real digital input for this, not analog. I believe the digital inputs use pull-ups instead of pull-downs.

Alan Anderson 23-08-2005 12:42

Re: pic: PS2 Driven Robot
 
Quote:

Originally Posted by emarion
We're using a real digital input for this, not analog.

I was (and still am) confused by your saying that a grounded pin is impossible for a normal joystick. That's true of the analog inputs, and the "aux" signal you mentioned is an analog input (you probably meant sw_aux1 or sw_aux2, which are indeed switch inputs). However, the OI digital inputs are designed to be grounded when the switch is pressed. Grounding a switch input is not impossible; on the contrary, it's mandatory.

emarion 23-08-2005 12:58

Re: pic: PS2 Driven Robot
 
Quote:

Originally Posted by Alan Anderson
I was (and still am) confused by your saying that a grounded pin is impossible for a normal joystick. That's true of the analog inputs, and the "aux" signal you mentioned is an analog input (you probably meant sw_aux1 or sw_aux2, which are indeed switch inputs). However, the OI digital inputs are designed to be grounded when the switch is pressed. Grounding a switch input is not impossible; on the contrary, it's mandatory.

Sorry, I was probably unclear. We are using sw_aux1. What I meant was that the joysticks that we're using have only two buttons. Therefore it is impossible for them to signal a "push" of any other digital input. Our circuit pretends that it is pushing the aux1 digital input. Therefore the robot can tell what is plugged in.

Alan Anderson 23-08-2005 13:23

Re: pic: PS2 Driven Robot
 
Quote:

Originally Posted by emarion
What I meant was that the joysticks that we're using have only two buttons. Therefore it is impossible for them to signal a "push" of any other digital input.

Got it. Your joysticks don't connect to that input, so they can't ground it. I misread the description as if it said that no joystick could do it, which is obviously wrong (the white KOP joysticks have switches on all four digital inputs, for example).

[527]phil 23-08-2005 13:33

Re: pic: PS2 Driven Robot
 
Quote:

Originally Posted by Bcahn836
May be these can help?
Link 1
Link 2

exactly what i was talking about, the only problem is I'm using a BASIC Atom pro 24 pin, the programmings much different for the 28 pin. :eek:


All times are GMT -5. The time now is 22:05.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi