CNC --> Egg & Cookie painting bot
Rayman
Posts: 14,632
in Propeller 2
Got the idea from @"Christof Eb." over here: https://forums.parallax.com/discussion/174485/
Going to attempt to turn an ancient CNC into an egg/cookie painting bot.
The GRBL code from @mwroberts has the CNC taking gcode commands from PC:
https://forums.parallax.com/discussion/173498
Kids think should start with eggs, so here's the current idea:
Comments
Is your rotary axis the 4th GRBL cnc axis? If it is, I think we can add code to P2 GRBL to get it to display the A axis positions on UGS.
I think it should be as 4th axis, not exactly sure how to make that happen though...
I'm thinking the egg hardware is very close to being ready
Nice!
Getting close to being able to do something...
Made this program to interface with the GRBL code
Since you switched to the version with jog functionality, in RealTimeStatus() you need to uncomment the code that outputs A axis positions...
First test is promising. Need to figure out how to rotate at different speeds than XYZ...
At least, can now do spirals pretty well (but there are some gaps where marker left the egg). Seems Z was a hair too high.
@mwroberts A axis status working thanks.
Think figured out a couple things...
1. Should change zero from end of egg to center of egg for better egg to egg reproducibility
2. Need marker to freely move up and down in holder. Added some weight to help with that, like somebody mentioned in a different thread...
Think have spiral drawing figured out. Now, on to try something fancier...
Some hiccups, but think zig-zag is working now.
Nice!
Think close to having it do what want for eggs, but running out of time and eggs...
Got a wave working but something is wrong with serial interface...
Seems locked up after completion...
For now, can close serial port and open back up to fix...
Need to increase period, but wave is pretty good...
Nice!
Some questions:
How do you generate the g code?
Does the tip follow the shape only by weight or do you move the height axis?
Christof
@Rayman
I assume you don't use y axis?
if you disconnect motor leads to y and do a circle in the g17... x-y plane, you will get a sinusoid output on x axis...
could be good for waves...
run this line 10 times per egg turn...
G91G3G17A36i10f500 will do a circle with X&Y and translate a
@"Christof Eb." The C++ dialog based GUI shown in post#14 creates and sends GCode.
At the bottom of GUI is a section for creating a X-Z profile of the egg for precise Z control.
But, figured out that, with the weight, the same profile can be used for all the eggs...
Profile I'm using is attached with zero being tip just above center of egg.
@mwroberts Thanks. I think this code generates a sine wave, just not sure that's the best. Hemispherical might be better. At least need to reduce period...
@Rayman
The character stream that gets sent to GRBL has a carriage return and/or line feed at the end... no zero. I'm not sure how tolerant my P2 GRBL is to zero's in the incoming stream.
There are some special characters, single byte, not followed by any terminating characters like carriage return, LF or zero... that invoke an immediate response, like a question mark, a Tilda, an exclamation mark...
Did increasing the buffer size if FSD help with the lockup?
I have a cog that reads the incoming character stream and does stuff with it like parsing it for moves and adding them to the head of the circular CNC move buffer, of sending out a status packet when a question mark is received...
A second cog feeds the third cog "PASM pulse generator interpolator" moves from the tail of the cnc move buffer as it needs them...
A fourth cog runs FDS.
So the cog reading the incoming character stream isn't too overloaded. It reads into a 128 byte array to create strings to parse when it sees a carriage return or line feed.
So, more than 128 characters without a linefeed or carriage return would be bad.
I added an error message if this happens. Didn't upload anything yet.
A cnc move has an execution time. It is the distance divided by the feed rate. If these times are too small, a lot of text has to stream over in a short period... so move execution times are better if they are bigger than 50mSec or 100mSec ish??
Had to add \0 to get serial sender to recognize the end of string
Don’t think actually gets sent…
I wonder, if you could make a holder for several pens with offsets in Y (the unused axle) for automatic colour change. The inactive pens could not reach the egg if the offset is sufficient.
@"Christof Eb." Maybe. But, I think what would be better is to add a tool change feature to the P2 GRBL. Maybe next Easter...
Ready to try cookies. Just as soon as the frosting hardens enough...
Ok, this week learned that need "royal icing" and then learned today it takes 8 hours to dry
This is really putting a damper on my CNC plans for today...
Tried putting one in the freezer. That looked like it was going to work for a second. Then, water condensed on it and it made a mess...
Clamping looks solid!
My 2D patterns seem to come out 3/5 the size they should be...
Have to tweak something somewhere...
Cookies finally cooperating...
Trying some random clipart from UGS