Robot Arm

Record & Playback 4

I have been building a robot arm. You may have seen it on my Instagram. I also have an open source Java app called Robot Overlord, which can simulate the arm in 3D. Robot overlord can drive the simulation AND the real arm by moving the joystick. All the moves in this video were done with the Playstation controller:

In a previous post on Hackaday.io, I briefly covered a system I wrote into Robot Overlord that would capture all the joystick data and play it back on command. Technically, that worked. Qualified success.

Watch I stream robot related tutorials from imakerobots on www.twitch.tv

However! Driving this way is way inefficient. new instructions are sent to the arm 30 times a second. The arm can’t see where it is going, so it can’t plan to reach high speeds. It’s like a very fast game of Marco Polo. Also if you’re a novice driver like me it’s really easy to go the wrong way. It would be great if I could move the simulated arm to a destination pose BUT only update the real robot when I’m sure I like my destination pose. Then the arm would then move in a straight line from start pose to end pose at top speed.

First I needed a way to save any pose to a file on disk and then bring it back. Then I could save and load single poses. Then I could play those poses back to the real robot, same as I did with the joystick model. Then I could repeat tests, which helps me confirm things work correctly.

If I have a start and an end pose then I can find a way to interpolate between two poses – I can split that line into sub poses if needed. I can already send poses to the robot. So what I can do is find the happy trade off between too many poses (no acceleration) and too few (less accurate movement).

Looking through my daily notes I see I started on the new system some time before 2019-8-13, because that was when the weirdness started: I found cases where recording to disk and coming back were out of sync. Not identically 1:1. Discombobulated. When I tried to play back a recording the hand of the robot (J5) was always turned 90 degrees from the original recording. As I began to dig into why, I opened a whole can of worms. Bigguns.

Worm: The robot sim in Robot Overlord was wrong.

When Jin Han and I built the computer model of the robot arm in Fusion360, the design was started in November 2018 and back then we started facing the wrong direction.

Arm designed pointing at -Z

When I say it was built facing the wrong direction, I mean that I imagined That both Fusion360 and Robot Overlord would have the hand pointing at +X and up was +Z. In fact, in Fusion360 the hand is pointing at -Z and up is +Y, and in Robot Overlord I reassembled the arm with the hand facing -Y and up is +Z. Copying the model over was stupid hard and I didn’t realize that was partly because I was doing it the wrong way, turned 90 degrees on two axies. It would have been easier if it was upside down and backwards!

My method to solve it was to load one joint at a time starting at the base, get it turned facing upwards, and then add another link and so on. Once all the bones were in their relative positions, build D-H parameters that matched.

Worm: The D-H model of the arm was wrong.

The Sixi was the first robot arm I ever coded that used Denavit–Hartenberg parameters. One of the reasons I used D-H parameters is that they’re well documented and supported by other people into robotics. I can easily use D-H to calculate Forward Kinematics (FK), where i know the angle of every joint in the arm and I want to get the pose of the hand. (A pose is a position in space and an orientation. One common way to describe this combo is with a 4×4 matrix). I could also use Youtube videos that explained how to calculate Inverse Kinematics for a robot arm with D-H parameters. Especially tricky is the spherical wrist:

I found the videos on spherical wrists were incomplete and it wasn’t until I stumbled on these notes from York University in Canada that I found the missing piece.

Worm: Inverse Kinematics calculations were wrong.

Of course my code didn’t quite match the stuff I’d been taught because my model was facing -Y instead of +Z – a 90 degree turn. Every time the tutorials said use atan(y,x) I had to write atan(-x,y).

Not knowing that I’d done all this stuff wrong yet, I had to diagnose the problem. I build a jUnit test in src.test.java.com.marginallyclever.robotOverlord.MiscTests.java:TestFK2IK(). This test sweeps the arm through the set of all angles keyframe0. Every instance in keyframe0 creates some possible pose m0. Some m0 can be solved with Inverse Kinematics to make some other keyframe1. keyframe1 can create a pose m1. m1 should ALWAYS match m0. I got lot reams of big data, all of which told me Yes, there’s definitely something wrong. It took about a week of nail-biting research until I figured out and unscrambled each of those worms.

So what does all that mean? It means I can now build meaningful recordings and now I can start to search for the right happy trade off .

News

Dynamics-aware animatronics

From the abstract:

Our goal is to automatically transfer motions created using traditional animation software to robotic characters while avoiding such artifacts. To this end, we develop an optimization-based, dynamics-aware motion retargeting system that adjusts an input motion such that visually salient low-frequency, large amplitude vibrations are suppressed.

https://la.disneyresearch.com/publication/publication-process-vibration-minimizing-motion-retargeting-for-robotic-characters/

Read the original disney research paper at https://la.disneyresearch.com/publication/publication-process-vibration-minimizing-motion-retargeting-for-robotic-characters/.

Robot Arm

Sixi Robot developments 2019-07-16

New OSHPark PCBs arrived

With this we can finally finish the hardware preparation for shipping units, after which we can also get a final bill of materials and start to package DIY kits.  There will be two flavors:

  • DIY kits with all the non-printable parts.
  • DIY kits with everything, including the printed parts.

Collision detection

The software only lets each joint of the robot move within a safe range to prevent wire twisting or other potential damage.  That piece of code does not consider the angle of joint A in relation to the value of some other joint B.  So it was still possible to make the arm hit itself.

This new collision detection code prevents each bone of the arm from colliding with other bones of the arm.  At present it is a crude collision detection system, using only the box around each joint.

Also now that these boxes have been calculated, the center of each box is known.  the mass of each bone can be pulled from the Fusion360 model, and then a point-mass physics model can be created to simulate forces like gravity.  This gets us closer to dynamics like push-to-teach and telling the arm “please push on this item with a force of N newtons”

Next

Next we’ll be assembling the new shoulder design with the PCBs that should allow us to unplug the umbilical from the arm and the control box.  I’m thinking Twitch stream?  Maybe just a Youtube Live, given the recent Amazon protests.  Choice of evil companies… hmm…

Opinion Robot Arm

Robot Arms and the Recycling Problem

Recycling in the US is collapsing and low cost robot arms like Sixi can help prevent disaster. The buyers of recyclables demand pre-sorted material with almost nothing mixed in. The suppliers are finding the cost to sort is astronomical. While much of the sorting is done by machines already, the job could be done even better with tireless robots.

How recycling works

Typically when you drop recyclable material in the blue bin it goes to a facility where it is crushed, packaged in bulk, and sold to a buyer that can repurpose the material. The largest buyer for canadian and american recyclables is China.

Recycling buyers have tightened standards

“As of Jan. 1, 2018, China, which buys approximately two-thirds of North America’s recyclables, requires that contamination levels – newspaper smeared with ketchup, plastics mixed with broken glass – can’t exceed 0.5 per cent as part of its National Sword initiative.” — The Globe and Mail

Humans sorting is too expensive

” A study by Rob Taylor with the State Recycling Program in the North Carolina Department of Environmental Quality estimated that the average market value of a ton of mixed recyclable material arriving at a recovery facility in the state dropped from just over $180 in early 2011 to less than $80 at the end of 2015. That value has since rebounded a bit, Taylor found, to a little over $100, but it still leaves the industry struggling to extract profit from the millions of tons of recyclable material Americans throw away every year. ” — USA Today

New solutions in High Tech

There are still buyers! The cost to prepare the has gone up, which lowers the return on investment for anyone trying to do business with recycling. Any technology that can lower the cost of recycling is a worthwhile purchase for these businesses. Let’s consider a typical recycling scenario and apply some new technology to the challenge. Suppose a pile of mixed recycled material being fed onto a conveyor belt.

The first problem is to identify the material so that it can be sorted. Computer vision and AI has been making major strides in recent years. Have you seen the Tesla’s object identification? Or VACnet, Valve’s anti-cheat system? Pattern recognition is something Deep Learning does really really well – in many cases, better than humans. In the early days it starts by having a Deep Learning system watch humans sort recycling while it learns what goes where. Soon enough, it knows enough that it should be able to spot things humans missed. Best of all, the Deep Learning doesn’t need to be retrained – it’s an employee that works forever and only gains experience.

The second problem is to physically separate the material that has been identified. This is where robot arms come into play. They don’t even have to be fast – if the arms are too slow, throw more arms at the problem!

Why aren’t robots recycling today?

The 2019 price of low end industrial robot arms is north of $10k USD each. Lowering the cost of robot arms will speed adoption. It is a worthwhile goal for a company that looks to the future and cares about the fate of the world.

There is no question that we have to do it. By lowering the cost of robotics we can raise the profitability of recycling and encourage less landfill. Until the world learns to stop making garbage, Marginally Clever Robots hopes to fill the gap and provide the low cost robots to help prolong the human experiment. Our customer base should be 7 billion strong.

News

Weekly summary ending 2019-03-08

Hey, gang! Happy International Women’s day. On my birthday women celebrate around the world. That never gets old. Something something my ego.

Jin is down with seasonal allergies/mild death and we don’t have our amazing interns any more, so this week has been a little rough.

New! ELEC-0134 Sir Ramps-a-lot Dark Knight

We use the sir-ramps-a-lot board so that our Mega/RAMPs combo can easily control external drivers. Some of the drivers we purchased decided to be contentious and are designed with all their signals reversed, so we needed a sir-ramps-a-lot that was ALSO reversed. Anyways, here it is!

https://www.marginallyclever.com/product/dark-knight-ramps-adapter/

Robot Overlord Adds Sixi Robot Arm

The inverse and forward kinematics are both working great, which means you can move it either way and switch between the two as you see fit. Making the IK and FK code work took me three whole days of agony, so there’s not much progress in other areas this week.

Sixi Robot Rendering

This is pretty close to our vision for the robot. We’ve had it assembled and we’ve even got it moving, but I’m not ready to show it to the world just yet. It’s coming together! I would love to show you some action shots we’ve taken… but these PR things have to be handled just right, you know what I mean? Patience is a virtue.

Next

Now the challenge is to program waypoints and paths (all the beziers!) to build higher-level applications for the arm. Meanwhile Jin is stress testing the cycloid gearboxes and coming up with new ways to make them even better-er.

Cool! So subscribe to this blog or our Youtube channel OR our Instagram for all the latest and I will see you next time!