Inaccuracy of PID values in the object model
-
When doing a PID tuning and saving the values with M500 P31 the config-override.g hat the following numbers:
.
In the object model the exponent of the cooling rate curve and the dead time are rounded to one digit
It is not only displayed as rounded number, but also the numbers are set to E=1.4, and D=5.7 respectively. This can be seen by the following code
var rnozzle = heat.heaters[1].model.heatingRate var k1nozzle = heat.heaters[1].model.coolingRate var k2nozzle = heat.heaters[1].model.fanCoolingRate var dnozzle = heat.heaters[1].model.deadTime var enozzle = heat.heaters[1].model.coolingExp var vnozzle = heat.heaters[1].model.standardVoltage ; echo >"0:/settings/Set-PID-nozzle.g" "M307 H0 R"^{var.rnozzle}^" K"^{var.k1nozzle}^":"^{var.k2nozzle}^" D"^{var.dnozzle}^" E"^{var.enozzle}^" S1.00 B0 V"^{var.vnozzle}^" ; set PID parameters nozzle"
results in
M307 H0 R2.849 K0.645:0.000 D5.7 E1.4 S1.00 B0 V24.1 ; set PID parameters nozzle
This was tested with Duet2 and Duet3Mini5+ running fw 3.5.0 Release Candidate 1.
-
It looks like an issue with numerics. I just cam across another post [(https://forum.duet3d.com/topic/33677/round-variable-to-nth-digit/2)] and gave this code a try
var rnozzle = heat.heaters[1].model.heatingRate var k1nozzle = heat.heaters[1].model.coolingRate var k2nozzle = heat.heaters[1].model.fanCoolingRate var dnozzle = (10.0* heat.heaters[1].model.deadTime) / 10.0 var enozzle = (10.0* heat.heaters[1].model.coolingExp) / 10.0 var vnozzle = heat.heaters[1].model.standardVoltage ; echo >"0:/sys/Set-PID-nozzle.g" "M307 H0 R"^{var.rnozzle}^" K"^{var.k1nozzle}^":"^{var.k2nozzle}^" D"^{var.dnozzle}^" E"^{var.enozzle}^" S1.00 B0 V"^{var.vnozzle}^" ; set PID parameters nozzle"
The output is