M116 appears to be not working
-
This is my shutdown macro but the M116 is not working so the macro completes still with the hot end hot.
I am using the latest firmware 3.01-RC2M291 P"Shutdown Started" R"Shutdown" S1 T0; Display message
echo "Extruder temperature = " ^ heat.heaters[1].current
if heat.heaters[1].current > 35
M98 P"0:/macros/Set LED Green"
echo "LED Green on "
M291 P"Waiting for nozzle to cool" R"Shutdown"; Display message
M106 P1 S255 ;set cooling fan to maximum
M104 S35 ;reduce extruder heater to safe level
;G10 P0 S35 ; reduce extruder heater to safe level
M116 :wait for set temperature
echo "Extruder temperature should be 35 = " ^ heat.heaters[1].current
G4 P2000
echo "G4 Dwell set to 2000 milliseconds "M104 S0 ;reduce extruder heater to zero
;G10 P0 S0 ;reduce extruder heater to zero
M106 P1 S0 ;set cooling fan to zero
echo "Extruder heater set to 0 "
M291 P"Shutdown Completed" R"Shutdown"; Display message
M0 -
If you set a heater to 40C or below then M116 doesn't wait for it, because it might never get there.
If you really want to wait for 35C then you could use conditional GCode:
M104 S0 while heat.heaters[1].current > 35 G4 S1
-
thanks, that worked great
-
On more testing I noticed that as soon as M106 P3 is called the fans[3].actualValue is 1.0
So the LED is at max brightness and stays there.
If I run the macro a second time it works. I tried to put M106 P3 S0 to start but that didn't work either.
this is the logRun2
LED Red Requested value = 0.60
LED Red Actual value = 0.6
24/02/2020, 12:10:42
LED Red Requested value = 0.50
LED Red Actual value = 0.5
24/02/2020, 12:10:40
LED Red Requested value = 0.40
LED Red Actual value = 0.4
24/02/2020, 12:10:39
LED Red Requested value = 0.30
LED Red Actual value = 0.3
24/02/2020, 12:10:39
LED Red Requested value = 0.20
LED Red Actual value = 0.2
24/02/2020, 12:10:37
M98 P"0:/macros/Set LED Red"
Initial LED Red Actual value = 0.1Run1
24/02/2020, 12:10:24
M98 P"0:/macros/Set LED Red"
Initial LED Red Actual value = 1.0This is the macro
M106 P3 S0
echo "Initial LED Red Actual value = " ^ fans[3].actualValue
while fans[3].actualValue < 0.6
M106 P3 S{fans[3].actualValue + 0.1}
G4 S1 ;Wait for 1 second
echo "LED Red Requested value = " ^ fans[3].requestedValue
echo "LED Red Actual value = " ^ fans[3].actualValue -
Try testing requestedValue instead of actualValue. The actualValue may take a short while to catch up with requestedValue.
-
Thanks,
That worked so that I only needed 1 run, but it still started with a value of 1 (Full Brightness)
24/02/2020, 14:07:24
LED Red Requested value = 0.60
LED Red Actual value = 0.6
24/02/2020, 14:07:22
LED Red Requested value = 0.50
LED Red Actual value = 0.5
24/02/2020, 14:07:21
LED Red Requested value = 0.40
LED Red Actual value = 0.4
24/02/2020, 14:07:20
LED Red Requested value = 0.30
LED Red Actual value = 0.3
24/02/2020, 14:07:19
LED Red Requested value = 0.20
LED Red Actual value = 0.2
24/02/2020, 14:07:18
LED Red Requested value = 0.00
LED Red Actual value = 0.1
24/02/2020, 14:07:17
M98 P"0:/macros/Set LED Red"
Initial LED Red Actual value = 1.0 -
If you don't run that macro, is the fan/LED output off or on to start with?
-
@dc42 The fan/LED output is OFF to start but as soon as I run the macro the LED is very bright and then drops to the first increment 0.10.
Its almost as if the output blips to full power from idle, perhaps to aid actual fans to start quicker.25/02/2020, 10:59:04 Red LED Requested value = 0.10 Red LED Actual value = 0.1
25/02/2020, 10:59:03 M98 P"0:/macros/Set LED Red" Initial LED Red Actual value = 0.0 -
@appjaws said in M116 appears to be not working:
Its almost as if the output blips to full power from idle, perhaps to aid actual fans to start quicker.
It's exactly that. See the M106 B parameter.