Heat bed output options

Basic Information:

Printer Model:
MCU / Printerboard:
Host / SBC
klippy.log

Fill out above information and in all cases attach your klippy.log file (use zip to compress it, if too big). Pasting your printer.cfg is not needed
Be sure to check our “Knowledge Base” Category first. Most relevant items, e.g. error messages, are covered there

Describe your issue:

…hello I’m building a large format printer with 6 heating pads I have a separate controller to control the pads in way to evenly heat up table and not to overload the input power looking for a simple way to link klipper to a plc? thinking a simple on off output and use the temp setting to send out a pwm for temp setting for example C60 would output 60Hz ,C100 100Hz this way my controller can control the temp by a setting and on off no just on off so is there a way to output temp setting in Hz

Couldn’t you assign a GPIO pin as an LED. Write a macro to intercept M140 and set led PWM as you see fit.
[led] configuration

The hard part is going to be getting bed temperature to show in the UI.

Hi @atvracer ,

What you could do is configure a [pwm_cycle_time] and use the SET_PIN PIN=x VALUE=1 CYCLE_TIME=x command.

Much better than my solution.

1 Like

Awesome thank you I’ll try that when I get home , I do have a temp sensor in the middle of the table so klipper and I can monitor it from that side

1 Like

sorry I’m new programing klipper i got the PWM to work by adjusting the Miscellaneous section on the dashboard 0-100% but i cant get the Heater Bed to adjust the pwm i can use 0-100% or C=HZ ether is fine

can you show me example of Heater_bed would look like

Thanks

[heater_bed]
heater_pin: Cubic:gpio7
sensor_pin: PB1
sensor_type: EPCOS 100K B57560G104F
control: watermark
min_temp: 0
max_temp: 120
pwm_cycle_time: .3

Hi @atvracer ,

You wouldn’t use a heater_bed config section with the pwm approach. You would setup a pwm_cycle_time section with the link I previously provided and control it with GCode commands.

Thanks this got in the right direction and I got it working

1 Like

If this is solved, please mark one of the posts here as the solution so other people know the issue is resolved.

ok i went into a deep hole still needs work and testing but this is what i have so far my plc will use the Cubic:gpio7 to turn on-off Cubic:gpio8 will set the temp to the plc so the plc has a reference and the plc will adjust all 6 heating pads independently and balance the temp. sensor temp-1 to 6 just to monitor the bed on the klipper screen and PB1 is what klipper will monitor

 #############################
#  PLC control 
##############################

[output_pin secondary_heater_pwm]
pin: Cubic:gpio8 
pwm: True
value: 0.5
shutdown_value: 0
cycle_time: 0.1 

[gcode_macro UPDATE_HEATER_PWM]
gcode:
    {% set bed_temp = printer.heater_bed.temperature %}
    {% set target_temp = printer.heater_bed.target %}

    
    {% if bed_temp > 0 and target_temp > 0 %}
        
      
       {% set power_level = [target_temp / 100, 1.0]|min %}    # {% set power_level = [bed_temp / 100, 1.0]|min %}
        SET_PIN PIN=secondary_heater_pwm VALUE={power_level}
        #M117 PWM set to {power_level * 100}%
    {% else %}
        # Turn the output pin off if the bed heater is off
        SET_PIN PIN=secondary_heater_pwm VALUE=0
        #M117 PWM is off
    {% endif %}

[delayed_gcode update_pwm_continuously]
initial_duration: 1.0 # Run once after 1 second of boot
gcode:
  UPDATE_HEATER_PWM
  UPDATE_DELAYED_GCODE ID=update_pwm_continuously DURATION=5.0 # Repeat every 5 seconds


####################################################


[heater_bed]
heater_pin: Cubic:gpio7
sensor_pin: PB1  
sensor_type: EPCOS 100K B57560G104F
control: watermark
min_temp: 0
max_temp: 130

######################################################

[temperature_sensor BED_1]

sensor_type: EPCOS 100K B57560G104F
sensor_pin: PB0
min_temp: 0
max_temp: 130

[temperature_sensor BED_2]

sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
max_temp: 130
min_temp: 0


[temperature_sensor BED_3]

sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC4
max_temp: 130
min_temp: 0


[temperature_sensor BED_4]

sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA7
max_temp: 130
min_temp: 0


[temperature_sensor BED_5]

sensor_type: EPCOS 100K B57560G104F
sensor_pin:Cubic:gpio26
max_temp: 130
min_temp: 0



[temperature_sensor BED_6]

sensor_type: EPCOS 100K B57560G104F
sensor_pin:Cubic:gpio27
max_temp: 130
min_temp: 0

  

1 Like