Analog input? Or adjust variable by input?
-
I am running a board in production that will only be operating the same part repeatedly. This will be run by production workers with no technical capability. I cannot have them editing the gcode for any reason.
I need a way to compensate for material variation; there are two separate lines that could need compensation. Is there an analog input I can use to modify one axis travel in a specific location? For instance, a way to a line such as "G1 X1 Y1" get modified to e.g. "G1 X1 Y1.01" if there is a 10% variation? (I understand the gcode will NOT get edited, but I need to have that type of impact on one axis.)
Thanks!
-
Not sure how that would be possible, but I'll bring it to attention.
-
Thanks. I know I could use a sp3t switch to select one of three programs to run, but then there are three separate gcode files to maintain and validate. It would be a lot easier if a single program could be adjustable. Even conditional variable assignment (if input 1, val = 1, if input 2, val = 1.01, etc), or conditional execution...
Thanks again.
-
@Phaedrux Has anybody used some of this page?
https://duet3d.dozuki.com/Wiki/Gcode#Section_Conditional_execution_loops_and_other_command_wordsPerhaps a conditional execution will allow jumping and/or selecting gcode lines?
-
@tenaja
The following pre-supposed your running RRF v3.3b2 or later
You could use conditional code to process certain travel moves depending on an input
It would require you to post process your original gcode to add the required lines.
If and elif would be a lot of extra lines but would react to alterations mid print.You could for example create a variable at the start of the print for the amount of X & Y variation
Then modify every movement to use this compensation.
This would only allow you to select the compensation amount prior to printing unless you use a global variable which is updated by daemon.gThe below code is an u tested example and may have syntax errors as I'm on my phone.
so your config.g might have
global xVariation=0
global yVariation=0In daemon.g you might have
if sensors.inputs[3].value=1 set global.xVariation=0.01 set global.yVariation=0.01 elif sensors.inputs[4].value=1 set global.xVariation=-0.01 set global.yVariation=-0.01
In your print gcode you'd modify all your moves
G1 X25 Y12.3
To
G1 X{25 + global.xVariation} Y{12.3 + global.yVariation}
Edit:
On further thought you'd probably use triggers for the inputs to set the variables rather than daemon.g -
Of course if those moves also contain extruder moves then you should recalculate the required extrusion value as well.
-
@OwenD Thanks, I might check that out. Since it is a production machine, I may wait for the final release. The code is hand-written, and there are no extruder moves, so this is exactly what I was looking for.
Is there no "EndIf", or do the blocks use indentation like Python?
Thanks again!
-
@OwenD, how do I reference the E0Stop and E1Stop inputs in this, instead of "sensors.inputs[x]?
if sensors.inputs[3].value=1 set global.xVariation=0.01 set global.yVariation=0.01 elif sensors.inputs[4].value=1 set global.xVariation=-0.01 set global.yVariation=-0.01