How to: G1 F<expression>
-
Hey, I have a quick question.
I'm trying to write a loop were in each loop iteration the set feedrate increases.
My current approach is the following, but this isn't working. Does anyone have any pointers?while iterations < 10 G28 U G1 U180 F6000 G1 F{6000+iterations*2000} while iterations <5 G1 U56 G1 U304
I've tried replacing the {} with () or [] but did not have any success.
-
Hi,
The documentation says this:
iterations int The number of completed iterations of the innermost loop
So how are we to interpret that when used it in nested whiles?
Did you try removing the inner while to see if it made a difference?
Frederick
-
@schpongo
What is "not working"?
I.e what was your intent vs what is happening?
The way you've written it, it would (I think) complete five loops of the second level for each of the first.
If you're intent is to only do the second half on the first five iterations of the first, then use an IF statement. -
Sorry for being no specific enough. Line 4 is not working. Thus the feedrate always stays at F6000 from the command in line 3. I've tried echoing the calculation inn line 4 and it works. But the combination with the G1 command does not seem to work.
-
This post is deleted! -
@schpongo said in How to: G1 F<expression>:
Hey, I have a quick question.
I'm trying to write a loop were in each loop iteration the set feedrate increases.
My current approach is the following, but this isn't working. Does anyone have any pointers?while iterations < 10 G28 U G1 U180 F6000 G1 F{6000+iterations*2000} while iterations <5 G1 U56 G1 U304
I've tried replacing the {} with () or [] but did not have any success.
I've just tried that on my delta, with a few changes to suit the geometry:
while iterations < 10 G28 G1 X0 Y0 Z50 F6000 G1 F{6000+iterations*2000} while iterations <5 G1 X-150 G1 X150
It works for me as expected. For each iteration of the outer loop, the speed of the moves in the inner loop increases. I'm using RRF 3.2beta1.
-
Hey, sorry for the late reply.
I tried your code again and changed the axes but it still does not work.
G28V while iterations < 10 G1 X0 Y0 Z50 F6000 G1 F{6000+iterations*2000} while iterations <5 G1 V-150 G1 V150
The result in the console is:
Failed to execute G1 in test: [ArgumentException] Cannot convert F parameter to float (value {6000+0*2000})The problem is no longer relevant to me but there may still be a bug here which needs fixing.
-
I just ran into this with a simple expression like:
G1 E1 F{600.0 + 1.0}
which gives the error:
Error: Operation failed (Reason: ArgumentException in SimpleCode: Cannot convert F parameter to float (value {600.0 + 1.0}))
I'm still on 3.1.1 so maybe this is fixed in 3.2+ (just a wild guess that @dc42 is running the latest firmware on that Delta)
-
@garethky said in How to: G1 F<expression>:
I just ran into this with a simple expression like:
G1 E1 F{600.0 + 1.0}
which gives the error:
Error: Operation failed (Reason: ArgumentException in SimpleCode: Cannot convert F parameter to float (value {600.0 + 1.0}))
I'm still on 3.1.1 so maybe this is fixed in 3.2+ (just a wild guess that @dc42 is running the latest firmware on that Delta)
The "Argument exception" indicates that you are running a Duet+SBC and it is DSF that failed to do the maths. It's likely been fixed in 3.2.x.
-
Fixed for me in 3.2_RC2!
-
Sorry no, its not totally fixed. It was broken for other parameter and that is fixed in 3.2. the F parameter still returns the same error.
-
Thanks for reporting this problem, I'll fix it in the next version.