Alex Voinea 4 anni fa
parent
commit
b86aafb56e
1 ha cambiato i file con 8 aggiunte e 2 eliminazioni
  1. 8 2
      Firmware/heatbed_pwm.cpp

+ 8 - 2
Firmware/heatbed_pwm.cpp

@@ -45,6 +45,12 @@
 // If there are any change requirements in the future, the signal must be checked with an osciloscope again,
 // ad-hoc changes may completely screw things up!
 
+// 2020-01-29 update: we are introducing a new option to the automaton that will allow us to force the output state
+// to either full ON or OFF. This is so that interference during the MBL probing is minimal.
+// To accomplish this goal we use bedPWMDisabled. It is only supposed to be used for brief periods of time as to
+// not make the bed temperature too unstable. Also, careful consideration should be used when using this
+// option as leaving this enabled will also keep the bed output in the state it stopped in.
+
 ///! Definition off finite automaton states
 enum class States : uint8_t {
 	ZERO_START = 0,///< entry point of the automaton - reads the soft_pwm_bed value for the next whole PWM cycle
@@ -95,7 +101,7 @@ ISR(TIMER0_OVF_vect)          // timer compare interrupt service routine
 {
 	switch(state){
 	case States::ZERO_START:
-		if (bedPWMDisabled) return;
+		if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin
 		pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit!
 		if( pwm != 0 ){
 			state = States::ZERO;     // do nothing, let it tick once again after the 30Hz period
@@ -139,7 +145,7 @@ ISR(TIMER0_OVF_vect)          // timer compare interrupt service routine
 		break;
 	case States::ONE:             // state ONE - we'll either stay in ONE or change to FALL
 		OCR0B = 255;
-		if (bedPWMDisabled) return;
+		if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin
 		slowCounter += slowInc;   // this does software timer_clk/256 or less
 		if( slowCounter < pwm ){
 			return;