Welcome! Log In Create A New Profile

Advanced

Heated bed or Chamber PWM - set as inverted , but pins are high on reset (0C). How to set condition for PWM to be pulled Low after reset (0C) ?

Posted by lukaari 
Hello,

I am using Marlin dev-2.1.x

Heated bed and Chamber PWM pins are in configuration are set as inverted due to outside drivers requirements. Printer work and I must have those pins as inverted.

This configuration has one problem: After the reset when all temperatures are reset to (0C) and both of the PWM output pins are set to High.

It will be very convenient if those pins (set as inverted in config files) to have additional option where we can add condition that , while reset , or set temperature = 0 those pins should be pulled Low.

Can anybody help with configuration or C++ code to solve his problem ?

Thank you,
The mosfet pins are normally set to low in the bootloader, to get them into the 'correct' state as soon as possible.

I would strongly advise you find a hardware solutions to invert your PWM pin back to standard.
I understand that, but i need chamber to be cooled - mean opposite to the current operation - with out going to the software in the configuration I set chamber heater to be inverted - it work fine. When chamber set target temperature is < then chamber temperature pin high and when chamber target set temperature is > then chamber pin is low - all this work fine. But there is one problem : on the reset all heaters are reset to 0 and output pin is set high due to the inverted operation I set in configuration file. I can easily solve that problem electronically but I think that can be solved in software. Maybe inserting the conditional statement : When target temperature is set to 0 chamber drive pin that pin High which will translate to be Low on the output. All other condition will be control by the control loop.

I know even this is very crude solution and issue can be done very nicely in the compere part of the software - but I don't speak C++ and I can't pin point that location in the software yet.

For the testing purposes I disable all the protections in the configurations files and play with compare parameters >< -+ in the file marlin crc modules -- file temperature.c++ file and nothing work.

I will be very happy if anybody can locate that location in the program and i will do the rest.



#if WATCH_CHAMBER
/**
* Start Heating Sanity Check for chamber that is below
* its target temperature by a configurable margin.
* This is called when the temperature is set. (M141, M191)
*/
void Temperature::start_watching_chamber() {
if (degChamber() < degTargetChamber() - (WATCH_CHAMBER_TEMP_INCREASE + TEMP_CHAMBER_HYSTERESIS + 1)) {
watch_chamber.target = degChamber() + WATCH_CHAMBER_TEMP_INCREASE;
watch_chamber.next_ms = millis() + (WATCH_CHAMBER_TEMP_PERIOD) * 1000UL;
}
else
watch_chamber.next_ms = 0;
use a separate cooling controller.
makes it much easier than messing arround in the source code.
Sorry, only registered users may post in this forum.

Click here to login