waiting for status
-
@Proschi78 So you're talking about heaters. In that case something like this should work:
; tune heater 1 and wait for it to finish M303 H1 S210 while heat.heaters[1].state != "standby" && heat.heaters[1].state != "off" G4 S1 ; tune heater 2 and wait for it to finish M303 H2 S210 while heat.heaters[2].state != "standby" && heat.heaters[2].state != "off" G4 S1 ; tuning finished, save parameters to config-override.g M500
-
thank you very much I will test that
-
@Proschi78 do I need something in deamone.g for that
-
@Proschi78 i would do that in a macro for tuning heaters. you don't want it in deamon.g because that runs all the time and your heater tuning will only (presumably) run once or maybe a few times per machine.
-
@T3P3Tony have expressed myself wrong.
i meant do i need deamone.g to get the status of the heater?
or if the macro works without deamone.g -
@Proschi78 daemon.g is a macro that the system runs every 10s, in other ways its no different for any other macro.
the information that you are using, e.g. heat.heaters[1].state comes from the object model:
https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentationso you can access it from any macro.
-
Is there a way to save the PID result directly in a filament config?
-
@Proschi78 I got it.
Now I still have the problem that the file is always deleted and recreated.
Is it possible to only update the file and not delete it?; tune heater 1 and wait for it to finish M303 H1 S210 while heat.heaters[1].state != "standby" && heat.heaters[1].state != "off" G4 S1 ; tune heater 2 and wait for it to finish M303 H2 S210 while heat.heaters[2].state != "standby" && heat.heaters[2].state != "off" G4 S1 M291 S3 R"The results of the PID tune have been automatically saved" P"You can view the results of the PID tune in the PID_tune_E0.g file" echo "You can view the results of the PID tune in the Filament PID file" echo >"0:/filaments/PLA/PLA PID" "M307 H1 R"^{heat.heaters[1].model.heatingRate}, "K"^{heat.heaters[1].model.coolingRate}^":"^{heat.heaters[1].model.fanCoolingRate}, "D"^{heat.heaters[1].model.deadTime}, "E"^{heat.heaters[1].model.coolingExp} echo >>"0:/filaments/PLA/PLA PID" "M307 H1 B0 S1.0 V"^{heat.heaters[1].model.standardVoltage} echo >>>"0:/filaments/PLA/PLA PID" "M307 H2 R"^{heat.heaters[2].model.heatingRate}, "K"^{heat.heaters[2].model.coolingRate}^":"^{heat.heaters[2].model.fanCoolingRate}, "D"^{heat.heaters[2].model.deadTime}, "E"^{heat.heaters[2].model.coolingExp} echo >>>"0:/filaments/PLA/PLA PID" "M307 H2 B0 S1.0 V"^{heat.heaters[2].model.standardVoltage} ; tune heater 2 and wait for it to finish ;M303 H0 S60 ;while heat.heaters[0].state != "standby" && heat.heaters[0].state != "off" ; G4 S1 ; tuning finished, save parameters to config-override.g M500 M570 H0 P5 T15 ; set heater fault detection back to default
-
@Proschi78
I'm not sure why you want to save the PID results in a filament config.g
The results should be the same regardless of filament.
Use M500 to save them to config-overide.gIn addition, I think you should change your wait state to
while heat.heaters[1].state = "tuning" G4 S1
So that you are actually checking if it is tuning.
The available states are here
For example your code would continue immediately if the state was "fault" -
@OwenD I call the PID over M703. The code works as I posted it above