Grasshopper

algorithmic modeling for Rhino

Trigonometry and Tangential Knife Control Angle

I am trying to figure out a system to derive the angle for use with a cnc tangential knife through GH as the knife follows a curve.

Dividing the curve into many points is a start, then finding the Angle  of rotation from Point to Point is the Goal.

Google has led me to a formula that seems appropriate, but I am unsure as to the best way to implement it in GH.

Here is where I am having problems....

Thanks for any input!

Views: 9363

Attachments:

Replies to This Discussion

I did a little searching and found a tangential knife machine online. 

I actually have a cnc router that I built myself.  I use Mach3, MadCam, a SmoothStepper pulse generator and Gecko drives.  A knife would be an interesting tool to have at times.  Post some pictures when you get it set up. 

 

The If statement evaluates a condition and returns the first comma delimited value if true and the second comma delimited value if false.

 

Chris

Taz, thanks for the confirmation on the If Statement Logic... I should have looked in the Expression editor... it is right there.

Chris,

Thanks again for the help through the problem. That is cool that you use Mach3 as well.

I have been tinkering with getting Mach3 to communicate with GH by using the little used Serial Out feature within Mach.  Early tests look promising by using Andy Payne's and Jason Johnson's Firefly... generic serial read component. 

I think there could be some useful things with communication between the programs... mostly approaching a parasitic type relationship with GH eavesdropping on what is happening within Mach.

From what I have learned, most of Mach's serial communication is setup as output only (conventional use is of course for  Digital Read Outs)

This could be an interesting way to to record and display what is happening with the cnc from a different system in near real-time intervals.

I am thinking this could be another (though maybe clumsy and unnecessary) way of controlling a tangential knife or extruder. Much faster and more reliable to figure out the g-code in advance and let Mach3 do all the actual control.... however for playing around or prototyping in this scenario... Firefly could be very cool.

There could also be something said for recording the geometries that the CNC travels... like a digitizing probe does. Mach3 already has lots of plug-ins for this type of thing, but it would be nice to have that information come right into GH.

Well I am rambling on now... Thanks for the help. It sounds like others appreciated it too.

 

and here are some links to various machines.

This first one is looks like some crazy good ol' boys doing cool stuff with a tangential waterjet... watch through to see them take the astroturf pieces out.

http://www.youtube.com/watch?v=BLqKxPOWLwg&feature=related

 

Here is a link another forum that discusses the setup of the "tangential knife feature" within Mach3

http://www.rockcliffmachine.com/forum/showthread.php?t=446

 

http://www.youtube.com/watch?v=aY3h352Lhn4

http://www.youtube.com/watch?v=8nYQaLgvvKI

http://www.comagrav.com/oscillating_tangential_knife.html

Thanks for the links.  Very interesting...an area of cnc machining I've never thought about.

 

I have been getting ready to use the definition that you helped me with last month... and I have a few questions about <null> values that I get when feeding Zeros into the Division components. I don't have problems like this unless there is a line that only travels along the X axis.  For my Cam software... this would mean a 180 knife orientation... or a 0 degree knife orientation.

My guess at a workaround will be to just replace the <null> items with either a 180 or 0 angle, since it will always give me a null value when it should be one of those values.

My question is: how would I determine if it should be a 180 or 0 degree without manually choosing based on looking at the geometry?

I think I could take the x and y values of the list items to determine which direction the knife would be headed... then choose 180 or 0 accordingly, but there may be a simpler route that I am overlooking.

One change you will see if you look at the definition is that I am dividing the curve based on distance rather than on number of divisions.  This is so that I can avoid having the same amount of division points on small and large curves in the same Gcode (this is especially bad for trying to insert custom Mcodes  that need to fall in a particular place before the end of a curve).

I think my method is sound, but it lacks a few things... in particular it doesnt create points where a curve changes direction... where the CrvDivide by number of segments does.

Any feedback is welcome. The hardware for the knife head is almost complete. I will post when I start cutting.

Attachments:

This needs more testing.  There might be a loss of accuracy in some cases but I think you can control it by choosing a suitably small additive constant.

Chris

Attachments:

Hey Chris,

Thanks for weighing again again on this problem. You were right about needing more testing, because this solution seemed good at first, but unfortunately the fix often caused the wrong choice to be made between A or R degrees.

See attached .

I have been trying to use the Rev3 with an added method for replacing the null values with the appropriate 180 or 0 degree choice. I am pretty sure from testing so far that the null values are only cropping up if movement is traveling along the x axis only.

My specific question is written in comments at greater length in the attached gh file.

Basically it comes down to Using the Tangent Vectors from the orignial Divide curve component:

Below is my pseudo code
If {1.0,0.0,0.0}
Then insert 0 degrees
If {-1.0,0.0,0.0}
Then insert 180 degrees
If not {1.0,0.0,0.0} or {-1.0,0.0,0.0}
Then do nothing

This may be easiest to implement in VB or C#, but I am thinking I may be able to do this with a Function component... perhaps if(test,A,B) where A is 180 and B is 0.

Thanks to everybody and anybody with ideas or suggestions.

Attachments:

Try this one.

Attachments:

Chris,Testing so far seems great. I think this is it! I need a bit of time to incorporate this A axis into my 3axis gcode definition.  I will post some pictures of the unit when I start cutting!

Thanks again for everything. I think the only thing I will change with this version is I am going to try to use the Divide length rather than the Divide Curve component. It is not as pretty/simple, but it seems like it will be more functional when it comes to actual use if I am defining the distance b/w points along a curve segment, instead of stating a given number of points per curve.  I was running into weird problems with my gcode for 3Axis work ... when I had curves that were long and some that were very short... they would be divided into the same number of points... which was often too detailed... or not enough.

Example:Thanks again Chris!

Attachments:

I agree that it makes more sense to use Divide Distance rather than Divide Curve.  Be sure to post something when you get it working at the machine...or if you find more problems with the definition.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service