Lynxmotion Tech Support

www.lynxmotion.com
Join the Accelerator Program
It is currently Mon Apr 21, 2014 5:36 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 62 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Wed Mar 31, 2010 9:50 pm 
Offline
Roboteer

Joined: Tue Apr 10, 2007 5:35 pm
Posts: 73
Yeah I definitely think I need to go with those 645 mg servos. Cool idea to sticky this thread, I think it could help alot of people I plan on posting videos and more pics soon to demonstrate our results.

On another note, Innerbreed, do you or any one know how I could make the joysticks on the controller send out signals to servos. ultimately I would like to make the servo resposition itslef based on the position of the joystick. Any ideas?


Top
 Profile  
 
PostPosted: Thu Apr 01, 2010 1:12 am 
Offline
Roboteer

Joined: Tue Apr 10, 2007 5:35 pm
Posts: 73
So I managed to control one of my servos using the right joystick with this piece of Phoenix code

Code:
Servo3   = (Dualshock(5) - 128)/2   


Now I would like it to behave interactively so the servos position is determined by the position of the joystick. I will keep experimenting and studying to see if I can achieve it, if you have any ideas how to achieve that innerbreed, I would love to hear them.

Thanks
D


Top
 Profile  
 
PostPosted: Thu Apr 01, 2010 5:01 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 9:59 am
Posts: 3298
Location: Online @ innerbreed.co.uk
try something like this.
you ready... Gulp!!

add this to the start with the other variables
Code:
servo1 var word



also add this to the constants. you can edit the min/max number of º it can move here. iv used 20º to be safe.
Code:
servo1_MAX con 20
servo1_MIN con -20


Add this to the Variables too.
Code:
servo1Angle   var sword   ;Actual Angle of servo1
 


ok just before [main] add this. this will return the servo to center when you let go of the stick.
Code:
serout SSC_OUT, SSC_BAUD,[servo1\(servo1Angle + 0)\0]


then add this in [main] next to the GOSUB ServoUpdate sub.
Code:
  GOSUB CheckAngles



Then add this part to your Controller section. its for X-axis Right stick horizontal movement.
Code:
       IF (ABS(DualShock(3)-128) > DeadBand) THEN ;X-axis Right stick horz
          servo1Angle = servo1Angle + ((Dualshock(3) - 128)*4)
          IF servo1Angle > 1200 THEN
             servo1Angle = 1200
          ELSEIF servo1Angle < -1200
             servo1Angle = -1200
          ENDIF
          ;serout s_out,i14400,[sdec servo1Angle, 13]
          serout SSC_OUT, SSC_BAUD,[servo1\(servo1Angle + 0)\0]   
       ENDIF



Also, add this part to the very bottom of the code.
Code:
CheckAngles:
  servo1Angle = (servo1Angle min servo1_MIN) max servo1_MAX
return


Also remember to update your servo driver with servo1,
here i have used pin 13. you can change this to what ever pin you have it connected to. also you can change the name of the servo.
Code:
ServoUpdate:
serout SSC_OUT, SSC_BAUD,["#15P", DEC ldrive, "#14P", DEC ldrive, "#13P", DEC servo1, 13]

return


a nice quick way to change the name of a word though out the whole code is to press
Ctrl+H
type in the word you wish to change and also the new word. then click on "Whole file"
click ok.
then it should scramble thought the code and change that selected word.

good luck.
most of the code i have added here will also be used for the rest of the code when we add it so dont just think this is all just to get one servo working this way. :wink:

it might be a good idea to just connect up a single servo thats not built into your robot when testing this... well any code i post really. lol.

_________________
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.


Top
 Profile  
 
PostPosted: Thu Apr 01, 2010 5:49 pm 
Offline
Roboteer

Joined: Tue Apr 10, 2007 5:35 pm
Posts: 73
Nice, I will be trying it tonight. I finally got some more parts I needed and Im waiting now for the airsoft gun and some braided cable sheaths to clean up and protect the cables. I will be posting more closeup images in the next day or two and probably a video or something if I get some cool functionality going.


Top
 Profile  
 
PostPosted: Thu Apr 01, 2010 6:20 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 9:59 am
Posts: 3298
Location: Online @ innerbreed.co.uk
Vsions wrote:
Nice, I will be trying it tonight. I finally got some more parts I needed and Im waiting now for the airsoft gun and some braided cable sheaths to clean up and protect the cables. I will be posting more closeup images in the next day or two and probably a video or something if I get some cool functionality going.


this would be great and very helpful. :wink:
let me know how you get on.

_________________
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.


Top
 Profile  
 
PostPosted: Fri Apr 02, 2010 9:33 am 
Offline
Roboteer

Joined: Tue Apr 10, 2007 5:35 pm
Posts: 73
Update on my progress:
Didnt get to do any coding last night. I got some parts to completete my mech, but didnt get to finish that either. I did however finish the gripper claw assembly and it is now fully functional with the servo. Hopefully tonight I will have the SCC32 mounted onto the bot and can start having everything more neat. Then Im gonna try some more coding. I will be posting pics tonight or tommorow.


Top
 Profile  
 
PostPosted: Fri Apr 02, 2010 9:39 am 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 9:59 am
Posts: 3298
Location: Online @ innerbreed.co.uk
this will be great. then we can start getting the code together. looking forward to seeing the gripper. 8)

_________________
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.


Top
 Profile  
 
PostPosted: Mon Apr 05, 2010 6:52 am 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 9:59 am
Posts: 3298
Location: Online @ innerbreed.co.uk
any progress? :|
one small error with:
Code:
 serout SSC_OUT, SSC_BAUD,[servo1\(servo1Angle + 0)\0]


ill update the code and post it here once done.

_________________
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.


Top
 Profile  
 
PostPosted: Mon Apr 05, 2010 7:20 am 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 9:59 am
Posts: 3298
Location: Online @ innerbreed.co.uk
innerbreed wrote:
any progress? :|
one small error with:
Code:
 serout SSC_OUT, SSC_BAUD,[servo1\(servo1Angle + 0)\0]


ill update the code and post it here once done.


i hope i have fixed the problem. also i am hoping that now when pressing L2 and R2 it will bring the forward speed down as well as "Reverse" :wink:

let me know how it works out.


Attachments:
ps2_ssc_test3.bas [8.33 KiB]
Downloaded 57 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.
Top
 Profile  
 
PostPosted: Mon Apr 05, 2010 9:18 am 
Offline
Roboteer

Joined: Tue Apr 10, 2007 5:35 pm
Posts: 73
Hi Innerbreed, Unfortunately this weekend was crazy for me due to Easter. I did however get to clean up and modify some aspects of my robot. I think I still want to optimize some parts of the arm though. But tonight when I get home Im definitiely gonna be applying your suggestions to the code and seeing how it works. I wanted to purchase some more parts to modify the machine even more, but the funding I requested was denied (Wife shut me down till the summer) so I had budget cuts to the robotics department :) I need a stimulus package there. So for now Im going to be focusing on the programming aspect for a while because I have everything I need to get it fully functional although not to the specs I had in mind. So long story short, tonight definitely programing


Top
 Profile  
 
PostPosted: Mon Apr 05, 2010 9:46 am 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 9:59 am
Posts: 3298
Location: Online @ innerbreed.co.uk
Vsions wrote:
Hi Innerbreed, Unfortunately this weekend was crazy for me due to Easter. I did however get to clean up and modify some aspects of my robot. I think I still want to optimize some parts of the arm though. But tonight when I get home Im definitiely gonna be applying your suggestions to the code and seeing how it works. I wanted to purchase some more parts to modify the machine even more, but the funding I requested was denied (Wife shut me down till the summer) so I had budget cuts to the robotics department :) I need a stimulus package there. So for now Im going to be focusing on the programming aspect for a while because I have everything I need to get it fully functional although not to the specs I had in mind. So long story short, tonight definitely programing



LOL, im with you on the "funding". i brought my wife a laptop and signed her up to clothing catalogs so that keeps her happy. :wink:
anyway..
the code i last posted has had the previous parts added (up to date) and should work as explained. dont quote me on that, i would need feedback on that to alter it if there is a problem.

_________________
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.


Top
 Profile  
 
PostPosted: Tue Apr 06, 2010 12:24 am 
Offline
Roboteer

Joined: Tue Apr 10, 2007 5:35 pm
Posts: 73
Alright, I tried what you posted and Im not getting any response from the servo. Then I tried incorporating it into the code that I was using to drive the other servos. The other servos do work but the latest additions are non responsive. I did not get to test the actual drive system since I temporarily unmounted the electronis from the robot and detached it from the motor controller so I can program it more easily. I did however reattach all the servos on the proper pins. Attached is what I cobbled together.

Any thoughts? I tired to go through it to see if I could see anything wrong with it but I could not see anything that was off, But I know very little so check it out let me know what you think.


Attachments:
ps2_ssc_testdennis3.bas [8.81 KiB]
Downloaded 52 times
Top
 Profile  
 
PostPosted: Wed Apr 07, 2010 3:47 pm 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 9:59 am
Posts: 3298
Location: Online @ innerbreed.co.uk
i did notice that
Servo3 var word
was commented out.
try un-commenting... does it work now. if not then i will look closer at the commands i added.

_________________
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.


Top
 Profile  
 
PostPosted: Thu Apr 08, 2010 1:46 am 
Offline
Roboteer

Joined: Tue Apr 10, 2007 5:35 pm
Posts: 73
I uncommented that but still didnt get any response. I did however change something in the code that got the servo to respond in each direction but not in realtime . It only goes completely to one direction or another and does not return to center when I let go of the stick. I have attached what I have changed. Let me know what you think, Thanks!


Attachments:
ps2_ssc_testdennis4.bas [9.35 KiB]
Downloaded 55 times
Top
 Profile  
 
PostPosted: Thu Apr 08, 2010 4:24 am 
Offline
Robot Guru
User avatar

Joined: Wed Feb 27, 2008 9:59 am
Posts: 3298
Location: Online @ innerbreed.co.uk
ok its progress. i will run some more ideas this evening and try and give you what is needed. :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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 62 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
© 2014 RobotShop Distribution inc. All rights reserved.
Powered by phpBB® Forum Software © phpBB Group