Many people asked me to post a video showing an arm from inverse kinematics article in action. While making a video, I realized that shots of the arm following a pattern of computer-generated coordinates is going to be less than exciting and decided to add manual control. The video below shows the result. In addition to the video, a HID introductory page has been written describing HID communication basics as well as some simple Arduino code. Enjoy! ( Youtube link, where HD quality video can be selected ).
Arduino sketch written for this video is on gitHub.
This is so Awesome. Thank you for posting and give inspiration to all geeks in the world!
God Bless.
i must appreciate ur work. arm design is perfect.use of usb wid arduino peripheral really catches my attention. clapping from my side for this dedicated work.
making an arm with arduino and usb mouse is very complex but u have done it.
thanks for your creativity..
have done the 30 degree up when assembling the arm for elbow as given inn lynxmotion assembly guide ?
that was brilliant work……i am just a beginner can u please send me the schematic along with the components needed to make this arm……please
this project is very intresting..i am just biginner in this field and i need your help,can u please send me the schematic and what components that should have to do this project?
I don’t have schematic, sorry, this is not a beginner’s project.
Hello oleg, great work man, i saw the video, oleg can you please help me out for some alternative of renbotics sheild, would you suggest some other way to drive servo motors if i am not available with all the pwm pins of arduino.
Thanks oleg, waiting for your reply
Hi,
Anything capable of driving 6 servos would work. Renbotics shield is very simple – you can buld one yourself (that’s what I did). Take a look at their site for schematic.
yes oleg you are right but i just noticed in video of this arm that motors aren’t moving smoothly, is that due to renbotics shield or something else?
Thanks for the reply oleg, i want to know if i can get something more with renbotics shield to operate motors in more smoother way, is that possible?
Servos are moving smoothly, the arm is spring-loaded – as a result, arm movement is jerky at times.
okay oleg, i got it, thanx alot for guiding 🙂
oleg one more thing i want to ask, there’s a big capacitor you are using in renbotics servo shield, that is not mentioned in its schematic, which capacitor is that the one in blue color?
Hey oleg!
This is really a Brilliant work and i think its the first do it your self guide on implementing inverse kinematics so easily. I have been looking for such a thing for months now. I am kind of a PIC guy and really new to arduino(thanks to you for making me a big fan of arduino).Can you please guide me how can we control the arm using a keypad and lcd. I mean so that we can enter the coordinates and the arm works according to it. And if its possible please tell me where to change the code for it.
Regards
Omer
oleg one more thing i want to ask, the capacitor you are using in renbotics servoshield, the one in blue color, that is not mentioned in schematics of it, what value of capacitor is that and what are its connection with the shield, thanks for the prevoius replies, they were helpful.
Just some big electrolytic cap, like several thousands microfarad rated at ~1.5 times servo voltage. Don’t sweat it – I put it there because I had it, servos will work just as well without it.
hey oleg,
i wanted to ask one more thing, you have connected the 14th and 15th pin of 4017 ic with 5th adnd 6th pin of arduino, is that so? in schematics of renbotics its connected with pin number 6th and 7th of arduino, is there some change in codde as well for that?
thanks oleg for prevoius help
Pin 7 was used by legacy shield. On current revision you can use Renbotics pinout as-is
you mean to say that current version of renbotics shield does not use pin 7 of arduino?
can you please elaborate me more that pin 14th and 15th of 4017 ic are connected with which pins of arduino for the revised version, i am using usb host shield with that as well.
Thanks oleg
I meant to say that new version of USB Host Shield doesn’t use pin 7. The rest of the conections is by default and I don’t use second 4017.
okay oleg, thanks alot for the help 🙂
sorry oleg i am asking you again and again about small things, actually i am working on it as my final semester projet, and that is why needing your help again and again,
oleg i first implemented the sketch for the communication of mouse with arduino that you’ve given in the respective topis, my mouse is working with the INTERRUPT’s sketch not with the ‘Get report’ one, now what changes would i’ve to made in the overall sketch to implement this project using the ‘INTERRUPT’ sketch, i tried combining the both sketches and made some more editions in that but its still not working with mouse, can you help me a bit more about it,
Thanks oleg you already helped alot
Here -> http://www.circuitsathome.com/communicating-arduino-with-hid-devices-part-1 you can see how polling can be done both ways.
hey oleg, i want to know few things about the code, can you please help me out about the code of this project, how did you decide that how much should the motor upon the change of several coordinates during movement of mouse?
how these -0.1 and and -2 you decided for this, i am confused about this
armdata.x_coord += ( buf[ 1 ] * -0.1 );
armdata.y_coord += ( buf[ 2 ] * -0.1 );
switch( buf[ 0 ] ) { //read buttons
case 0x00: //no buttons pressed
armdata.z_coord += ( buf[ 3 ] * -2 ) ;
break;
case 0x01: //button 1 pressed. Wheel sets gripper angle
armdata.gripper_servo += ( buf[ 3 ] * -20 );
/* check gripper boundaries */
-0.1 and -2 is the scale. X and Y are about 600 dpi, so I divide it by 10 and also invert direction. X is coarse, like 6 clicks per revolution, so I multiply it by 2 and also invert direction.
waiting for your reply…thanks
Asif:
Im working in a proyect like you. Can you help me with some doubt? my mail is sacalleja@miuandes.cl.
regards
please post your questions here, if possible
ok no problem! a teacher from my university saw you project and ask me do this. Is my last course of the career. i don´t have any idea how to start a code to control the arm by mouse. i never have worked whit this before and i dont know much about robotics. what should be my first step?
Thanks oyu
if you need to write this code from scratch I suggest learning about inverse kinematics – there are links in the article as well as plenty of info elsewhere on the net.
Hello Mr Oleg.
I think ,you are a hard man.
It’s difficult to received from your help.
Can you help me get coordinate X,Y by arduino mega adk with usb mouse such as : http://www.martijnthe.nl/2009/07/interfacing-an-optical-mouse-sensor-to-your-arduino/
Because i don’t want to cut wire of usb optical mouse.
Please ,help me Mr Oleg.
Hello ,Mr Oleg.
I want to buy code of usb mouse.
Can you give me price and account to send money?
Thanks
The code is free, you don’t have to pay me anything to use it.
Oh ,don’t have this code,i want to buy code ,get coordinate X,Y by usb mouse connect with arduino mega adk,such as :
http://www.martijnthe.nl/2009/07/interfacing-an-optical-mouse-sensor-to-your-arduino/
Thanks.
The code which returns USB mouse coordinates is available here -> https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/HID/USBHIDBootMouse/USBHIDBootMouse.pde , and sample output can be seen here -> http://www.circuitsathome.com/mcu/hid-support-for-usb-host-shield-library-2-0-released .
Oh,thankyou Mr Oleg.
i will test and report for you.
It’s error Max3421e.cpp
I just downloaded Max3421.cpp to Arduino 0022 library but it don’t accept:
f:\arduino\arduino-0022\arduino-0022\libraries\felis_USB_Host_Shield\Max3421e.cpp:35: error: ‘byte’ does not name a type
f:\arduino\arduino-0022\arduino-0022\libraries\felis_USB_Host_Shield\Max3421e.cpp:91: error: ‘MAX3421E’ has not been declared
f:\arduino\arduino-0022\arduino-0022\libraries\felis_USB_Host_Shield\Max3421e.cpp:91: error: variable or field ‘setRST’ declared void
Mr Oleg: Im looking to buy a USB Host Shield. I saw the USB host shield from Sparkfun, Do you think is it an appropriate USB Host Shield, for this project? What USB shield did you use?
Regards
Sparkfun shield won’t work with my code, you need this -> http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino/
Mr Oleg: The products can be send to Chile? maybe via fedex?
Regards
The USB Host shield is available at the store -> http://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino/ . Various international shipping options are available.
Hello Mr Oleg .
It’s error Max3421.cpp.
I download it from wesite and add to arduino library ,but don’t accept.
Can you give me Max3421.cpp
Thanks
For this example, you’d need to use old version of the library. You can get it here -> https://github.com/felis/USB_Host_Shield (copy all files, not just Max3421e.cpp)
I just downloaded and test again.But result still error:
I copy code and paste to arduino 0022:
http://www.uphinh.vn/image/view/462155.jpg
Result is error :
http://www.uphinh.vn/image/view/462156.jpg
please help me ,thanks Mr Oleg.
you need to install library to Arduino tree – refer to arduino.cc site for instructions.
Oh,i copied to arduino library:
http://www.uphinh.vn/image/view/462980.jpg
But result still error:
http://www.uphinh.vn/image/view/462156.jpg
Help me!
Thanks ,Mr Oleg
Can you continue help me.
Thanks.
Can you give me the price and your account to send money about usb mouse coordinate with arduino mega Adk ?
Mr Oleg can not repair it ,whoever can help me.
Thanks a lot.
Mr Oleg just died,hic hic…
Hello Mr Oleg
I uploaded UsbHdiBootMouse.pde to Arduino mega ADK successfully.
But result is OSC did not start.
https://picasaweb.google.com/lh/photo/7I47IKurycWwhhu0sJtloqSrQy2kQI_kUU0h-UhI77Y?full-exif=true
Can you tell me about the name of mouse in your video clip.
Thanks a lot.
Arduino Mega ADK is not supported in my library.
Oh,yeah .
Can you give me name of board on video clip ” Controlling robotic arm with Arduino and USB mouse ”
Can you write for me libray of Arduino mega ADK .I will send cost for you by PayPal.
Thanks a lot.
Can you tell me :
“OSC did not start”
What’s error?
Thanks
It means PLL is unable to lock, which, in turn, means that oscillator is not oscillating.
Why don’t you corect it?
I just tested with mouse Mitsumi,Microsoft,Logitech.
All resutls are “OSC did not start”.
I think , your library is problem exactly.
This error doesn’t have anything to do with the mouse. Which board are you using?
Hey,i don’t agree with your reason.Because i connect Aduino mega Adk with Android phone by Usb host successsfully.
Your library is problem again.
Hey this is a fantastic way to control a robot, I was wondering if you could give me any information on how you programmed this. I will be competing in a high school robotics competition, and would greatly appreciate any info you could provide on how exactly you programed your arduino, and how you wired the shield to your mouse/arm.
Thank you very much
Oleg : when i compile arm_mouse.pde i have an error “ServoShield” does not a name type. can u help me?
Do you have Renbotics library installed?
Okay i’ve install, but now when i compile again i have this error: ‘ch9.h:103:error: ‘byte’ does not name a type. and y have the same error for many lines of ch9.h
Regards
???
Mr Oleg: when i compile i have this error: ‘ch9.h:103:error: ‘byte’ does not name a type. and i have the same error for many lines of ch9.h
this code has been developed quite some time ago; it’s possible that ‘byte’ is not supported in recent versions of Arduino IDE. Define
byte
asuint8_t
and try again.Mr Oleg: Can I use Renbotics library without using side Shield? How can i define the pins of Arduino Uno to use this library?
Regards
If you want to use Renbotics library, you will need the shield.
I don’t know, what’s product board of Mr Oleg ?
This is awesome!
However, I am having trouble implementing this because of the new USB Host library. What could I do to make this work with the new code? I have not had too much success myself, so any help would be great.
You need to use old library for this.
this is an awesome project
i have a aurdino duemilanove board . i am planning to implement this for my final year electronic project.
can u pls help
what are the other hardware required other than serv0 motors and usb mouse?
and aurdino codes?
any help would be great
Hi,Oleg!
Mouse poll error :5
600
What about this error?
What is means 5?
thank
Some mice won’t accept Set Idle request and return STALL. It shouldn’t affect anything.
ok,
I understood,read you communicating-arduino-with-hid-devices-part-1/
thank
Hi Oleg!
One more question
line 183 in you code
float grip_angle_r = radians( grip_angle_d )
Where calculate grip_angle_d?
it’s a parameter. Just look where
set_arm()
is called.Hi Oleg!
One question about inv.kinimatics.Maybe it’ stupid question and you do’t wont to answer.
My ARM have a two SHL_SERVO , one like in you ARM and second SHL1_SERVO on pin 7 of servo shield. For control i use calculations like this:
line 205/ float shl_angle_d = degrees( shl_angle_r );
float shl_angle_d1 = 180.0 – shl_angle_d; //second servo
because my servo inversely locate in construction of arm
line 215/ float shl_servopulse = 1500.0 + (( shl_angle_d – 90.0 ) * 6.6 );
float shl_servopulse1 = 1500.0 + (( shl_angle_d1 – 90.0 ) * 6.6 );
…………..
servos.setposition( SHL_SERVO, ftl( shl_servopulse ));
servos.setposition( ELB_SERVO, ftl( elb_servopulse ));
servos.setposition( SHL1_SERVO, ftl( shl1_servopulse ));
and SHL1_SERVO do’t move. For function servos.setposition( SHL1_SERVO, 2100 ) ok, servo move.
maybe i do’t undestand something or other?
thank
Hi Oleg!
What kind of IDE version you for this sketch?
Is it possible run this sketch in IDE 1.0? or i have
problem this lib?
This code is pretty old. You’ll need legacy library plus pre-1.0 Arduino IDE.
Oleg excuse me one more question/
in line 137 of this sketch
case 0x00: //no buttons pressed
armdata.z_coord += ( buf[ 3 ] * -2 ) ;
break;
and for all buttons pressed you use buf[ 3 ], is it correctly? In ‘communicating-arduino-with-hid-devices’ you use another way:
line 75 -76
if( buf[ 0 ] & 0x01 ) {
Serial.print(“Button1 pressed “);
and line 89 -90
Serial.print(“Wheel: “);
Serial.println( buf[ 3 ], DEC);
separate ‘buf’ for Wheel and Buttons?
OK, thank you. Because i have some problem this targeting of arm. I useing IDE 1.0, this modified old lab, but something not connect.
Oleg excuse me.
Mouse Poll error:3
What is means 5?
thank
i mean 3, sorry
Oleg HI!
I think, i finde error in my arm.
One question, I use different datasheet (cd4017be Clock Frequency 11MHz) for servo shield – is it no problem?
Are you modified servo shield?
Are you modified servo shield lib?
Oleg, sorry but i iteratively ask my question.
I use different datasheet (cd4017be Clock Frequency 11MHz) for servo shield – is it no problem?
Are you modified servo shield lib?
I haven’t modified servo shield lib.
Oleg, thank you very much. Sorry for trouble.
Oleg, in Renbotics shield 7 pin of Arduino use for counter reset. In you modif. 5 pin is reset –
this is write somewere in code, or you do something
other? Thank for answer.
hi. good job i want to list of materials this project. Can you send me?
I don’t have it, sorry. You can make this list yourself – main components are listed in the article and the rest is not critical.
1- Lynxmotion AL5D robotic arm
2- USB Host Shield (HID r.2.0 released)
3- Aurdion Duemilanove
4- Mouse
5- Renbotics Servo Shield
Do you have these other materials?
Start
Setup packet error: DError configuring mouse. Return code : D
HOW to repair it?
Mouse Poll Error: 3
600
Mouse Poll Error: 3
600
Mouse Poll Error: 3
600
Mouse Poll Error: 3
600
Mouse Poll Error: 3
…..the code have a problem……
I want to use BotBoarduino, but usb host shield didnt run. Normally Arduino uno r3 run. BotBoarduino may be necerray for set jumper. Have you know a information.?
hey oleg were can i find the detailed report of this project…..detailed report such as mechanical design,torque for motors and dimensions …i m doing this for my final year project plz send the link if possible
Lynxmotion makes the arm, check their site for the docs. The une I used is AL-5D.
i am a beginner , it would be great help if i get a circuit diagram of this robotic arm . thank you
Hey oleg,
Where can i get the header files servoshield.h usb.h
Servoshield.h should be available from Renbotics site, usb.h is part of legacy usb host library -> https://github.com/felis/USB_Host_Shield