View unanswered posts | View active topics It is currently Thu Nov 27, 2014 6:05 pm






Reply to topic  [ 3 posts ] 
Remote arm over bluetooth 
Author Message
Rookie

Joined: Wed Jun 13, 2012 10:54 pm
Posts: 1
Post Remote arm over bluetooth
I want to make a remote control arm that works over bluetooth, but I'm not sure how to go about doing so. I'll start off by describing how I want it to work, and you can point me in the right direction from there. The host hand (the one I physically manipulate) will send a bluetooth signal to the slave hand and the movements of one will match the other. This means that the host is idling/coasting and I physically move the motors. The amount those motors move will be equal to the amount the motors move on the slave/controlled arm. motors needed would be an elbow, rotation of the wrist, and opening/closing hand. Any help would be appreciated, thanks!


Wed Jun 13, 2012 10:59 pm
Profile
Rookie

Joined: Mon Oct 10, 2011 4:46 pm
Posts: 15
Post Re: Remote arm over bluetooth
Here is a topic on a robot car witch is similar and might help


Fri Jun 22, 2012 2:46 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 610
Post Re: Remote arm over bluetooth
Bluetooth is a powerful, flexible tool once you get it to work right; it's the 'getting it to work right' that can be fun sometimes :D

I'm going to link a couple of resources that I've found useful so far in using Bluetooth on the NXT's, they should definitely help get you started.
First, a couple of wiki pages to get you up and running. The first one with the actual Bluetooth setup, the second one is a list of all the Bluetooth functions in RobotC:
http://www.robotc.net/wiki/Setting_up_Bluetooth_for_NXT
http://www.robotc.net/wiki/NXT_Functions_Bluetooth

Next, a very awesome tutorial from NXT community member Laurens from his Robot Square blog:
http://robotsquare.com/2012/03/21/tutor ... bluetooth/

Finally, a rough breakdown of what you'd be looking at code-wise, possibly (there are usually multiple ways to do things, and I encourage forging your own path; you learn more from it that way, and it makes you a better, wiser engineer):

1) Read value from first, 'master' robotic arm's motor (nMotorEncoder)
2) Save value in a variable (int)
3) Send value to 'slave' robot (SendMessage)
4) Receive message on 'slave' robot (message)
5) Rotate 'slave' robot's motor until it reaches the desired value (nMotorEncoder, in a 'while' loop)
6) Repeat process for other motors. (steps 1-5)
7) Loop entire program (a 'while(true)' loop encompassing the whole thing would work)

Some tips:
-You may want to clear all the encoders at the start of the program, and make sure the arms are physically in the same position. That way they have a shared, zeroed start point.
-Think about how you want the robot to work in plain English, and then look for code to execute your task.
-nMotorEncoder and nMotorEncoderTarget are going to be your best friends with this program; however, remember how the motors are orientated, and make sure a positive rotation on one isn't causing a negative rotation on the other (it shouldn't but never assume!).
-On that note, check and double check to make sure the motors are plugged into matching ports; if your wrist on the 'master' is in A, the wrist in the 'slave' should be too (to cut down on the confusion).

***5 minutes of planning can save you 5 hours of frustration; trust me, been there done that :)***

I'm pretty excited for this one and look forward to seeing what you come up with. If you get stumped or need any more help, definitely let us know, we're more than happy to help. Keep us posted!

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Fri Jun 22, 2012 3:12 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.