Object model help please
-
I want to print using the UV carriage split from XY so I can reduced the amount of movement and vibration of the UV carriage. I have a script that converts the gcode file but I still need to maintain the machine as combined for all the macros, G29, G30, G32, pause etc.
If I have homed XUYV and then combined XU YV, the printer works( this is how I have run for years) However, if I then uncombine them, X and Y show the correct position but U and V show 0 so the machine crashes.
A work around is to make the U position the same as the X and the V position the same as Y.
I have tried the following but I just get an error.
move.axes[3].machinePosition = move.axes[0].machinePosition
Error: Bad command: move.axes[3].machinePosition = move.axes[0].machinePosition
Error: Bad command: move.axes[3].machinePosition = move.axes[0].machinePosition
Error: Bad command: move.axes[3].machinePosition = move.axes[0].machinePosition
Error: Bad command: move.axes[3].machinePosition = move.axes[0].machinePositionmove.axes[4].machinePosition = move.axes[1].machinePosition
I obviously have something wrong, can anybody please show me what the command should be.
-
@appjaws Hi again Paul,
I'm a bit confused - I thought we'd got this all worked out and that you were up and running. You even modified my python script to tweak the behaviour how you wanted it.
Can you explain a bit more what the problem is? Send me an email if you like.
Meanwhile, an alternative solution is what I do, and never combine the axes. It does mean modifying homing, pause, and other macros but it's not too much work. Happy to share mine if it helps.
-
@deckingman Yes I tweaked the script some more and it works great, I have been operating in fully split mode for sometime now. The problem with having the machine split all the time is G29 and fault conditions do not work. So I thought if I operated the machine in XU YV combined mode but split for just the print task, everything would work.
I soon realised that the UV positions are not updated with the XY moves when M584 X0 U3 Y1 V4 Z7:8:9 E2:5:6 P5 is actioned to split the carriages.
So all that needs to happen is to be able to make the U position the same as X and the V position the same as Y when the drives are split. -
@appjaws Hmm. Not sure I fully understand the problem still - that's just me being thick.
But a couple of suggestions...........
If you combine the axes as soon as they have been homed, then XU and YV will be the same. So if you always home before doing mesh compensation, that should work. Or is that not practical (I don't use G29 myself).?
Macros that might get called while the axes are split for printing, such as pause or cancel, are a bit more tricky - I chose to change the macros to incorporate UV moves where previously only XY moves were used). Can you use G92 to set position? What I mean is something along the lines of read the X position, then do G92 Unnn (where nnn is the X position)? Dunno - just throwing ideas around....
-
@appjaws
You can't just assign the value directly through the object model.
You could do something likeG92 U{move.axis[0].machinePosition}
I know little about your setup type, but that should achieve what you're asking.
-
@OwenD said in Object model help please:
G92 U{move.axis[0].machinePosition}
Thank you for your help but that didn't work, U remained at 0
-
@deckingman Thank you, I think I have a work around, Move to X0 Y0 then split the drives so XYUV are all at 0 then start to print.
A command that would update U and V with X and Y position would be more elegant as indicated by @OwenD, but that didn't work.
I suppose that the firmware could be modified so that the firmware knew that if multiple carriages are used then the position of all drives should be updated for G29 and fault conditions.
-
@appjaws What do you have in pause.g and cancel.g and stop.? I got caught out because I have my machine set up to move the carriage to the back of the machine if I cancel a print. I forgot that cancel.g only had XY moves so the first time I cancelled a print, it moved the XY gantry but not the UV gantry (and then I swore - loudly and prolifically ).
I added UV moves to cancel.g - you might want to do the same (and any other such files - I can't think of any other way around that).
I can't help with the G29 thing (other than to say use a bed that's flat and level, then you don't need to run it)
-
@deckingman Ha Ha. I don't have a stop.g or cancel.g so I assume the machine just uses whatever is the default.
What have you in your stop and cancel and where are they located?
Thanks for the help -
@appjaws said in Object model help please:
@OwenD said in Object model help please:
G92 U{move.axis[0].machinePosition}
Thank you for your help but that didn't work, U remained at 0
What were you expecting it to be?
If you move X to the position and type move.axes[0].machinePosition into the console what do you get?
Are you sure all moves are finished before that command? M400 may be required prior. -
@OwenD said in Object model help please:
move.axes[0].machinePosition
I would have expected the U move position to be updated with the X position but your suggestion of G92 U{move.axis[0].machinePosition} didn't update U which remained ar 0.
This is what I get from the console
move.axes[0].machinePosition
Error: Bad command: move.axes[0].machinePosition
Error: Bad command: move.axes[0].machinePosition -
@appjaws
Apologies
Should be
echo move.axes[0].machinePositiion
It should return where X is at the time. If that's 0 then I'd expect G92 U... to set it thus -
@OwenD said in Object model help please:
echo move.axes[0].machinePositiion
echo move.axes[0].machinePositiion
Error: meta command: unknown value 'machinePositiion' -
@appjaws
can't win. Try without the extra "i" in position
One finger typing on a phone here.. gimme a break -
@appjaws theres too many i's in Position
-
@OwenD Thanks again.
Yes that worked but then why isn't G92 U{move.axis[0].machinePosition} working?just realised that axes is spelt axes not with an i
So G92 U{move.axes[0].machinePosition} works.
Will do some testing, thanks -
@appjaws if you are running at least DWC 3.2 then navigate to
Settings->general->plugins and turn on "Object Model Browser"
then you can explore the object model as it is on your board. (use refresh to update to see things change). use echo <object model key, value> as you have done with the move.axes[0].machinePosition to check you have a specific path correct. then you can use that in commands of meta commands as you need.
-
@appjaws said in Object model help please:
just realised that axes is spelt axes not with an i
You likely know this but I will mention it just to be sure. Axis is singular, Axes is plural.
Frederick
-
@appjaws said in Object model help please:
@deckingman Ha Ha. I don't have a stop.g or cancel.g so I assume the machine just uses whatever is the default.
What have you in your stop and cancel and where are they located?
Thanks for the helpHi Paul,
Looks like your getting the help you need with object model commands.
Ref pause.g, cancel.g etc. These macros all go in the sys folder (along with the homing macros, tool change macros etc). They might or might not be "auto generated" so they might or might not exist. They might also exist but be empty of any commands.
"pause.g" runs if you hit the pause button during a print in DWC (or otherwise send pause command). What you do inside that macro is entirely up to you. Similarly, cancel.g runs if you hit cancel (after already having paused the print).
Here is an example of my cancel.g
G10 ; retract M98 P"0:/macros/ToolTemps/ToolTemps0.g" ; set the tool temperatures to zero G91 ; set relative G1 Z5 F240 ; move bed down 5mm G90 ; back to absolute G1 X165 U165 A165 Y300 V300 B300 F9000 ; move to rear M140 S0 ; turn off bed M106 S0 ; turn off part fan
Note the additional UV commands that I had to add (and also AB commands in my case).
So check those files, and if they contain any XY moves, then make sure to add UV moves to those lines. It's not much work and will save you having nasty experiences like I had when I stupidly forgot about them.
-
@appjaws
Apologies again.
Yes, should be axes, not axis.
Not sure if that was me or autocorrect
As stated above, always check the exact syntax using the object model browser.
e.g. "machinePosition" would work, but "machineposition" would not.