Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional gcode and variables #357

Closed
coolerooney opened this issue Jan 2, 2013 · 17 comments
Closed

Conditional gcode and variables #357

coolerooney opened this issue Jan 2, 2013 · 17 comments

Comments

@coolerooney
Copy link

Hi all,

Is there a chance we can get conditional gcode and variables into the Marlin command set?

This exists in cnc (a few I must confess)

Thx and have a fantastic 2013!!!!!

Carl

@daid
Copy link
Contributor

daid commented Jan 2, 2013

Any chance you could point me to a standard about how this works? (I'm not promising anything, just want to see how realistic it would be)

@coolerooney
Copy link
Author

Hi Daid,

its done in Fanuc (Macros)and some in Mach 3
http://www.predator-software.com/Predator_Virtual_CNC_Software_Fanuc_CNC.htm

more general

http://www.cnccookbook.com/CCCNCGCodeIFGOTOWHEN.htm

hope this helps

thx

Carl

@daid
Copy link
Contributor

daid commented Jan 2, 2013

Mmm, those features are quite incompatible with the GCode dialect we use right now. As it uses N codes to signal positions, but we have N codes added by our GCode sender for checksums and communication error recovery.

@coolerooney
Copy link
Author

Understand, but the letter used is not that important, in linux they use "o" coding
http://linuxcnc.org/docs/html/gcode/o-code.html

@ZetaPhoenix
Copy link
Contributor

Using Nxxxxx at the beginning of a line as a line number or other position data is standard gcode usage, but it is optional, IE, the processor ignores them unless it comes to a subroutine like a roughing and finishing command.

-Jon

Sent from my iPhone

On Jan 2, 2013, at 10:42 AM, daid notifications@github.com wrote:

Mmm, those features are quite incompatible with the GCode dialect we use right now. As it uses N codes to signal positions, but we have N codes added by our GCode sender for checksums and communication error recovery.


Reply to this email directly or view it on GitHub.

@bkubicek
Copy link
Contributor

bkubicek commented Jan 2, 2013

The N is also used in gcode data transfer between computer and arduino:
eg. n1 G0 X0 Y0*blabla
where blabla is a checksum in pronterface. the firmware can tell the
host if line x had an error and it should resume sending there.
IIRC.

I think that loops are not very useful. Even linuxcnc locks up if there
is a typo and you make an infinite loop.

From my milling machine it is, however.

One concept worth stealing is however variables.
e.g.
#1= 500
G1 X0 Y0 F#1
All the variable numbers should be collected by the controller, and have
a limited letter string attached
e.g. "#1=500; frt" ->string = "frt" value=500 variable number 1
Then the arduino+ultipanel could make them online changeable. E.g. for
bridging feedrate, retraction distance, and so on. For things where no
direct firmware support exists.

On 1/2/2013 8:06 PM, ZetaPhoenix wrote:

Using Nxxxxx at the beginning of a line as a line number or other
position data is standard gcode usage, but it is optional, IE, the
processor ignores them unless it comes to a subroutine like a roughing
and finishing command.

-Jon

Sent from my iPhone

On Jan 2, 2013, at 10:42 AM, daid notifications@github.com wrote:

Mmm, those features are quite incompatible with the GCode dialect we
use right now. As it uses N codes to signal positions, but we have N
codes added by our GCode sender for checksums and communication error
recovery.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
https://github.com/ErikZalm/Marlin/issues/357#issuecomment-11819753.

@coolerooney
Copy link
Author

I am just a shoestring programmer, but semantics count everywhere

How do we move this forward?

@bkubicek
Copy link
Contributor

bkubicek commented Jan 2, 2013

the problem is memory consumption.
The best thing to bring this forward is DIY. I stared the LCD controller
that way, if there is enough usefullness it will be used if it does not
screw other stuff up.

Insert general rant on how we need to move on to arm: It would all be
soo much easier if we moved on to ARM.

On 1/2/2013 9:01 PM, coolerooney wrote:

I am just a shoestring programmer, but semantics count everywhere

How do we move this forward?


Reply to this email directly or view it on GitHub
https://github.com/ErikZalm/Marlin/issues/357#issuecomment-11821764.

@FMMT666
Copy link

FMMT666 commented Jan 2, 2013

What would be the benefit of having O-Words (speaking LinuxCNC style, here ;-)
or variables implemented in the FW of a 3D printer?
Even on big CNC machinery, script languages and plugins took over this
ancient programming style.
A few lines of Lua, Python, Ruby or whatever code can do much more.

Insert general rant on how we need to move on to arm:
It would all be soo much easier if we moved on to ARM.

What would you think of an implementation based on a Cortex-M4?
Or would like to play B I G, a real-time Linux-Magma based Cortex-Ax?

ASkr

@bkubicek
Copy link
Contributor

bkubicek commented Jan 2, 2013

On 1/3/2013 12:25 AM, FMMT666 wrote:

What would be the benefit of having O-Words (speaking LinuxCNC style,
here ;-)
or variables implemented in the FW of a 3D printer?

Of loops i see no benefit.
macros could have printer based layerchange/start.gcode/end.gcode stuff.
Variables would enable arbitrary realtime control of parameters using
the printers LCD interface.

Even on big CNC machinery, script languages and plugins took over this
ancient programming style.

I still use it if I want to plane an larger area.

A few lines of Lua, Python, Ruby or whatever code can do much more.

Insert general rant on how we need to move on to arm:
It would all be soo much easier if we moved on to ARM.

What would you think of an implementation based on a Cortex-M4?
Or would like to play B I G, a real-time Linux-Magma based Cortex-Ax?

I would love to see a arm m3 port of marlin. Its however a time problem
from my side. I have a printer with a 4pi board, but for me its lacks
features, since there is no display and physical controls. Also, the
firmware gets very few commits.

@FMMT666
Copy link

FMMT666 commented Jan 3, 2013

Of loops i see no benefit. macros could have printer based
layerchange/start.gcode/end.gcode stuff.

Neat idea, but now you need several more M-Codes or variables if
you want to change all this (semi-) hard-coded stuff.

I still use it if I want to plane an larger area.

Yes, I (sometimes) do the same. But on a 3D printer?
I implemented a G38 straight probe into Marlin and thought some "O-Words"
would be helpful, but I ended up with a host based solution...

I would love to see a arm m3 port of marlin.

Mhh, an M4 offers the same, but adds a DSP and, even more important, an FPU.
And compared to all this really B I G stuff, you still can solder these ;-)

I have a printer with a 4pi board

Google finds nothing else but a "4pi microscope" and something related to IBM.
Can you point me to your "4pi board", please?

ASkr

@bkubicek
Copy link
Contributor

bkubicek commented Jan 3, 2013

Bernhard

On Thu, Jan 3, 2013 at 1:08 AM, FMMT666 notifications@github.com wrote:

I would love to see a arm m3 port of marlin.
Can you point me to your "4pi board", please?

http://xyzprinters.com/electronics/177-4pi-3d-printer-controller.html

thats not an advertisment. I have one in an ultimaker. I miss my display
code a lot, and SD printing does not work for me. not sure why. Also, i can
only connect to the printer while external power is off, after connecting
things the supply can be powered and things are well.
The sd card is not removeable from the usb connector side.
Also, there is very limited activity on the firmware's github.
The plus is: no cooling, very quiet stepper operation.

@jfpion
Copy link

jfpion commented Jan 9, 2013

a very useful feature (and a very simple one to add i think) could be the cold extrusion limit configurable by the gcode, because the limit is very filament dépendant and if you switch often of filament it could be easier to add the M instruction in the sclicer

thank you

@bkubicek
Copy link
Contributor

bkubicek commented Jan 9, 2013

Thats much easier usable by having a gcode that just sets the value for the
cold extrusion, e.g. adding a S value to the M302.
I think that "if" and "loop" are only an option with a controller that
features much more memory.
It needs to store for each o<afsakdfjö> the location in the file, and this
cannot be done with constant memory without limiting the amount of o's.
The same goes for variables. Its only safely implementable if there is a
predefined number of variables, and hence constant and limited memory usage.

Bernhard

On Wed, Jan 9, 2013 at 10:59 AM, jfpion notifications@github.com wrote:

because the limit is very filament dépendant and if you switch often of
filament it could be easier to add the M instruction in the sclicer

@jfpion
Copy link

jfpion commented Jan 9, 2013

"Thats much easier usable by having a gcode that just sets the value for the cold extrusion, e.g. adding a S value to the M302."

that's would be great ! easy , no memory consomming, perfect !

@boelle
Copy link
Contributor

boelle commented Dec 19, 2014

This one is created about a year ago and there have been a lot of changes, please download the latest copy of marlin and see if the problem is still there. Also you the latest arduino IDE to flash the marlin firmware. If you board files etc only work under old ide upgrade those first so they work under latest IDE.

If you create board files for hardware that are not in the https://github.com/ErikZalm/Marlin/tree/Marlin_v1/ArduinoAddons then please fork marlin and add the files and then create a pull request so that we can get the hardware supported. This will also give an idea what hardware people are using.

@boelle boelle closed this as completed Dec 19, 2014
epatel pushed a commit to epatel/Marlin that referenced this issue Mar 16, 2016
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants