Automatic power supply management
-
@dc42 Hi ! just wanted to know if it was a bit of news about that ?
-
As you are the only person who has asked for this, i think it would be best implemented using the daemon.g file that is supported in RRF 3.01-RC5 and later. Let me know if you need any additional object model variables in order to implement it.
-
@Krohm-Koala oh I see i'll search about daemon.g thanks
-
@dc42 is there an object model variable for the state of the power supply ? Also as i'm totally noob in this type of programmation, can't do anything, as everything i try turns to nothing ^^ i'll just continue as it is and deal with it i think ^^ thanks anyway
-
@Krohm-Koala said in Automatic power supply management:
@dc42 is there an object model variable for the state of the power supply ? Also as i'm totally noob in this type of programmation, can't do anything, as everything i try turns to nothing ^^ i'll just continue as it is and deal with it i think ^^ thanks anyway
There is a special status "off" which means that VIN power is not present. That's what you should get when you turn off VIN power. Alternatively, you can retrieve the VIN voltage directly.
There is not currently an object model value to say what the state of PS_ON is according to the last M80 or M81 command. Do you need one? -
Correction to above: there is a variable that says whether PSON on or off, only available if there has been a M80 or M81 command since reset. It's called state.atxPower.
-
oh cool ! maybe i'll try something do you think there's a way to automatically turn on psu when an heater need power ? I think there's the only thing i want the most to do, for the other things i needed it at the beginning i overcome with M80 almost everywhere
-
Also, how do you get the status of VIN or VIN voltage to do meta code ? Maybe easier than state.atxPower to be sure there's no false positive or can be using directly at the reset ? Or maybe i can add M81 at the end of my config.g to be sure it's ok since the reset
-
@Krohm-Koala said in Automatic power supply management:
oh cool ! maybe i'll try something do you think there's a way to automatically turn on psu when an heater need power ? I think there's the only thing i want the most to do, for the other things i needed it at the beginning i overcome with M80 almost everywhere
I'm not sure it will work because of the lag, but in your loop in daemon.g, if power is off you could iterate over the heaters and turn on the power if any target temperature is above 45C.
@Krohm-Koala said in Automatic power supply management:
Also, how do you get the status of VIN or VIN voltage to do meta code ? Maybe easier than state.atxPower to be sure there's no false positive or can be using directly at the reset ? Or maybe i can add M81 at the end of my config.g to be sure it's ok since the reset
07/04/2020, 16:47:43 echo boards[0].vIn.current 24.5
Yes you can use M80 or M81 in config.g.
-
@dc42 said in Automatic power supply management:
I'm not sure it will work because of the lag, but in your loop in daemon.g, if power is off you could iterate over the heaters and turn on the power if any target temperature is above 45C.
I think i'll try something like that ^^ just need to find how to check if the target temp is above some °C and it should be ok it'll be funny to try something like that as i'm a complete noob in coding, i had done an auto change filament script, i think i can do that too
-
Cant validate my code for now as i'm printing but, here is the code if you want to look at it i hope it'll work
if boards[0].vIn.current < 23
....if tools[0].active > 100
........M80
........break
....else
........break
....else
........break -
So, i made some tests, this is the final version, better and also, look for the head temp or the bed
while boards[0].vIn.current < 23
....if tools[0].active[0] >= 100 || heat.heaters[0].active >= 40
........M80
........break
....else
........break