Script to make babysteps permanent
-
Hi, and thanks for reading.
There are a couple of threads going about a script to make babysteps, as tweaked at the beginning of a print, permanent.See here:
https://forum.duet3d.com/topic/18052/need-to-lower-the-nozzle
and here:
https://forum.duet3d.com/topic/16328/baby-stepping-can-it-or-can-it-not-be-permanent
This is the macro I am currently running:
; 0:/macros/Save-Z ; This macro adds the current babystep offset to the Z trigger height and saves it to config-overide.g ; ! M501 needs to be in config.g to automatically be recalled on reset. If using multiple filament settings, ; and this is for a specific filament type, recommend placing this yielded information in the filament's config.g. if move.axes[2].babystep !=0 ; If no babysteps are currently adjusted - exit routine echo {"OLD: " ^ sensors.probes[0].triggerHeight ^ " NEW: " ^ sensors.probes[0].triggerHeight + (move.axes[2].babystep * -1)} G31 Z{sensors.probes[0].triggerHeight - move.axes[2].babystep} echo {"Place either M501 -or- G31 Z" ^ sensors.probes[0].triggerHeight^ " in your config.g"} M500 P10:31 ; save settings to config-overide.g - G31 P31 saves trigger height, ; trigger value, and X and Y offsets for each possible Z probe type ; P10 parameter saves the G10 tool offsets. M290 R0 S0 ; clear babystepping else echo "Baby stepping is not currently employed, exiting."
The sequence of actions is that I start with a freshly homed Duet with babysteps set to zero. I start a print job and I realize that my nozzle is too high. I babystep down until I get a good first layer (this being done while the print job is running). I have now determined the correct nozzle height and I want to make that permanent so I run the macro (print job is still running).
From what I can ascertain, the variable sensors,probes{0}.triggerHeight as used in the macro's G31 command seems to be set incorrectly when run while there is a print job going.
After the G31 line is run, the sensor.probes[0].triggerHeight is a value that doesn't make sense. I have seen it at (roughly) 69, 120, 450 mm and other values.
There have been occasions when the trigger height was correct but lately I get crazy values after even a single run of save z.
I have not seen crazy values if there is no print job running.It would appear that the variable /memory location is somehow re-used or over-written and then restored (one possible scenario) during an active print job.
Would you please have a look-see at the situation and the code and see if you can find an issue somewhere in the bowels of the firmware (or in the way the macro is coded or run) ?
There have been a couple of new versions of this floated but I have stuck to an older version as it shows the issue nicely.
Thanks!
-
Additional info: When I refer to 'the print job running' I refer to stuff actually moving about. If I 'pause' the current job, the save operation succeeds in all the tries that I have done. As soon as I try to save z while the printhead is moving, things go pear shaped.
-
@jens55 just changed the topic to something more useful
-
<sigh>
Now we have three threads for the same issue. -
I admire your persistence.
-
@fcwilt said in Script to make babysteps permanent:
I admire your persistence.
Is that what you call it......
Sometimes you just have to say f*** it and go have a beer
-
Did that, ran out of suds, problem didn't go away ...
Oh yeah ... figured I would save somebody a lot of grief down the road when the issue reared it's ugly head again in another situation. -
@DC42 Bump .....
Could a mod please make sure that DC42 is aware of this issue?
I realize that he is probably busier than a one armed paper hanger and I will gladly step back and forget about this issue for now once I know that it reached him. -
-
@droftarts said in Script to make babysteps permanent:
@jens55 Probably best to actually tag him with @dc42 if you want him to look!
Ian
That doesnt seem to work I asked a question in another thread last week (regarding firmware)
I tagged him and got no reply, so either its not working or he didn't want to answer the question.....
-
Thanks .... how do you tag somebody and what does that do? Does he get a message when it's tagged ?
-
@CaLviNx He gets a lot of requests. Last week he was on holiday, so try again.
Ian
-
@jens55 Type an '@' sign in your post, and you'll get a list of people that have replied to the post. If the person who's attention you want is not on the list, just continue and type their name. Like replying to a particular post (the blue 'Reply' or 'Quote' words on each post), the person tagged will get a notification via the bell icon.
Ian
-
@jens55, are you running firmware 3.1.1, or an earlier version?
-
@dc42 , thanks for replying!
3.1.1 -
I confirm that's a bug, which I will fix in 3.2beta1. Meanwhile, you may be able to work around it by putting M400 just before the G31 command.
-
Thanks! No need to work around it ... I just wanted to make sure you were aware.
-
@jens55 thanks for your work on getting this macro right.
I just tried using what you shared here. For my use case I see an issue with the macro:
1. I have configured my "rough" trigger height, then start a print
2. During the first layer I realize I want to adjust the trigger height slightly
3. I apply the desired change through baby stepping
4. I execute the macro to write the change to config-override.gAs far as I understand this will then reset the baby stepping on my current print and will bring me back to the initial trigger height I had at 1.)
This means the updated trigger height will be only applied after I restart the printer and would not persist for the print I have ongoing at that moment, is that correct?
My ideal scenario for this macro would be:
1. Start the print with per-configured "rough" trigger height
2. Fine tune through babystepping during the print
3. Execute the macro to save the new trigger height to config-override.g
4. Continue printing at the adjusted trigger height (taking the baby stepping I applied into account)Now I know this could probably be solved through simply removing the
M290 R0 S0
command but I would like to have the option to to another round of adjustments through baby stepping if needed and save it again with the macro. Problem here would be that if the reset is removed, I would then adjust my trigger height by the value I have adjusted originally + the value I have adjusted with in my second round of baby stepping adjustments which results in a too small or too big trigger height value. (e.g. first save was baby steeping +0.02, second adjustment is +0.04 which will then save a total of +0.06 to the value I have saved after my first round of adjustments).Does that make sense? Do you have an idea how I could solve this?
If not, I only see the following options to achieve what I want to do:
a) Use the macro as shared above and always run a specific calibration print to fine tune the trigger height, save it, restart the printer and then kick off the print I actually want to print
b) Remove the reset of baby stepping and only save it to config-override.g when I am 100% happy with my adjustment, so I would not have to do it a second time throughout the print
-
-
Usefull script. Question: how would you do it if you have a second tool? A second tool offset is always relative to the other Tool (T0 offfset is set using G31, T1 offset is set using G10).
Lets say you have T0 offset OK, and now you are printing a test with T1 and using babystep you get to the sweet spoot, the babystep value you get is recognized as belonging to T1 when you execute the M500 P10:31 command? -
I already have this working. It saves babystep value on pause, cancel, print end and loads it at print start.
G32 and G29 resets it to 0.
It's also possible to continously monitor it with daemon.g in case of event of power loss.