   if (pidUpdateTimeLeft < 0)
   {
     pidDrive = updatePID(&pid, getErr(), getPos());
-    heaterDutyCycle = tempChangeToDuty(pidDrive * tempRiseTarget);
+//    heaterDutyCycle = tempChangeToDuty(pidDrive * tempRiseTarget);
+    heaterDutyCycle = constrain(pidDrive, 0, 1);
     pidUpdateTime = millis() + PID_UPDATE_PERIOD_MS;
     
     DEBUG2(F("pidDrive        = "), pidDrive);

  return min(1.0, max(0.0, tempChange * TEMP_TO_DUTY_SLOPE + TEMP_TO_DUTY_OFFSET));
}

void heaterOn()
{
	digitalWrite(HEATER_PIN, HIGH);

void loop()
{
  sampleTimeLeft = sampleTime - millis();
  printTimeLeft = printTime - millis();
  pidUpdateTimeLeft = pidUpdateTime - millis();
  heaterOnTimeLeft = heaterOnTime - millis();
  heaterPeriodTimeLeft = heaterPeriodTime - millis();
