Welcome! Log In Create A New Profile

Advanced

smoking smiley new firmware: Jagon by Hardtoe

Posted by hardtoe 
Re: smoking smiley new firmware: Jagon by Hardtoe
November 12, 2011 08:00PM
awesome, thanks for bearing with me smiling smiley

Just one more thing: like sjfw, you have a very simple test for 'on target'. There are quite a number of reprappers (including myself) who swear by hysteresis and residency- that is, the actual temperature must be within +/- for seconds before 'on target' is asserted.

This means that if we have a hot-end with overshoot, we can make it wait for the oscillation to settle down, or if we have a bed with the thermistor underneath, we can force firmware to wait long enough for the heat to soak through the top when we send M190. This also deals with noisy thermistors which may false-trigger 'on target' when up to 15c below target.

If you implement this, you may also consider checking if a new target is within old_target +/- hysteresis, so if we change the temperature by 2 degrees (or enter the same one again) it doesn't reset the timeout.


ps: is there a way to change E steps with an M code? Sprinter uses M92 and sjfw uses M200, I use this feature very frequently!


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: smoking smiley new firmware: Jagon by Hardtoe
November 12, 2011 08:53PM
just made these changes, i think they are very useful. i'm going to try and use the same gcodes as Sprinter when i can. i'll add the Sprinter gcodes to change acceleration values as well, it's pretty easy...going to play some BF3 soon though...

latest changes are pushed into github: Heater

temperature hysteresis and min residency times are configurable in the configuration.h file.

I added support for M92 as well.
Re: smoking smiley new firmware: Jagon by Hardtoe
November 12, 2011 09:23PM
ooh I didn't mean for you to use the hysteresis when turning the heater on and off! it'll never settle down like that! I meant more like this:

        currentTemp = 
          tempSensor->getTemp();

        if (currentTemp > MAXTEMP) {
          // error condition! power down!
          targetTemp = 0;
          powerOff();
          sendMessageToHost("heater exceeded safety limit! shutting down...");
        } else

        // average around target + 0.5 rather than target - 0.5 as we lose some heat between heater and nozzle with repraps.
        // Other applications may be better hunting the lower side
        if (currentTemp <= targetTemp) {
          digitalWrite(heaterPin, HIGH);
        } else if (currentTemp > targetTemp) {
          digitalWrite(heaterPin, LOW);
        }

        onTarget = (
                    (currentTemp >= (targetTemp - hysteresisTempRange)) &&
                    (currentTemp <= (targetTemp + hysteresisTempRange))
                   );
        
        if (onTarget) {
          if (!hasMinResidence) {
            tempResidence++;
            
            if (tempResidence > minResidenceTime) {
              hasMinResidence = true;
            }
          }
        }
        else {
           // reset timeout if we stray out of the hysteresis range
           hasMinResidence = false;
           tempResidence = 0;
        }


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: smoking smiley new firmware: Jagon by Hardtoe
November 12, 2011 09:31PM
i see, that makes more sense...

i've incorporated most of what you wrote, but i don't yet have a machine halt mechanism, so i just clamp the max temp to MAXTEMP for now.

EDIT: my house thermostats are powered by arduinos...so for some reason i was thinking of the same kind of hysteresis that a furnace or AC unit needs winking smiley

Edited 1 time(s). Last edit at 11/12/2011 09:49PM by hardtoe.
Sorry, only registered users may post in this forum.

Click here to login