Hotbed Mosfet configuration.h code

Can you please assist with the configuration.h code for the following issue?

I have recently needed to replace the Mosfet chip for my Tevo Tarantula hotbed, but because I was not able to get the exact same Mosfet as the original, I replaced with a generic smaller capacity chip but added in a relay to direct current to the hotbed directly from the PSU, controlled by the new Mosfet chip, instead of directing the current through the motherboard.

Problem is that the new Mosfet and relay are so sensitive that the Mosfet literally chatters as it is switching on and off updating the hotbed temperature.

I need to change the configuration.h to either widen the temperature checking range of the hotbed Mosfet or I need to lengthen the time between each temperature verification that the Mosfet does of the hotbed.

Cab you assist with the configuration.h code that needs to be changed to accommodate this?

Comments

  • The relay is chattering because you are probably using PID temp control, change the temperature control to use 'bang bang for bed with relay'

  • You might even use bang bang with reduced frequency especially if using a mechanical relay and not a SSR.
  • Thank you very much guys

    As I am a total novice when it come it altering the configuration.h code, would you please be so kind to have a look at the attached file and tell me exactly which lines must be commented, uncommented and which must be changed.

    I really appreciate your assistance.



    //===========================================================================
    //============================= PID Settings ================================
    //===========================================================================
    // PID Tuning Guide here: http://reprap.org/wiki/PID_Tuning

    // Comment the following line to disable PID and enable bang-bang.
    #define PIDTEMP
    #define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
    #define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
    #if ENABLED(PIDTEMP)
      //#define PID_AUTOTUNE_MENU // Add PID Autotune to the LCD "Temperature" menu to run M303 and apply the result.
      //#define PID_DEBUG // Sends debug data to the serial port.
      //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
      //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
      //#define PID_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders)
                                      // Set/get with gcode: M301 E[extruder number, 0-2]
      #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
                                      // is more than PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
      #define K1 0.95 //smoothing factor within the PID

      // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
      // Ultimaker
      #define  DEFAULT_Kp 22.2
      #define  DEFAULT_Ki 1.08
      #define  DEFAULT_Kd 114

      // MakerGear
      //#define  DEFAULT_Kp 7.0
      //#define  DEFAULT_Ki 0.1
      //#define  DEFAULT_Kd 12

      // Mendel Parts V9 on 12V
      //#define  DEFAULT_Kp 63.0
      //#define  DEFAULT_Ki 2.25
      //#define  DEFAULT_Kd 440

    #endif // PIDTEMP

    //===========================================================================
    //============================= PID > Bed Temperature Control ===============
    //===========================================================================
    // Select PID or bang-bang with PIDTEMPBED. If bang-bang, BED_LIMIT_SWITCHING will enable hysteresis
    //
    // Uncomment this to enable PID on the bed. It uses the same frequency PWM as the extruder.
    // If your PID_dT is the default, and correct for your hardware/configuration, that means 7.689Hz,
    // which is fine for driving a square wave into a resistive load and does not significantly impact you FET heating.
    // This also works fine on a Fotek SSR-10DA Solid State Relay into a 250W heater.
    // If your configuration is significantly different than this and you don't understand the issues involved, you probably
    // shouldn't use bed PID until someone else verifies your hardware works.
    // If this is enabled, find your own PID constants below.
    //#define PIDTEMPBED

    //#define BED_LIMIT_SWITCHING

    // This sets the max power delivered to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
    // all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
    // setting this to anything other than 255 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
    // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
    #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current

    #if ENABLED(PIDTEMPBED)

      //#define PID_BED_DEBUG // Sends debug data to the serial port.

      //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
      //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
      #define  DEFAULT_bedKp 10.00
      #define  DEFAULT_bedKi .023
      #define  DEFAULT_bedKd 305.4

      //120V 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
      //from pidautotune
      //#define  DEFAULT_bedKp 97.1
      //#define  DEFAULT_bedKi 1.41
      //#define  DEFAULT_bedKd 1675.16

      // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
    #endif // PIDTEMPBED

    // @section extruder

    // This option prevents extrusion if the temperature is below EXTRUDE_MINTEMP.
    // It also enables the M302 command to set the minimum extrusion temperature
    // or to allow moving the extruder regardless of the hotend temperature.
    // *** IT IS HIGHLY RECOMMENDED TO LEAVE THIS OPTION ENABLED! ***
    #define PREVENT_COLD_EXTRUSION
    #define EXTRUDE_MINTEMP 170

    // This option prevents a single extrusion longer than EXTRUDE_MAXLENGTH.
    // Note that for Bowden Extruders a too-small value here may prevent loading.
    #define PREVENT_LENGTHY_EXTRUDE
    #define EXTRUDE_MAXLENGTH 200



  • That config is not from repetier-firmware, so you are here at the wrong address.
Sign In or Register to comment.