Passing Multiple Rod Lengths through M665
-
I'm just wonder how (if it's even possible) to pass variables for the separate arm lengths that's possible with the normal uses of M665 (ex: M665 L260.1:260.2:260.0 ) which works fine without a variable in the macro. I have varying arm lengths (with a mm but getting them right puts my calibrations under .015 mm and wrote meta macro to iterate through rod lengths at .001 mm increments to see if I can get it better (mostly for shits and giggles, not at all number chasing for under .005 deviation). But even when I successfully pass the command, it always writes it as a uniform arm length. So I'm just asking if I'm attempting the impossible or if someone knows the trick for this command.
example where Echo will work but M665 would notecho "M665 L"^ {move.kinematics.towers[0].diagonal+0.05} ^ ":" ^ move.kinematics.towers[1].diagonal ^ ":" ^ move.kinematics.towers[2].diagonal M665 "L" ^ {move.kinematics.towers[0].diagonal+0.05} ^ ":" ^ move.kinematics.towers[1].diagonal ^ ":" ^move.kinematics.towers[2].diagonal
-
@lord-binky
Try removing the double quotes.
echo expects a string (requires quotes). M665 is expecting an array of numbers.var amount=0.05 M665 L{move.kinematics.towers[0].diagonal + var.amount}:{move.kinematics.towers[1].diagonal}:{move.kinematics.towers[2].diagonal}
-
@lord-binky it's possible in RRF 3.3 in standalone mode only, using the syntax that @OwenD suggests. In 3.4beta it's possible both in standalone mode and in SBC mode, but the syntax has changed and is now:
var amount=0.05 M665 L{move.kinematics.towers[0].diagonal + var.amount,move.kinematics.towers[1].diagonal,move.kinematics.towers[2].diagonal}
-
-
~@dc42 @OwenD Ok so an additional expression {} so this line actually works but also returns this.
var amount=0.05 M665 L{{move.kinematics.towers[0].diagonal + var.amount}:{move.kinematics.towers[1].diagonal}:{move.kinematics.towers[2].diagonal}}
test 1 M665 L361.150:361.200:361.300 Error: in file macro line 22 column 57: M665: Expected '}' Diagonals 361.150:361.200:361.300, delta radius 143.059, homed height 284.668, bed radius 180.0, X 0.472°, Y 0.088°, Z 0.000°
Still, that works and I'm moving on. Thanks again.Since it might be bug or I might be the bug, I went ahead and attached my macro if you want to check it out yourself ( or more likely point out something else I missed / over complicated).
I added the .g so the file would upload, didn't want to zip it because they feel shady to me? So, you probably have to remove it to run it right
M665 Macro Test.gEdit: Ok I was wrong again, but on the right track no error messages now and thoroughly tested in test macro after cluttering my one in development with echo's...so many echos...
Anyways, the winner is classic array punctuation: the mighty comma. It passes along fine inside expression curly parenthesis.
{{ expression },{ expression }}
ex:var amount=0.05 M665 L{{move.kinematics.towers[0].diagonal + var.amount},{move.kinematics.towers[1].diagonal},{move.kinematics.towers[2].diagonal}}
-
@lord-binky said in Passing Multiple Rod Lengths through M665:
M665 L{{move.kinematics.towers[0].diagonal + var.amount},{move.kinematics.towers[1].diagonal},{move.kinematics.towers[2].diagonal}}
as @DC42 mentioned, M665 uses a comma from version 3.4beta.
The docs don't mention that yet.
I believe your outside parenthesis are superfluous and are the cause of your earlier error.
i.e. You are trying to evaluate the entire command instead of just the variables. -
@owend it's the inner parentheses that are redundant.