Archive for Southern R2 Builders Group A Place for Star Wars Fans
 


       Southern R2 Builders Group Forum Index -> Electronics
admin

PS2 Controller

Your basic PS2 controller can be used to drive and operate up 6 items.
You can purchase the controller board here :
http://www.cheapcontrolsystems.com
These controllers do not have the extended range as the popular R/C controllers used by most drivers, But they are inexpensive and easy to hide as your driving your droid around in public.
Danf

Thought I'd share this, found a ps2 controller library for the arduino.

http://www.billporter.info/playst...-controller-arduino-library-v1-0/

So I picked up a used mad catz mini wireless controller at Gamestop and played around with it a little. got it moving servos with the sticks and all buttons work. That's 2 sticks, the d pad, and 12 buttons. and since you write your own code, you could use combo's for almost limitless possibilities. And hey, the guy who wrote the library is a Floridian.
admin

AWESOME!!!!!!!!!!!!!!
That would be nice to have unlimited control.
Thats what I was doing years ago with the Phidget boards, But they have to have a onboard PC.
With the Ad. controlling it, That would give it a small footprint with power to boot.
Calvin
Danf

I've got R2 working with the PS2 controller. driving and dome rotation, as well as some sounds with the buttons from my sparkfun mp3 trigger. He's a little harder to control than with my big radio with the big sicks, not sure if its just practice or if I need to tweak my code a little. still need to work on volume control and sorting sounds into different categories since now I can do up to 256 instead of 12! How do you jedi users do it?
admin

It takes some time to get use to the Ps2 controller.
When I first did mine, He would jump and turning was spooky.
Your building what I always wanted in mine.
Keep up the great work.
Calvin
admin

Dan,
Is your setup the same as the guy on the website you posted?
Calvin
Danf

Yep, just followed his directions, hooked up to a uno and it worked fine. He also has a trouble shooting page but I had no problems. Randy hooked one up to and we are trying to get it to work with his think geek sound system with a little success. I bought a 4 port adapter and we took it apart for the female plugs for the controllers.  I have one extra if anyone needs it, or  the web page links to a place where you can buy them . I can give my code to anyone who wants to try this route.
wheels

Like Dan said, we are working on this PS2 controller and I am trying it out with the ThinkGeek shirt. We had the Uno working with individual pins connected to various buttons on the controller.

Dan looked into a way to control multiple items with a shift register type chip. We hooked it up and it needs something else and we are not sure exactly what it needs.

Don't worry Dan, I am not giving up on this yet. We have pre-planning starting Monday so my time for R2 will be limited some.

I do want to say publically, Thanks for your assistance with this project.
I look forward to trying again before too long.
admin

Is there a way to use just a wireless Ps2 controller?
The reason I ask,
The ARC32 board I have will work with the Ps2 controller, But I can't code it.
Calvin
wheels

My goal (and I think Dan's) is to have the PS2 control both movement, dome rotation and for me, have the various buttons control the different sounds that the ThinkGeek shirt can do (20 and volume up and down).

That is the plan, we just need to figure out how to do it Smile

Using the Uno, the PS2 wireless adapter uses only six wires for input and two of them are for power (3.3 volts). Now the challenge is to have the movement and sounds controled by various other inputs  or outputs whatever is needed to the Uno board.


EDIT - Should be six wires for input and two of them are for power - Sorry for any confusion.
Danf

The library does all the hard work of figuring out all the signals from the ps2 controller. What button is pressed, joystick position, ect.  But you have to tell it what to do when a button is pressed or stick is moved. Its not very difficult to do. Depends on your setup. I setup the drive and dome Using Arduino's included servo library,  and found a library for my sparkfun mp3 trigger. Basically it's   if (ps2.buttonPressed(red))  trigger.play(3);    I'd be happy to share my code with anyone interested in it, it works with a sabertooth dual speed controller for the foot drives, a Senna style dome drive ( a servo bumps switches) and the sparkfun mp3 board.
admin

I noticed the video shows additional parts attached to the Ps2 controller so it could send the signal to the robot.
Is there a away to eliminate the extra parts attached to the wired Ps2?

Years ago I was working on a setup similar to what your working on and the code would allow for multiple buttons to changed what they controlled.
You could hold a front trigger button on the controller and it would shift what the buttons could control.

I'd love to see your setup work.
Calvin
Danf

Ah, I see what you're talking about. You can just use a wireless controller, just like with the c6c, I don't know why he used all that stuff in the video.  I set up the buttons so if I just press one of the four shape ones, it plays a random sound in 4 categories. If I hold the L1 trigger and press one of the four I get a specific sound, scream, wolf whistle, Leia message, etc. L2 +one of the 4 gives a different set and R1 +one of the 4 plays music. I'll try to remember to bring my camera to work and take a little video. And your right, With a little practice it's much easier to control. I'm loving this setup!
admin

A video would be great!
Will you guys be posting your code?
Or a part list.
Calvin
admin

Which Arduino are you guys using and where to order it?
Calvin
Blsith

I had a chance to stop by and see Dan's R2 in action.  The controller functions look really good!  I definitely liked how it's an "all in 1" solution with quick hit buttons.

Very cool!
admin

Do you think this setup could also control Teecee's light system.
It also uses a Arduino.
Calvin
Danf

Here is a video link

http://www.youtube.com/watch?v=H9BcXc7ixT0

As to controlling Teeces logics, that is my next step. I have one Arduino in the dome to run the logics and psi's, and plan to hookup some servos to it to move the hp and open some panels, and one in the body for the Ps2 and Mp3 Trigger.  I have to figure out how to hook them together, I think through a serial connection. (I'm just learning all of this stuff) Unfortunately, it may take me a little while as I have gotten a bit behind at work (playing with all of this). Once I get that figured out, we'll have to come up with a good name for the system, like The Padawan System - Playstation, Arduino, ..Digital,....Analog,...um...Wan. Anyway, here is my code for just the Sabertooth and the dome

Code:
#include <PS2X_lib.h>  //for v1.6
#include <Servo.h>
PS2X ps2x; // create PS2 Controller Class
Servo RXservo;
Servo RYservo;
Servo LXservo;
int error = 0;
byte type = 0;
byte vibrate = 0;

void setup(){

 RXservo.attach(6);
 RYservo.attach(7);
 LXservo.attach(5);
 error = ps2x.config_gamepad(13,11,10,12, true, false);   //setup pins and settings:  GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error
 
 type = ps2x.readType();
 }

void loop(){
    
 if(error == 1) //skip loop if no controller found
  return;
  
  ps2x.read_gamepad();          //read controller
      
   RXservo.write(map(ps2x.Analog(PSS_RX), 0, 255, 60, 120));
  RYservo.write(map(ps2x.Analog(PSS_RY), 0, 255, 60, 120));
  LXservo.write(map(ps2x.Analog(PSS_LX), 0, 255, 60, 120)); ;
 delay(50);
    
}


And here it is with the Mp3 trigger added in
Code:
#include <PS2X_lib.h>  //for v1.6
#include <Servo.h>
#include <MP3Trigger.h>
 MP3Trigger trigger;

PS2X ps2x; // create PS2 Controller Class
Servo RXservo;
Servo RYservo;
Servo LXservo;
int error = 0;
byte type = 0;
byte vibrate = 0;
byte vol = 20;

void setup(){
 trigger.setup();
 RXservo.attach(6);
 RYservo.attach(7);
 LXservo.attach(5);
 error = ps2x.config_gamepad(13,11,10,12, true, false);   //setup pins and settings:  GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error
 trigger.setVolume(vol);
 type = ps2x.readType();
 }

void loop(){
    
 if(error == 1) //skip loop if no controller found
  return;
  
  ps2x.read_gamepad();   //read controller and set large motor to spin at 'vibrate' speed
  
 if(ps2x.Button(PSB_PAD_UP))
 { if (vol>0)
 {vol--;
  trigger.setVolume(vol);}
  }
  if(ps2x.Button(PSB_PAD_DOWN))
  { if (vol<255)
 {vol++;
  trigger.setVolume(vol);}
 }
  if(ps2x.ButtonPressed(PSB_GREEN))//triangle top
   {if(ps2x.Button(PSB_L1))
      (trigger.play(8));
    else if(ps2x.Button(PSB_L2))
      (trigger.play(2));
    else if(ps2x.Button(PSB_R1))
      (trigger.play(9));
     else
      (trigger.play(random(13,17)));}
  if(ps2x.ButtonPressed(PSB_BLUE))//x bottom
   {if(ps2x.Button(PSB_L1))
      (trigger.play(6));
    else if(ps2x.Button(PSB_L2))
      (trigger.play(1));
    else if(ps2x.Button(PSB_R1))
      (trigger.play(11));
     else
      (trigger.play(random(17,25)));}
  if(ps2x.ButtonPressed(PSB_RED))//circle right
   {if(ps2x.Button(PSB_L1))
      (trigger.play(7));
    else if(ps2x.Button(PSB_L2))
      (trigger.play(3));
    else if(ps2x.Button(PSB_R1))
      (trigger.play(10));
     else
      (trigger.play(random(32,52)));}
  if(ps2x.ButtonPressed(PSB_PINK))//square left
   {if(ps2x.Button(PSB_L1))
      (trigger.play(5));
    else if(ps2x.Button(PSB_L2))
      (trigger.play(4));
    else if(ps2x.Button(PSB_R1))
      (trigger.play(12));
     else
      (trigger.play(random(25,32)));}
  RXservo.write(map(ps2x.Analog(PSS_RX), 0, 255, 60, 120));
  RYservo.write(map(ps2x.Analog(PSS_RY), 0, 255, 60, 120));
  LXservo.write(map(ps2x.Analog(PSS_LX), 0, 255, 60, 120));
 delay(50);
}
Danf

admin wrote:
Which Arduino are you guys using and where to order it?
Calvin

I have a Uno with the bigger replaceable chip that I use for testing and programing like this one. http://www.sparkfun.com/products/9950
Than I build my own for each project since I don't really need the USB and programing stuff in there. Sparkfun sells the chips for 5.50 and the rest of the parts are dirt cheep at places likehttp://www.taydaelectronics.com/servlet/StoreFront If you don't like soldering you could use just about any of the Arduino's or clones out there, just realize that some, like the Pro and the Pro mini need a special cable to program them. of course you would only need one cable to program as many as you want. Hope this helps.
wheels

I agree with you Brian.
The one controller does it all is what has me so intrigued about this set up.
I am trying to get the PS2 joysticks to control movement with the right joystick and dome rotation with the left joystick. At the same time, I am trying to hook up the 10 pin ThinkGeek shirt via some sort of shift register chip, so as not to use all the available slots on the Arduino, to allow the buttons on the controller to operate all 20 sounds and the volume control.

To Calvin:
When Dan and I were working with this in his shop a couple of weeks ago, we were using the Arduino Uno. Like Dan said, it has a removable chip and what he is doing is leaving mounted in the droid and uses a second one to fiddle with and programs the chip then swaps the chip into the board that is mounted in the droid. Very clever and useful.

Way to go Dan!  Very Happy
admin

Dan,
Could you post a pic of how you connected the Ps2 receiver cable to the board?
I'm going to order the board tonight and start building Brenda a system for her new droid. She has the teecee system on order already.
I have a Ps2 receiver cord already and I think it will work.
Calvin
admin

Have you tried to see if the code has a fail safe?
I'm not sure but this line of code could be it.

if(error == 1) //skip loop if no controller found
 return;
I'm so overjoyed about this setup.
AWESOME WORK!!!!!!!!!!!!!!!!!!!!!!!!!!

Calvin
Blsith

admin wrote:
Do you think this setup could also control Teecee's light system.
It also uses a Arduino.
Calvin


Once I get my logics in and built I'm going to play around with doing this.  Specifically I've been looking at it for the JEDI Control, but using I2C it should be nothing to make the arduino work.  What I may do with Teeces is work out the I2C commands for each action, and then make an intermediary board that all it does is convert the JSL code from the JEDI into the standard I2C for everyone.
admin

I downloaded the Ardiuno software and it's installed.
I copied the 1st part of your code and have it on the 1st Tab of the editor.
Do I need to open a 2nd Tab and copy the PSX2 code to this tab?
I guess this is the code library?
Calvin
Danf

Calvin,   if you haven't already, download the Arduino PS2 Controller Library V1.7 from this site.
http://www.billporter.info/playst...-controller-arduino-library-v1-0/
unzip it and put the whole folder into the libraries folder in the arduino folder. Then move the PS2X_Example folder into the main arduino folder.  Now if you open the example or either of my sketches it should automatically include the library. It doesn't show the library but if you click on  verify it shouldn't give you any errors.

From other threads I've read on c6c and Ps2 failsafe may depend on the controller. I can tell you with my madcatz mini that says 2.4Ghz on it if I turn off the controller while moving or turning the dome it stops. On my test bed I had it hooked up to 3 servos and if I turned off the controller they would all go to center. I haven't been able to check what happens if I get to far away because I tried walking out of the store and as far as I could go and still see him thru the window (about 60-70 feet) and never lost signal! Plastic Droid, don't know how far you could go in an alum one.
admin

I'll give it a try.
If your turning off the remote and the dome stopped, That's perfect.
The code is recognizing the loss of signal and that is the same as a failsafe.
Great, I was worried about that.
I can't wait till the board arrives to start learning this setup.
Calvin
Danf

Here is a pic of Randy's test. you ca just see the Ps2 socket on the left. He had a bunch of telephone wire that we soldered to the back of the pins and it works great for sicking in the arduino pins.

Click to see full size image
admin

I have this remote:
http://www.lynxmotion.com/p-552-ps2-robot-controller.aspx

And this line:
http://www.lynxmotion.com/p-73-ps2-controller-cable.aspx

I hope the remote will work.
Calvin
Danf

Looks good. and I think that is the connector that he recommends in his site.
admin

Dan,
Do you have the library file for the Mp3Trigger?
I was compiling your code and need this:
#include <MP3Trigger.h>
Do you think I will need the Servo file?
#include <Servo.h>

Your 1st code you posted compiled without any problems,
But when I did the Mp3 addition it asked for the Lib.

Calvin
Danf

You can get the mp3 trigger library here. https://github.com/sansumbrella/MP3Trigger-for-Arduino
and a little tutorial about it here. http://interaction.dundee.ac.uk/~...-mp3-trigger-module-with-arduino/
This is for the mp3 trigger v2 from sparkfun http://www.sparkfun.com/products/9715

The tutorial says you ave to name your files TRACK001.MP3, TRACK014.MP3, TRACK176.MP3 etc, and that's true for using the triggers or the trigger command in serial but for the play command in serial the name doesn't matter.
The command - trigger.play(5) plays the 5th file.
I took I think 52 sounds from the Jedi mp3's and named the first 8 that I wanted to play specifically 01laugh.mp3,  05leia.mp3 etc, 01 thru 08  then the 4 songs are 09 thru 12 and the rest are 13 thru 52  in 4 categories.
The servo library comes with arduino so there's no need to download anything for that.
Danf

I sent Bill Porter a link to my video and he put it in the project showcase on his sight.
http://www.billporter.info/playst...-controller-arduino-library-v1-0/
admin

Thanks Dan,
I was looking at the pic you posted and was trying to see how you would power servos.
I assume the servos would need their own power supply and they would just use the signal wire from the ardiuno.
And the signal wire to the Sabertooth would be all you need to power the feet and dome.

I hope that guy does post your video, You really have something to be proud of and you've done a lot of work on this project.

As soon as the board arrives, I will see if I can help.
I'm not very good.
Blake is working on my Arc32 as I can't code it at all.
It would be cool if Blake could tie this board into your setup and it could power and control the servo hookups.
Calvin
Danf

Wow, I made it to Hackaday!
http://hackaday.com/2011/08/21/hackaday-links-august-21-2011/
Bill who wrote the Ps2 library submitted it.
Calvin, I did use another LM6805 voltage reg for the servo controlling my dome motor since they can only handle about one amp. They do have to share a common ground though with the arduino. I've benn reading a bit about ubec's which are supposed to be a lot more efficient  and can handle more amps. I've seen some on ebay for under $10 that are up to 5 amps. I wonder if Todd is familiar with these and could chime in.
also, here is a good tutorial on building your own arduino
http://www.instructables.com/id/P...duino-Arduino-compatible-circuit/
wheels

Having seen this in person, I have decided to go this route for sounds and controls.
Way to go Dan!
admin

Dan,
I found this one on eBay
http://www.ebay.com/itm/DCDC-Powe...hash=item3cba3cfc9a#ht_3225wt_922

Down further they list more with higher amps.
I was thinking about building a 5v rail like I use to make for a computer,
But I'm not sure about how much electrical noise it would generate.

I also found this here for connecting wiring via screw terminals
http://store.fungizmos.com/index....=04fde8802d03ffd6c9c172d638149191

Congrads on making it to Hackaday !!!!
Calvin
admin

Dan,
How did you connect the Mp3 to the Arduino?
Calvin
Opposes,
I see it in the tutorial
Danf

Two things that drove me nuts on the mp3 trigger - to use the serial you cant use the power jack at the bottom of the board, you have to power it with 5 v to the pins by the serial pin.
In the pic its the row of holes on the right.

what took me forever to figure out is there is a tiny switch at the bottom  of the board in the middle that has to be switched to usb to use that power.

also on the volume control - 0 is full volume 255 is no volume -
Danf

I was looking at these ubec's
http://www.ebay.com/itm/Corona-CB...cessories&hash=item1c1724e98b
http://www.ebay.com/itm/Hobbywing...cessories&hash=item415be2ee73
I was thinking the 5 amp to allow for more servos later on but now I'm thinking the 3amp should be more than I need for now for less than half the price, and I could always add another one later.
I probably need one for the dome as well as the body.
admin

Dan,
1st I want to tell you how PROUD I am of your work.
I hope you don't mind but I spoke with John about the dome light system
and your Padawan System.
He said he would be happy and is excited about your work and is willing to help tying in the lights.

I hope I did not overstep my bounds speaking to him about you work,
But you 2 have come up with the best 2 systems I've seen in all my years.
Calvin
eagledancer

just to let you guys know, the jedi is set with 1 amp fuse and its got 16 servos hooked up!! servos for doors dont take much and you very seldom use more then a few at a time, so far with my scream/short circuit i am using 6 servos for doors, and i have yet to blow that 1 amp fuse
so that 3 amp unit will do all you want. keep in mind you will be using a speed controller to turn the dome and that CAN be tied into your system.... it only uses the signal from your unit, it has its own power feed
Danf

Calvin, no problem. I welcome all the help I can get! I'm really just putting together parts of other peoples hard work. Wink
By John I assume you are talking about Teeces? He's one of those hard workers I'm stealing from. Laughing

Todd, that's good to know. I'm actually using a servo to control the dome like this
http://astromech.net/droidwiki/in...hp?title=Dome_Controller_Tutorial
Had a servo, had no money for a speed controller (someday though).
when I first hooked this up I had the arduino, ps2 reciever, mp3 trigger, and dome servo all running off of 1 7805 voltage reg. Everything worked unless I spun the dome around several times. Than it would stop responding till I turned him off and back on. I moved the dome servo to a separate voltage reg and that solved the problem.
I think I'll go for the 3 amp, any brands you can recommend or more importantly stay away from?
admin

PHEWWWWW, I thought I was going to get into trouble.
Yep, It's TeeCee I talk with him alot by email.

Hey just found this:

http://letsmakerobots.com/node/26054

http://letsmakerobots.com/chill/view/166?page=1
Danf

Some progress, I got a software serial connection to the dome arduino since the mp3 trigger is hooked up to the hardware serial and got displays changing with different sounds but about 50% of the time when hit a button that sends a signal to the dome the drive motors jump like I bumped the joystick. I disconnected the mp3 and did a hardware serial to the dome and that worked with no jumps. I e-mailed Bill to see if he's ever had a similar problem and will keep working on it.
admin

Hum,
I wish I had a awnser for you.
Calvin
Danf

Success!

I changed the baud rate for the serial connection.
Seems something, probably the sabertooth, doesn't like lower baud rates.
Went from 9600 to 38400 and got just the slightest flutter 1 out of every 10 to 15 times. Then went to 57600 and its perfect.
Here is a vid.
http://youtu.be/0YXE6oHv8ZY
Still going to add some servo's to the hp and a hp light, and need to get some different display patterns like the jedi cantina and the short circuit. And the list goes on.
admin

Ahahhhhaaaahhaaaa!!,!,!!,,
THAT WAS AWESOME
You built the V2 lights, Right?
I really like the way you setup your lights with sound.
Ahahhhaaaaaa, The video really got me.
Calvin
Danf

I think this is a complete rundown minus foot motors and dome motor and some assorted wire and connectors.
If I remember anything else I'll update this.

2 arduino's                 60 (or build your own for less)
PS2 Controller Cable    5
Ps2 Controller (new)   20  (or 15 used)
MP3 Trigger v2            50
microSD flash card        5  
Sabertooth 2X25        125  (light droids might get by with 2x12 for 80)
Teeces v2 logics           45  (v3 should work also)
joymonkey bezels        12
4 led's for psi's              3  (piranha from superbrightleds.com)
1/4" stereo plug & jack   1   (tayda electronics)
________________________________________________________________
                                 $326

The stereo plug and jack is my sliprng for the dome, 3 wires,
12v pos, neg, and serial signal.
Blsith

Danf wrote:
I think this is a complete rundown minus foot motors and dome motor and some assorted wire and connectors.
If I remember anything else I'll update this.

2 arduino's                 60 (or build your own for less)
PS2 Controller Cable    5
Ps2 Controller (new)   20  (or 15 used)
MP3 Trigger v2            50
microSD flash card        5  
Sabertooth 2X25        125  (light droids might get by with 2x12 for 80)
Teeces v2 logics           45  (v3 should work also)
joymonkey bezels        12
4 led's for psi's              3  (piranha from superbrightleds.com)
1/4" stereo plug & jack   1   (tayda electronics)
________________________________________________________________
                                 $326

The stereo plug and jack is my sliprng for the dome, 3 wires,
12v pos, neg, and serial signal.


Thanks for this Dan, I think I'm going to go this direction once I get back to building my droid after the move.
admin

Dan
Would you look at this pic and tell me if the wiring for the Ps2 goes to the Arduino like this.



I'm assuming your using the red wire for the power to the Ps2 Receiver 3.3v
and
The ground to the Ps2.

Thanks
Calvin
Danf

here is a wire diagram for the lynxmotion connector that I think you said you have


for others using a connector taken from some other hardware  this is the plug from the controller



connections are:
ground to ground
+5vdc or red power 3.3v to 3.3v
clock (CLK) to pin13
command (CMD) to pin11
attention (ATT) to pin10
data (DAT) to pin12

that's it. the others aren't used. Load the example that came with the libary and open the serial monitor, make sure its set to 57600 and start pressing buttons. you should see messages in the serial monitor.
admin

Thanks Dan,
I now have my Ps2 talking to the Arduino.
I also had to reconfigure the Lynxmotion cable to match the pins.
Here's a new diagram for the Padawan Cable.
Calvin

admin

Just for fun, I tried the Padawan system on the Arduino Mini Pro 5v to see if it would work like the Uno and it does.
The pin configuration is the same and for powering the Ps2 use VCC and the ground next to it..
I bought the Pro for TeeCee's lights.

Dan,
Do you have a update for your code to work with the lights?
Calvin
Blsith

For those that haven't bought some of the stuff - it looks like Lynxmotion does a ~ 15% discount over Halloween each year (anniversary sale).

I'll just put a reminder up to pick the stuff I need up then.  Worth saving $20 or so on what I need to order.
admin

Dan,
I hope I'm not asking to many questions but I'm trying to get mine working. If I become a pain please let me know.

I have the Arduino and the Mp3 connected and working, Kinda.
I put in a song to test and I noticed I can't stop the song until it has played the entire song.
Does this happen to you?
I printed your code and did not see anything to tell the Mp3 to stop playing.
Is there away to code a stop play button?
Calvin
Danf

Brian- thanks for the heads up on the sale Very Happy

Calvin-right now I don't have a stop button in the code. If you trigger another sound the first will stop and the new one will play so if I want to stop a song I just hit a beep. It should be easy enough to put in a stop though. Let me know if you want me to do that and if so what button or combo you think would be good.

My latest codes can be downloaded here

Download body_r2.pde from Host-A

Download dome.pde from Host-A

And here is a zip file including body, dome, and all the sounds I have on my sd card in order and named to work with the code

Download padawan.zip from Host-A
admin

Hum,
I have only 2 sounds on the card and I don't have it working correctly yet.
If a new sound will stop the playing sound that's perfect.
I'll download your new code and the sounds and try it again.

Happy Grampa day,
I didn't know, I must have missed a post.
Brenda tuned me in.
I'm so happy for you and your family!!!'!!!!!!
Calvin
Danf

oops. I forgot to mention for the dome arduino you need the following library's

ledcontroll  (for Teeces logics)

EasyTransfer  (from Bill Porter-http://www.billporter.info/easytransfer-arduino-library/)

for the body arduino

ps2x (from Bill Porter-http://www.billporter.info/playst...-controller-arduino-library-v1-0/)

SoftEasyTransfer (included with EasyTrasfer above)

MP3 Trigger (https://github.com/sansumbrella/MP3Trigger-for-Arduino)

NewSoftSerial (http://arduiniana.org/libraries/newsoftserial/)

You need to run a wire from  pin 8 on the body arduino to pin 0 on the dome arduino (I do it through the 1/4" phono plug)
admin

Wow,
That's allot of stuff.
But I'll figure it out.
We need a Dans Padawan class setup.
Hahahahahaaa
Calvin
Danf

Here is my current hardware setup. The dome controller servo has a separate 5v reg power. will probably be replaced with one of the 3amp ubec's from eBay.



Click to see full size image
admin

Nice diagram Dan,
Do you think the Teecee's v3 lights with the Arduino mini will be hard to wire?

I wonder if there is a benefit to staying with the UNO so other things can be controlled also?

I have the sound card working now and I'm altering some of the sounds and how they are controlled by the Ps2 buttons. Your code makes it so nice to be able to do this.

This weekend I plan to get a project box and mount the Padawan system inside and add a master connector so the system will be easy to remove from the droid and work on it.

Calvin
Danf

Calvin, I have not done anything with the mini or the v3 logics but I think you should be fine. Are you using the v3 psi's  as well?  If so that will free up 4 arduino pins over my version leaving lots of growing room.
I like the project box idea, if that includes the sabertooth it could save alot of money being able to move it between multiple droids.
I'd love to see some pics
admin

I'm looking for the correct size box to mount the system, I'll find it by this weekend.
I haven't thought about putting the Sabers inside the same box, but I like that idea. I wonder if heat would be a problem?
Although I do plan to vent the box.

We just finished setting the code for our sounds.
We have only used 3 of the trigger buttons and the triangle, circle and X button. This leaves the 4th trigger and the square button open for other functions. I made a 10 minute random sound file and it freed up the remote some.

We are waiting for the Teecee's to come in the mail, Can't wait till they get here.

If it's ok we you, (it was suppose to be a surprise) I'm making a presentation for MegaCon and the Padawan is the highlight of the presentation. When it's finished Ill send you a copy and if it's good enough, let me know and it will play at Mega in our booth.

Calvin
admin

Dan,
I bought a book on iPad about building a 8 servo board using a Arduino mini. I'm trying to find away to show a pic of the board.
The guy list the parts and the code.
I don't know if this is something that would be helpful but I was looking for away to use servos on the doors, pie panels and etc.
Do you already have something in mind?

Calvin
Danf

Calvin.
The video sounds great, can't wait to see it.
As for servos, the servo library that comes with arduino can control up to 12 servos. See this link
http://www.arduino.cc/en/Reference/Servo
This is pretty much what I did with the sabertooth and exactly how I'm doing my dome. A servo bumps one of two switches.
This is why I'm looking at 5v power drops that can handle more amps, so I can add more servos.
As soon as I have time, I'm going to add a hp light and 2 servos to the hp. I plan to change the volume control to work while pressing right trigger 1 and if its not pressed the d pad will control the hp.
Don't forget you also have the start and select buttons as well as buttons when you press the joysticks down.
admin

That would be cool to control the Hps.
By chance, do you hear a clipping sound from the Mp3 Trigger when you play a long sound or song?
It's hard to hear but it's there.
Calvin
admin

I bought a nice little project box at Radio Shack and started installing the Padawan.
The box has plenty of room for everything and enough room for ventilation between each board.



The Ps2 receiver is mounted to the side of the box and on the side of the box is a 25 pin D-Sub connector that will be the master connection.
This will make it easy to remove the Padawan from the droid for repair or use in another droid.
I need to find some heavy connectors for the Sabertooth.



Calvin
admin

I'll have to post some more pics because I've moved a couple of things around in the box.
I also plan to install a small fan to keep the box from getting to hot.

Dan,
If you get a chance I need to talk to you about a project, but I need to talk to you off the forum.
Calvin
admin

Dan,
I meant to ask you, On the wiring diagram it shows how to connect the Sabertooth to the Arduino using the signal wire.
Does it need a ground also?
Calvin
Danf

Calvin, I honestly don't remember if I connected a ground between them, I'll look tomorrow at work.
You can pm or email me.
Blsith

admin wrote:
I bought a nice little project box at Radio Shack and started installing the Padawan.
The box has plenty of room for everything and enough room for ventilation between each board.

Calvin


Looks awesome Calvin, I am getting excited to get back to working on the droid once I have a new house.
Danf

admin wrote:
Dan,
I meant to ask you, On the wiring diagram it shows how to connect the Sabertooth to the Arduino using the signal wire.
Does it need a ground also?
Calvin


Your right Calvin, I updated the diagram, thanks.
I got the hp light and servos working. I had to change the Leia display to make it work with flickering the hp light. the old one used the delay command which made the hp delay also. new one uses a counter instead, I'm learning so much about programing, it's fun and frustrating!
admin

Cool, Your going to have everything figured out for a droid.
I've been working on Brendas and Crissys droids to get them built.
I need to get back to setting up the Box with the UNO.
Also the Teecee's should be in soon.

Calvin
Danf

I've been getting several pm's on astromech.net from people having problems with the padawan code
it seems Some changes were made to some of the libraries used to make them work with Arduino 1.0, unfortunatly, some of my code didn't work with these changes.
I also had to update some libraies to make them 1.0 compatable.

I have tested each of these updated sketches with the enclosed libraries and have included the libraries just in case future updates effect the sketches.

There are sketches for both ver1.0 and the older versions.

I recommend trying the example sketch included with the ps2 library to be sure the ps2 conroller is working properly.


Download padawan_v1.2.zip from Host-A

hopefully this solves any problems anyone may be having.
Danf

Hey all, long time no talk.
Hope everyone is doing well.
Randy finished his R2, congrats Randy, but we had a small problem with the padawan
He got some erratic drift in one wheel from the sabertooth.  his is a 2x25 version 2, mine is a version 1.something. We traded Sabertooths so he could make it to an event and I could play with some ideas for a fix for his and I believe I have it. I changed the code to use a serial connection to the sabertooth instead of sending servo signals. This is working great in my droid with Randy's sabertooth and will probably be a better way to it with any sabertooth that can use serial ( most models except the 2x12 R/C).
I have also made a new version of the dome code for Teeces v-3 lights with psi's hooked up in 2 chains like what seems to be popular.
If anyone has had any problems or would like to beta test either of these let me know.
admin

Dan, Where have you been?
We have been worried about you.
So glad to hear from you and your still working on the  padawan system.
After C6 I will need your help like crazy setting up a setup for Brendas new droid and a display for Megacon.
Calvin
wheels

Thanks again Dan for all your help with my droid. I will try and get by to see you so we can swap saber teeth Very Happy

Calvin, I am looking forward to seeing you at C VI and showing off my droid to you and Brenda. Dan's handy work went into the PS2 set up and the electronics set up in general. Also, I can show you how all that Sanding you helped me with paid off in a great looking dome.

See you soon!
wheels

A quick report after Dragon Con:

Everyone was AMAZED that I run R2 with this PS2 controller set up  Very Happy

I sat on the panel of R2 builders this year. It was great to demonstrate to the audience that there are multiple ways to control a droid.

Doug had his Spektrum 6, Blake had his PC tablet running his and I had the PS2.

Thanks to Dan for his help in getting this set up.
admin

Awesome dude!
I'm so jealous you have the Padawan system. I want it in ask my droids.
Hope you had fun.
Calvin
Danf

Added some automation. Every 5 to 20 seconds he will make a sound and/or turn his head. Every 3/4 to 10 seconds he will move the holo. Can still control both manually even with the automation on, and can leave auto on while driving him around.
http://youtu.be/PIhyjXBI_mU
admin

Your my Ps2  HERO.
Calvin
wheels

Hello all,

Update as of 12-27-12:

I spent the day at Dan's shop and we installed the servos on the front holo projector and tweaked a few lines the padawan arduino code.

For those of you who were at Todd's build day and witnessed the issue I was having with the dome motor not responding, Dan and I discovered an unstable wire connection between the body arduino and the dome arduino. After repairing this wire, (knock on wood) it appears to have solved the problem.

I took some video of Dan and my droids with their automation on and chatting with each other. Once I get it downloaded, I will share.

Thanks to Dan for all the help  Cool

       Southern R2 Builders Group Forum Index -> Electronics
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum