Propeller gcode interpreter for CNC and 3D Printer
Rayman
Posts: 14,854
From this other long thread (that I don't want to hijack too much), I want to make a Propeller version of the Thing-O-Matic controller (Arduino based).
This is all new to me, but I think this is the concept:
As I understand it, you can use software such as MACH3 on a PC to generate gcode that tells the tool exactly what to do. You then copy the gcode onto an SD card and stick it in the Prop controller. The Propeller will then send signals to the stepper controller to move the tool around.
The Thing-O-Matic just does 3D printing, but I'm hoping the Zen kit I've ordered will also double as a basic CNC machine for soft materials.
But, instead of just doing what the Arduino unit does, I'd like to add in extra functionality...
What makes sense?
VGA/KB/Mouse interface? - use a computer monitor to see what's going on and manually control
(or does TV/KB/Mouse sound better?)
Network interface? - use a PC web browser to to see what's going on and manually control
Or, does a little, say 3.5" touchscreen interface make more sense?
Is sound output important?
I think you could use a PC to control the system and not use the Propeller at all.
But, the Thing-O-Matic people seemed to think that a microcontroller based approach is better.
I'm hoping that more people feel the same way...
Maybe there's only a handful of people out there thinking about this too, but I'd like to hear any opinions on the right direction.
This is all new to me, but I think this is the concept:
As I understand it, you can use software such as MACH3 on a PC to generate gcode that tells the tool exactly what to do. You then copy the gcode onto an SD card and stick it in the Prop controller. The Propeller will then send signals to the stepper controller to move the tool around.
The Thing-O-Matic just does 3D printing, but I'm hoping the Zen kit I've ordered will also double as a basic CNC machine for soft materials.
But, instead of just doing what the Arduino unit does, I'd like to add in extra functionality...
What makes sense?
VGA/KB/Mouse interface? - use a computer monitor to see what's going on and manually control
(or does TV/KB/Mouse sound better?)
Network interface? - use a PC web browser to to see what's going on and manually control
Or, does a little, say 3.5" touchscreen interface make more sense?
Is sound output important?
I think you could use a PC to control the system and not use the Propeller at all.
But, the Thing-O-Matic people seemed to think that a microcontroller based approach is better.
I'm hoping that more people feel the same way...
Maybe there's only a handful of people out there thinking about this too, but I'd like to hear any opinions on the right direction.
Comments
MACH 3 don't need Micro-controller Hardware. All that needs are Stepper controller's that are Parallel port driven from PC and has only signals to it - Forward/Back,.Step's, Half/full step's.
Other that software are KCAM4.
It is that ones I look on.
I'll take a look at KCAM4.
I suppose another approach for the 3D printing parts is to use the Thing-O-Matic software to generate the gcode and have the Prop process that...
Given that, and the fact that controlling the steppers needs a lot of I/O pins, I guess I'll need a 2 Prop solution.
One Prop will take in gcode commands via serial port (either from PC or second Prop) and control steppers.
Optional second Prop will be used for human interface.
They only have 2 speeds, but that choice left me with plenty of Propeller pins.
I found the PC side g-code application but it needs to be rewritten for current platforms.
As is, it needs some MSCommLib.dll stuff. It's more than a 5 minute job. Here's a snapshot:
As I read it, you need 2 pins, 1 for direction and 1 for step. So, essentially that's the same as the driver board I'm getting.
So for 4 axes, that's 8 pins. Then you also want to monitor limit switches and proximity home switches and an E-stop switch.
Also, it seems people want to enable the axis motors with a dedicated pin.
Also, there's sometimes a spindle motor relay to control.
We'll probably want to monitor and control the temperature of the 3D print head...
I think it adds up to a lot of pins... I could try i2c expansion, but I'm not totally sure that's fast enough...
I see there are 3.4 MHz I2C I/O Expanders from Microchip.
I'm pretty sure that would be fast enough. But, jazzed has me worried now about how much memory a gcode translator will take up...
I've asked via PM if he could send back a copy if he has it. We'll see.
I got my thing-o-matic built and running just a few weeks ago. Pretty cool except for that arduino.
The thing-o-matic gets the gcode from either the USB or the sd card. I've only used the USB so far with no problems.
If I'm reading it right, RepicatorG does a lot of the gcode processing on the PC and sends simplified commands over USB serial link or SD card.
Perhaps a better approach for me (at least for 3D printing) is to process this binary code instead of text gcode.
Then, I think I can use the Makerbot software directly...
I'm not sure if that approach is workable for regular CNC work though...
http://replicat.org/sanguino3g
It would be interesting to write a small PC program to interactively fire these commands at the thingomatic.
A shift register with latch is another option... That could also achieve 24 kHz. I'll have to think some more on the best approach for a 1-Prop system.
I've seen drivers that support up to 256 micro steps. For a cutting machine that doesn't make much sense, as the small steps aren't likely to overcome the static friction required move the head, but for a printer the forces involved are much lower - micro-steps might be useful. Blah blah blah...
If I set the hard switches of the controller to say 8 microsteps and then give 8 pulse bursts in intervals to move the head, is this equivalent to single stepping?
I'm hoping they've posted the Arduino source code somewhere. With that, it should be trivial.
Maybe I will make some kind of Windows test app to shoot codes to the. It'll probably be weeks until I'm at that point, but then I'll see if I can find "real" Thing-O-Matic owners (like you) to try the Windows app...
I'd like to use Mach3 for CNC milling though...
http://www.contraptor.org/arduino-gcode-interpreter
http://www.dakeng.com/CNCconvert.html
I am VERY close to ordering a 7" Zen myself...
I just was reading about MODBUS and was excited for a moment because I thought it'd give an easy way to control steppers via serial port. MODBUS support is built into MACH3. Reset_Vector even posted some MODBUS code...
But, then I figured out that MODBUS isn't used in MACH3 for stepping pulses, just for switches and so forth...
Still, it is interesting and potentially very useful.
http://www.machsupport.com/MachCustomizeWiki/index.php?title=The_G100/GREX_plugin_as_a_model_for_device_control
at the G100 plugin for Mach3. Thinking some more about it, this is a perfect application for the Propeller. A cog can be dedicating to the precise timings given by Mach3.
The connection to the Prop could be over LAN or PropPlug style USB serial.
There is a bit of latency with serial to worry about, but I think that could be dealt with.
Meaning load a 3D-model of a mechanical part as input and get G-codes for driving a cnc-mill to create the part.
The output was ALL very simple and basic gcodes 95% was driving linear even for circles which where divided into a big list of linear moves.
So a gcode-interpreter that does not ALL gcodes but only the really important ones should easily fit into 32kB of RAM
@jazzed: can you give a raw overview of the gcodes that you implemented into the prop-gcode-interpreter
really just a raw overview
was memory full after G00 - G04 + M00 - M20 or how many % of the gcodes did fit into 32kB?
Anyway the gcode-interpreter would be something for BIG SPIN
best regards
Stefan
I'll have to take a look at the Makerbot recommended software and see what kind of gcodes it spits out.
Perhaps the Prop could use the actual gcodes instead of the reduced binary versions that it generates...
I think the g-code is essentially the same for 3D printing and CNC milling...
some examples
G01 X100 Y 200 Z300 F50
move tool to XY_Z-coordinate 100,200,300 at speed 50 mm/minute
G02 X30 Y40 I5 J15 F120
move tool in a circle clockwise startpoint of movement is 30,40, actual Z-coordinate center of circle is relative to startpoint x+5, Y+15 at speed 120 mm/minute
What a 3D-printer does not need
M03 tool-spindle on clockwise
M07 cooling-fluid on
what a 3D-printer needs instead
a command for extruder spit out melted plastic on/off
So the main things are the same some details are different.
keep the questions coming
best regards
Stefan
Bill