Daemon Pausing During G1/G0 Linear Move
-
Hello all,
I have a very peculiar issue where my daemon.g doesn't run during a G1 move.
var readoutTime = 0 var readoutDelay = 2500 var trimDelay = 250 if !exists(global.PID) global PID = 1 ;fake PID. This is subtracted from the cutoff temperature as the lower turn-on temperature while(true) if (1000 * state.upTime) + state.msUpTime > var.readoutTime + var.readoutDelay ;if millis is more than previous millis plus delay set var.readoutTime = (1000 * state.upTime) + state.msUpTime ;set the previous millis echo "Brightness: " ^ global.brightness echo "COBs_on is : " ^ global.COBs_on if global.COBs_on if move.axes[2].machinePosition != move.axes[2].min && move.axes[2].userPosition != move.axes[2].min set global.COBs_on = false echo "LID NOT DOWN" else M106 P0 S1 M106 P1 S{global.brightness} if (sensors.analog[0].lastReading > global.cutoffTemp) && (state.gpOut[0].pwm > 0) ;if pwm on and over temp echo "Warning: Over temperature" M42 P0 S0 set global.brightness = global.brightness - 1 ;trim brightness by 1 pwm unit if (sensors.analog[0].lastReading < global.cutoffTemp - global.PID) && (state.gpOut[0].pwm = 0) ;if pwm off and undertemp, unkill echo "Turning COBs ON" M42 P0 S1 else if sensors.analog[0].lastReading > 40 M106 P0 S1 elif sensors.analog[0].lastReading > 30 M106 P0 S0.5 else M106 P0 S0.2 M42 P0 S0 G4 P{var.trimDelay}
Points to note are that I have a +400W LED array that I am switching while the linear rail is at its minimum position (It's basically a big lid). I'm using the daemon to poll a global variable 'COBs_on' and regulate the temperature by trimming the PWM. The PCB can get to 70°C at 85% duty! My main concern that if I accidentally send a G1 command, the lid opens up and the room is flooded with light.
To mitigate this, in line 14-16 I check for both user position and machine position and if either one is not at the absolute bottom, it sets the COBs_on flag to false. Now, this should work with move.axes[2].machinePosition, but I've noticed that the daemon only starts again until the lid is at the top of its travel...
Naturally, is there something I'm missing concerning the daemon? Is there a way of re-writing the G1.g command such that it switches the flag to false whenever a G1 command is called?
"echo move.axes[0].machinePosition" over console returns the previous position until the move finishes also, so it's not just the daemon that gets paused I feel.
Any help would be greatly appreciated
~ Q -
@Quadracycle4000 What version of RRF are you using? I've just check with 3.5.1 and machinePosition seems to be getting updated during a move (I think userPosition is only updated at the end of a move).
-
@gloomyandy I'll have a look later today. It's somewhere within 3.4.x, and I can't update it easily because it has been built within a device binary.
I have a device running 3.5.x and yes the user position is updated to the next move / target position in the move queue.