Robot Arm

Sixi Robot Arm update

I’m finally making progress on a new model.  Starting from the hand and testing as I go. 

I made a vault-like lock for a jewelry box and in it I used brass tubes as spacers and bushings.  It was so good I had to try and use bushings in my next design.  They’re suddenly everywhere!  Also all my parts that fit over a bushing have an extra large hole and a separately printed shaft collar.  That way the time to fix a part is low because only the collar needs reprinting.

It’s novemeber 12 today and I should (fingers crossed) have sensors reading the angles of the two axies by the end of the day.  Shortly after that I’ll be bending belts around a 90 degree angle (which I’ve never seen any DIYer do before in-person).

The tail end of this robot is going to need 4 gearboxes to get enough power so I’ve been bugging @Paul Gould about his excellent work, and I hope to print a few of his designs.  The lifting power of the elbow and the shoulder will probably be linear actuators.

Right!  That’s enough of that for now.

Robot Arm

Can Machine Learning Improve Robot Kinematics?

I’ve tried several times to hand-code inverse kinematics for robot industrial arms in Robot Overlord.  To make a long story short, there are a lot of complicated edge cases that break my brain.  Many modern methods involve a lot of guess work in the path planning.  I know that a well trained Machine Learning agent could do the job much better, but to date there are none I can download and install in my robot.  So I’m going to try and do it myself.  Join me!

The problem I’m trying to solve with Machine Learning

I have a 3D model of my arm in the Java app called Robot Overlord.  The 3D model is fully posable.  At any given pose I can calculate the angle of every joint and the exact location and orientation of the finger tip.  I have Forward Kinematics (FK) which is a tool to translate joint angles into finger tip.  I have Inverse Kinematics (IK) which is a tool to translate the reverse.

A robot arm is programmed with a series of poses.  Go to pose A, close the gripper, Go to pose B, insert the part, Go to pose C, etc… The robot software has to calculate the movement of the arm between poses and then adjust every motor simultaneously to drive the finger tip along the path between the two poses.  I’ve already solved the firmware part to drive six motors given sets of joint angles.

The problem is that one IK solution there might be many combinations of joint angles – sometimes infinite solutions.  To illustrate this, hold a finger on the table and move your elbow.  Your finger tip didn’t move and you had lots of possible wrist/shoulder changes.  As the arm moves through space it can cross a singularity – one of the spots with infinite solutions – and when it comes out the other side the hand-written solution flips the some or all of the arm 180 degrees around.  A smarter system would have recognized the problem and (for instance) kept the elbow to the side.  I have tried to write better IK code but have not had any success.

My Machine Learning Plan of Attack

My plan is to use a Deep Learning Neural Network.  The DNN is a bit of a black box: on one side there is a layer of Inputs, on the other there is a layer of Outputs, and in between there are one or more hidden layers.  Inputs filter through the layers and come out as Outputs.  The magic is in the filtration process!  The filter can be trained with gradient descent using a cost function – if I can score every input/output combination I can let the DNN play with the virtual arm while the cost function watches and says “good, bad, better, worse” until the two work out all the best possible movements.

My Machine Learning Network design

I believe my inputs should be:

  • Arm starting pose: 6 random angle values.  Because DNN inputs are values in the range 0…1 I’ll say 0 is 0 degrees and 1 is 360 degrees.
  • Arm ending pose: 3 random position values and 3 random angle values.  Position values are scaled over the total movement range of the robot.  So if the robot can move on the X axis from -50 to +50, (x/100+0.5) would give a value 0…1.
  • Interpolation between both poses: 1 decimal number.  0 means at the start pose and 1 means at the end pose.

I want my outputs to be:

  • Arm joint angles: 6 angle values.
  • confidence flag: 1 number.  0 means “I definitely can’t reach that pose” and 1 means “I can reach that pose”.

The cost function should work in two steps:

  1. make sure there is no error in the joint value – that is to say, the finger is actually on the path where it should be, and
  2. seek to reduce joint acceleration.  Adjust the elbow and the wrist ahead of time to avoid the need to suddenly twist.

I’m going to try first with two hidden layers, then experiment from there.  I intuitively guess it will take at least two layers because there are two parts to the cost function.

My Machine Learning code setup

Robot Overlord source code is already written in Java so I’ve added TensorFlow and DL4J.  Currently I’m still walking through the MNIST quickstart tutorials and asking the DL4J chat room for help.  They already solved a few head scratching differences between the DL4J quickstart tutorials and the DL4J up-to-date examples.  You can find my first test in Robot Overlord’s code at /src/main/java/com/marginallyclever/robotOverlord/DL4JTest.java

Next

I hope that I’ve described my challenge thoroughly.  Please feel free to look at the code and make pull requests, or comment below or in the forums with any tips and advice you might have.  If you’re feeling helpful but not sure how, please share this far and wide so that I can reach the people who have the DNN know-how.

Stay awesome!

Opinion Robot Arm

Why Would I Need Robot Arms?

Robot arms can decouple (separate) the arm doing the work from the mind thinking about the work.  Here are a few ideas of how you can benefit.

Robot arms decoupling for Health and Safety

Robots can work where humans cannot, and this is a great health benefit.  They don’t need to breathe, drink, or worry about low levels of radiation.

Perhaps the most common industrial uses are grinding, welding, and cutting robots.  Humans can’t be hurt if they are nowhere near the danger.  How do you avoid shark attacks?  Stay out of the water!  Glues, acids, paints, and other dangerous chemicals also come to mind.  Weak human flesh is weak!  OSHA probably love robot arms.

Consider: what if affordable robot arms could be put into hospitals?  Imagine a west african country dealing with an Ebola outbreak.  Today in 2018 the doctors have to wear full body protection and clean themselves very carefully at the risk of infection.  It’s a sealed, full body plastic suit, in the African summer, while trying to care for patients!  Heat stroke is a real problem.  Boots full of sweat is just gross.  If the doctors could work remotely they would be both safer and more comfortable.

Robot arms decoupling for Time

A robot arm is always ready to work, while the human operator is not.  But suppose the humans work in shifts?  Now the arm is running around the clock, and employing people on both sides of the globe at the same time.

Of course there is the far more traditional time decoupling where a robot arm is given a highly repeatable and very boring job.  This saves the expensive time of the human trainer.  It also makes sure that the entire job is done with the patience, consistency, and precision needed.  No falling asleep and missing one item in the middle of a million.

Robot arms decoupling for Security

For some, a robot arm brings peace of mind.

Suppose your business has a lot of very valuable, very portable stock.  Diamonds, marijuana, whatever.  As the business owner your big concern is making sure employees don’t take your stuff home.  What if they could work from home and never know where the job is being done?  They can’t directly touch the merchandise.  They don’t know the location of the merchandise!  It’s very hard to commit a crime without means and opportunity.

Robot arms decoupling for Extreme Distance

Working remotely can be taken to any extreme.  There are robot arms on Mars rovers Curiosity and Opportunity.  One day soon Marginally Clever robots will be assembling structures on the moon and humans will be doing the thinking for those arms from here on earth.

Final Thoughts

Have you got other reasons to use robot arms?  Personal examples?  Picture to illustrate these examples?  Share below or in the forums.

News Robot Arm

Robot Arm Study 5 in Robot Overlord, Tool mounting design

I’ve got Study 5 working in Robot Overlord.  The STL files are heavy in detail so the load time is long, but it works.  Forward and Inverse kinematics as good as any other arm in the system (which already includes the 7bot, MANTIS, and others).  I still don’t have enough time to rip apart the inner workings and rebuild it with a record & play back mechanism.  That would be very nice…

Also here is the hole pattern if you want to design a tool that fits on the wrist of the robot.  I would love to see someone design an Automatic Tool Changer (ATC) so the robot could put down one tool, pick up another, and use any tool it is currently holding.