Putting robotics at your service™

Free shipping on orders over $200

Programming assistance for my new Mech please (PS2)

Print view Share :
Previous topicNext topic

Page 2 of 5 [ 62 posts ]

1, 2, 3, 4, 5
Novice ( offline )
Posts: 72
Posted: 2010-03-29 18:25 
WE GOT A HEARTBEAT!! it worked great. All the buttons beep, and L1 steps up both motor speeds, while R1 brings them both down. Im gonna look through the code to see if I can try to understand what you did. in case I forgot to mention it for the day YOUR AWESOME!!!


User avatar
Guru ( offline )
Posts: 3299
Posted: 2010-03-29 18:39 
Vsions wrote:
WE GOT A HEARTBEAT!! it worked great. All the buttons beep, and L1 steps up both motor speeds, while R1 brings them both down. Im gonna look through the code to see if I can try to understand what you did. in case I forgot to mention it for the day YOUR AWESOME!!!


great news. happy it worked for you. im kind tempted to buy the track system myself now.

anyway, thanks for the good words.
hopefully we can work out the other commands soon. iv been looking at the setup you have and the arrangement looks quite tight but more to the point it would be harder for me to calibrate parts of the code i have in mind for you as i don't have your robot on my desk.

i can give you the basics but it would be up to you to calibrate the in's and out of the movements. eg, minimum and maximum rotations of the servos so they don't collide etc.

ill have another look tomorrow (as its bed time here) and i will start dropping you bits of code to add to your current version.

Next will be base rotate and Hip control.

one question:
what is the servo in the wrist doing, before the gipper? im guessing it will move the "fingers" in a passive motion but im not sure i can see the mechanics well from the pictures.

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk
Create, Innovate, Inspire.


Novice ( offline )
Posts: 72
Posted: 2010-03-29 19:02 
I am waiting for some parts from Lynxmotion at the moment to complete the hand assembly. That servo will eventually have link arms attached to the grippers to open and close them. I am alos going to be mounting the ssc 32 and tightening up everything so its neater. Once I do I will take new pics and closeups so you can have a better idea of the setup. It makes me very happy to see this thing actually moving, as I have been trying to put it together for over a year trying to get funds for it. Man you made my day:)

On another note I looked through your code and I like that its so neat, I find its much easier to tell what is happening although I still have a very weak understanding of everything but at least your setup is not confusing. Im going to keep studying it along side the programing manual I have to try and pick it up more.


Novice ( offline )
Posts: 72
Posted: 2010-03-29 19:12 
also I checked out your videos and they are amazing. Particularly that Iron Wolf Gait test. I would love to see that going on the ground.


User avatar
Guru ( offline )
Posts: 3299
Posted: 2010-03-29 19:39 
yeah some more pictures would be great, i look forward to it. 8)

i have attached another code here, im hoping that L1/2 will control the left side and R1/2 will control the right.
differential steering! 8) if not ill try tomorrow.

thanks for subscribing to my vids. there is one of it walking but its very sluggish at the moment.


Be safe. :wink:


Attachment:
ps2_ssc_test3.bas [7.37 KiB]
Downloaded 61 times

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk
Create, Innovate, Inspire.
Novice ( offline )
Posts: 72
Posted: 2010-03-29 21:42 
cool, its definitely getting closer, bothe sides are now controled by L1 and L2


Novice ( offline )
Posts: 72
Posted: 2010-03-29 22:24 
ok so I found the value that was off. Originally it was like this

Code:
ServoUpdate:
serout SSC_OUT, SSC_BAUD,["#15P", DEC ldrive, "#14P", DEC Ldrive, 13]


seems like both were set to left side so I just changed the latter drive to Rdrive and it worked. Im pretty excited this is really cool stuff :)


User avatar
Guru ( offline )
Posts: 3299
Posted: 2010-03-30 16:33 
oh well done. my mistake. :oops:

i will try and throw some codes to you this week, im a bit busy here at present but if i get a change ill post some code sections to you. :wink:
have you learned much from the current code i wrote?
to add servos to this you would need to define them like this.

Add the variable at the start of the code.
Code:
Servo1   var word


you would need to update the servo driver.
first define the pin number (replacing the ?) servo name (servo) or what ever you wish to call it.
we use 13] at the end as a Return or Closing character.

Code:
ServoUpdate:
serout SSC_OUT, SSC_BAUD,["#15P", DEC ldrive, "#14P", DEC ldrive, "#?P", DEC Servo1, 13]

return


if you feel you wish to get it moving you can use simple servo commands by setting up a button for the command. here i have used X
we start by saying IF the button is pushed THEN
then followed by the servo positions. Do you know how servos work?
1500 is center. if you went to 1900 the servo would move clockwise about 45º and if you used 1100 it would be about -45º
also we need to add the ServoUpdate Subroutine before the end. this updates the servo pins.
At the end you need to close the IF command by using ENDIF
Code:
   IF (DualShock(2).bit6 = 0) THEN   ;Cross Button test
       servo1=1500: servo2=1500: servo3=1500:

      gosub ServoUpdate
   ENDIF

this code would center the selected servos.

the servos will move very quickly to a given position as we haven given a time command, i will go though this asap. gotta pop out for a second.


Good Luck. :wink:

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk
Create, Innovate, Inspire.


Novice ( offline )
Posts: 72
Posted: 2010-03-30 20:34 
Yes, Ive actually been really trying to dissect your code and feel like Im understanding how things function a little better. I made a copy of your code and tried to mess around with it a bit. I tried to make it go in reverse, but ended up crashing the processor :( But gotta learn one way or another. I will get the hang of it though, in the meantime reading through what you have done has been immensly helpful. Im gonna mess around with the servo stuf you just posted and see what happens. Hopefull I dont explode :D


Novice ( offline )
Posts: 72
Posted: 2010-03-30 21:10 
alrighty, good news bad news scenario. The good news is I got it to work exactly as you described, the bad news is I blew out the wast servo :oops: But its a 422 and I have a ton of those. So now I would like to try to make it so that the servo only responds while the button is pressed down. I would also like to ease into the command, not sure if that makes sense. Im gonna have to upgrade to better servo for the waist though because the upper body is heavy and has alot of momentum. Otherwise though, it was really cool :D


Novice ( offline )
Posts: 72
Posted: 2010-03-30 23:22 
Ok so I was experimenting and I used the following line to do what I mentioned before in regards to only moving the servo while the button is held down

Code:
Servo1 = (Servo1 - DualShock(1).bit5*25 + DualShock(1).bit7*25)    MAX 2250 MIN 750    'Rotate Waist.


Im pretty happy it worked. I have been anaylizing your code and the ps2a4wd1.bas to get these results.

Im starting to understand defining variables and what not in the beggining of the code. Pretty cool stuff. I would eventually also like to get the triggers to throttle up od down in both forward and reverse but based on button pressure to determine speed. Its exciting stuff :)


User avatar
Veteran ( offline )
Posts: 197
Posted: 2010-03-31 08:48 
Just to make a useless comment, I've been following this thread and I would like to say that I've been learning stuff too since I don't errrrrrr didn't know how to program a robot to go using the PS2 controller. So you're a really good teacher, innerbreed. :)

_________________
Well, I better start declaring my constants and variables.

Constant-things screwing up
variable-when things screw up
variable-what magnitude things will screw up in


Novice ( offline )
Posts: 72
Posted: 2010-03-31 09:16 
That is excellent robo1340, the more people that benefit from this the better. Innerbreed has been immensly helpful and Im hoping this thread helps alot of people program their machines using the ps2 because honestly I couldnt find anything very comprehensive for begginers.


User avatar
Guru ( offline )
Posts: 9257
Posted: 2010-03-31 10:32 
Guess I should make this a sticky then. ;)

_________________
Jim Frye, the Robot Guy
http://www.lynxmotion.com
I've always tried to do my best...


User avatar
Guru ( offline )
Posts: 3299
Posted: 2010-03-31 12:45 
Vsions wrote:
alrighty, good news bad news scenario. The good news is I got it to work exactly as you described, the bad news is I blew out the wast servo :oops: But its a 422 and I have a ton of those. So now I would like to try to make it so that the servo only responds while the button is pressed down. I would also like to ease into the command, not sure if that makes sense. Im gonna have to upgrade to better servo for the waist though because the upper body is heavy and has alot of momentum. Otherwise though, it was really cool :D


Oops, its good to see you making progress.
yes the 422's just wouldn't do for this. :roll:
i would say you might get a better chance at replacing it with 2x HS645MG servos together with the ASB13.

in the same way we do for the robotic arms.


Vsions wrote:
Ok so I was experimenting and I used the following line to do what I mentioned before in regards to only moving the servo while the button is held down

Code:
Servo1 = (Servo1 - DualShock(1).bit5*25 + DualShock(1).bit7*25)    MAX 2250 MIN 750    'Rotate Waist.


Im pretty happy it worked. I have been anaylizing your code and the ps2a4wd1.bas to get these results.

Im starting to understand defining variables and what not in the beggining of the code. Pretty cool stuff. I would eventually also like to get the triggers to throttle up od down in both forward and reverse but based on button pressure to determine speed. Its exciting stuff :)


good work. you look as though you might be getting the hang of this. we can work on expanding this code more the further we get on.

robo1340 wrote:
Just to make a useless comment, I've been following this thread and I would like to say that I've been learning stuff too since I don't errrrrrr didn't know how to program a robot to go using the PS2 controller. So you're a really good teacher, innerbreed. :)

Vsions wrote:
That is excellent robo1340, the more people that benefit from this the better. Innerbreed has been immensly helpful and Im hoping this thread helps alot of people program their machines using the ps2 because honestly I couldnt find anything very comprehensive for begginers.


thanks for your kind words, im always happy to help, but i must say all the experience i have comes from here at Lynxmotion. everyone here has helped me so my knowledge is only the knowledge of others. there are some brilliant people here, who know far far more than i do. like i say just happy to help. :wink:

Robot Dude wrote:
Guess I should make this a sticky then. ;)

this would be a nice idea jim, you could setup a Beginners section?

_________________
Jonny Poole,
Freelance Concept Art & Animatronics, 3D Art and 3D Modelling, as well as Physical Modelling, Mechanical design, and illustration.
http://www.innerbreed.co.uk
Create, Innovate, Inspire.


1, 2, 3, 4, 5

All times are UTC - 5 hours [ DST ]. It is currently 2014-10-24 05:29
Feedback Form
Feedback Form