Autodesk Within

Independent-Study-book

KUKA w/ HAL for Grasshopper

submission

These are the scripts I have been working on for the KUKA using Rhinoceros and HAL. Included are the 3D print and milling script.

Seth Davis – Independent Study

INDSTUDY

Robot Control with HAL/Grasshopper : General Logic

HAL Basic Definition

The plugin on a general level follows the following logic for Robotic Programming:

1. Brep -

brep

The geometry you want.  If this is a milling job, it is the finished milled part, for a hot wire cutting job it is the finished cut piece of foam.  Etc…

2. Robot Definition -

robot definition

What robot (selected from presets or custom created) are you using? Where is it mounted? The robot data extractor component in this step feeds information to just about every other part of the definition.

3. Create Surface IsoCurves for Toolpaths -

links

The Plugin will use these iso curves as a base for the robot tool paths.  They will be broken down and rebuilt as toolpaths, but essentially what you have here as curves will be the movement of the robot.

4. Link Iso Curve Segments -

isocurves

Essentially you need one long curve for a basic robot program.  The machine then follows this curve start to finish as you specify in the definition.  Similar to a CNC machine running on basic GCode.  This step takes the many independent surface isocurves and links them together into one curve.  This step is where you could add leads and links depending upon how you wanted the tool/effector to engage your material or approach the work objects.

5. Create Oriented Targets on Toolpath Curves -

subdivide curvetarget points

This is where the iso curves are broken down into subdivision points.  These points each must have a planar orientation that defines all 3 axes… Each point must have a defined X, Y, and Z axis direction.  The reason for this is because the machine (in this case) is a six axis device, it needs coordinates as well as rotational information (X, Y, Z, A, B, C) to properly position the tool at each point.

The program creates tool paths and simulations essentially through key frame animation.  you specify a series of points, each with orientation data along your intended tool path, and the software interpolates the tool positions between the points.

6. Tooling/Effector Definition -

end effectors

What tool are you using? and what is its geometry?  This is where, you define, in similar fashion to the robot in step 2, the tool that is attached to the robot.  You provide the mesh for the simulation, as well as fixture planes of both the tool’s mounting plate to the sixth axis flange, and the tool fixture plane itself (the tip of the end mill in the case of a spindle, as well as it’s orientation.)  This information tells the software how to move the robot in order to properly position the tool at each specific target point.

7. Toolpath Simulation and Inverse Kinematics Data Export -

simulationsingularity

This is where you are able to simulate through the use of a number slider, the position of the robot and effector (tool) at any position you choose along the defined tool path.  The software has a handy feature to notify you if the toolpath is outside of the robots reach envelope.  Once everything is satisfactory, you can animate the slider to produce animations, as well as export the actual data into an inverse Kinematic Solver that provides a program to the robot itself.

CNC Development… TONS of progress!

So unfortunately I have been a bit behind on keeping up with the process documentation of my CNC project so this post is going to cover quite a lot that I have worked on lately.  Long story short, the machine is very nearly finished.  Only a couple more things to iron out from a software configuration standpoint and I should be running parts in no time.  It is unbelievable to actually see the thing working and running g-code after all the work and time and planning that has gone into making it.  NOTE: A couple of the early images are out of order.

Getting the electronics set up for the first time.  This part was awkward because I wasn't totally sure how the enclosure for the electronics was going to work, or what that would be like.  Note the nearly completed wiring harness.... all the wiring was assembled with quick connectors so the harness is a complete unit that can be removed from or re-installed on the machine in a matter of minutes without any disassembly.

Getting the electronics set up for the first time. This part was awkward because I wasn’t totally sure how the enclosure for the electronics was going to work, or what that would be like. Note the nearly completed wiring harness…. all the wiring was assembled with quick connectors so the harness is a complete unit that can be removed from or re-installed on the machine in a matter of minutes without any disassembly.

Lots and lots of soldering to do.  These four motor pigtails took a couple hours by themselves.  It is all the little things like this that you never really foresee or remember when it's all done.  Massive amounts of labor is the moral of the story here.  massive amounts of labor.

Lots and lots of soldering to do. These four motor pigtails took a couple hours by themselves. It is all the little things like this that you never really foresee or remember when it’s all done. Massive amounts of labor is the moral of the story here. massive amounts of labor.

Working in the shop to get the gantry beam screwed together and squared up.  The shop has NOTHING that is square and flush to any level of reliable accuracy, it was very frustrating and even still I am not totally confident my beam is square on it's ends.  It drives me crazy.

Working in the shop to get the gantry beam screwed together and squared up. The shop has NOTHING that is square and flush to any level of reliable accuracy, it was very frustrating and even still I am not totally confident my beam is square on it’s ends. It drives me crazy.

Assembling the Mechanicals.  This is the first time.  I wound up putting it all together and taking it apart several times along the way.  This is one way that the design really shined.  it went together and came apart without much complaint overall.  Having modeled everything I really drew my mind around all the angles and aspects so I had a really good idea of how all this was working by the time it came screwing and bolting time.

Assembling the Mechanicals. This is the first time. I wound up putting it all together and taking it apart several times along the way. This is one way that the design really shined. it went together and came apart without much complaint overall. Having modeled everything I really drew my mind around all the angles and aspects so I had a really good idea of how all this was working by the time it came screwing and bolting time.

I wound up going for a PC chassis that I stripped out and installed my components in.  I fixed the key pieces to a piece of acrylic and then screwed the acrylic into the chassis where the motherboard would have gone.  Worked like a charm.

I wound up going for a PC chassis that I stripped out and installed my components in. I fixed the key pieces to a piece of acrylic and then screwed the acrylic into the chassis where the motherboard would have gone. Worked like a charm.

Everything installed.  The wiring is so clean, this was before I added everything that made it a total mess!

Everything installed. The wiring is so clean, this was before I added everything that made it a total mess!

Connectors, always more connectors.  I can't even count the hours I spent on connectors.

Connectors, always more connectors. I can’t even count the hours I spent on connectors.

Electronics enclosure shaping up, and nearly done.  you can see the closed loop router/spindle speed controller on the front.

Electronics enclosure shaping up, and nearly done. you can see the closed loop router/spindle speed controller on the front.

Router modification to accept the sensor for the closed loop PID controller.  I had one installed but had to troubleshoot a bit.  As it turned out I had messed up the wiring/connectors which was causing the issues.  Connectors...always the connectors.

Router modification to accept the sensor for the closed loop PID controller. I had one installed but had to troubleshoot a bit. As it turned out I had messed up the wiring/connectors which was causing the issues. Connectors…always the connectors.

With the machine and electronics all finished up and together, I had a chance to clean up the workspace which had looked like a hoarder lived there for the last month.  It feels so great to get it all together like this and see it sitting there all pretty on the desk!

With the machine and electronics all finished up and together, I had a chance to clean up the workspace which had looked like a hoarder lived there for the last month. It feels so great to get it all together like this and see it sitting there all pretty on the desk!

The first gcode I ran on my machine!!!  These are the iso curves from my CNC surface milling project from earlier in the summer, I flattened them and threw a pen in my CNC and it drew them out. ... Lots more to work on with dialing in the CAM part of it, but the hardware is working!

The first gcode I ran on my machine!!! These are the iso curves from my CNC surface milling project from earlier in the summer, I flattened them and threw a pen in my CNC and it drew them out. … Lots more to work on with dialing in the CAM part of it, but the hardware is working!

This has been a very quick recap of the assembly process.  As I said I have not been as diligent as I should have been with the process documentation.  At any rate, exciting things coming up.  Next posts should have videos of running programs!

6 axis robot milling program

I finished my first go at putting together a toolpath in HAL.  It is a basic milling finish pass.  In reality to do a job like this, you would need cam software to process all the necessary tool paths and different tooling setups, but this line strategy simulates the same logic.

Robotic Programming Plugins for Grasshopper

From the standpoint of programming robots within Grasshopper, there are two plugins that are widely used.  Kuka PRC, developed by the association for robots in architecture, and HAL 5, which was created by Thibault Schwartz.  Both of these perform similar function however, at different levels of complexity and performance.

Both of these are being used to develop tooling programs within my independent study however, after trying both, I have found I focus much more energy on HAL due to it’s greater performance capabilities.  From an analytical sense it’s like comparing Sketchup to Rhino.  One is faster but much less robust.  At any rate, this is my limited opinion of the two plugins.

Kuka PRC, focusing on only one brand of robot, has a much more streamlined interface which results in a faster and easier programming experience at the cost of the more robust features.

Kuka PRC, focusing on only one brand of robot, has a much more streamlined interface which results in a faster and easier programming experience at the cost of the more robust features.

HAL on a general level requires much more involved scripting and definition however, provides far more robust features for control and programming.

HAL on a general level requires much more involved scripting and definition however, provides far more robust features for control and programming.

Robotics: End effectors.

A principal difference between robotic arms and other methods of digital fabrication is that with most other types of machines such as a CNC router, the effector, or tool is a fixed component of the machines design.  With robotic arms this is not the case.  The robot is build to act as a “blank canvas” to accept many different types of effectors for many different applications.  Often used robotic applications (directed by the type of effector attached to the robot arm) include:

Airbrush Attachment.

Airbrush Attachment.

Robotic painting such as this ensures high quality surface finish with little to no overspray.

Robotic painting such as this ensures high quality surface finish with little to no overspray.

Traditional gripper type effector.

Traditional gripper type effector.

Hot Wire Cutting

Hot Wire Cutting

Material handling (glass).  Robots are developed as a blank canvas and then integrated with effector hardware to form a work cell.  Often the effector that is attached to the manipulator arm is very complex and is a machine of it's own.

Material handling (glass). Robots are developed as a blank canvas and then integrated with effector hardware to form a work cell. Often the effector that is attached to the manipulator arm is very complex and is a machine of it’s own.

MIG Welding

MIG Welding

Spindle attachment for 5/6 axis CNC Milling.  It is important to note that while robotic arms are capable of milling operations, due to their lower rigidity as compared to traditional CNC mills, they do not excel at this type of use.

Spindle attachment for 5/6 axis CNC Milling. It is important to note that while robotic arms are capable of milling operations, due to their lower rigidity as compared to traditional CNC mills, they do not excel at this type of use.

"basket" type effector used for palletizing bagged products.

“basket” type effector used for palletizing bagged products.

Robotic brick stacking (pick and place operation)

Robotic brick stacking (pick and place operation)

Effector for spot welding.  These are widely used in automotive assembly, precise weld locations can be engineered and replicated accurately and quickly.

Effector for spot welding. These are widely used in automotive assembly, precise weld locations can be engineered and replicated accurately and quickly.

A major overarching theme with robotic applications is repeat-ability.  Complex effectors are developed in order to facilitate efficient repeated tasks for manufacturing.  For this fact there is an “economy of scale” for this type of hardware.

Aluminum Plate Cutting

After a long wait with many postponements, we finally got the 1/4″ aluminum onto the Komo.  These parts are the end plates and brackets that really are the meat and potatoes of the machine design.  The brackets are everything.  It’s always so disconcerting putting so much work and effort into a design and then finally committing material to your efforts.

Getting the first aluminum billet setup on the KOMO.

Getting the first aluminum billet setup on the KOMO.

IMG_6035

The First piece of Material had a distinct cup defect.  This made the surfacing pass a bit uneven, we didn't set the z-depth for this toolpath deep enough.  I really wanted to preserve as much thickness as possible for rigidity sake, I guess in retrospect a few more thousandths of an inch wouldn't have mattered.

The First piece of Material had a distinct cup defect. This made the surfacing pass a bit uneven, we didn’t set the z-depth for this toolpath deep enough. I really wanted to preserve as much thickness as possible for rigidity sake, I guess in retrospect a few more thousandths of an inch wouldn’t have mattered.

IMG_6043

The first billet all cut out, so exciting to see these parts finally.

The first billet all cut out, so exciting to see these parts finally.

The second milling setup surfaced down much better.

The second milling setup surfaced down much better.

IMG_6104

That surface finish... awesome!

That surface finish… awesome!

CNC Substrate/Fixture Bed

The bed design was finalized to use 1/2 size Fixture board pieces.  The substrate board beneath, which fastens to the aluminum extrusions and provides torsional rigidity to the CNC bed, was machined as a single piece and holds the entire enchilada square and flush.

The fixture board pieces are 1/2 of the entire machine size, then smaller halves of those halves.  So on and so forth.  In this way the fixture board is a system of halves.  This provides a range of size options for material fixture.  More importantly, these smaller pieces can be re-created using this machine they mount to.  Later down the road component fixture pieces can be fabricated as needed and positioned with alignment pins.

All these pieces were cut from a single piece of 3/4″ baltic birch plywood.

IMG_6013 IMG_6017 IMG_5981

This mockup shows the dual-layered fixture bed with segmented pieces.

This mockup shows the dual-layered fixture bed with segmented pieces.