What's new
VORON Design

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members!

Beep on fixed frequency after upgrade to CAN

mime

New member
I'm running a Trident I built from a Formbot kit one year ago. Recently, I upgraded the toolhead to CAN bus using a BTT SB2209. My Mainboard is a BTT Octopus F446. I have a BEEP macro in my config like this:

Code:
[gcode_macro BEEP]
gcode:
    # Parameters
    {% set i = params.I|default(1)|int %}           ; Iterations (number of times to beep).
    {% set dur = params.DUR|default(100)|int %}     ; Duration/wait of each beep in ms. Default 100ms.
    {% set freq = params.FREQ|default(2000)|int %}  ; Frequency in Hz. Default 2kHz.

    {% for iteration in range(i|int) %}
        SET_PIN PIN=beeper VALUE=0.8 CYCLE_TIME={ 1.0/freq if freq > 0 else 1 }
        G4 P{dur}
        SET_PIN PIN=beeper VALUE=0
        G4 P{dur}
    {% endfor %}

SoBEEP I=1 DUR=200 FREQ=440 would produce a 440 Hz beep. I use this to play a short melody when a print starts and ends. The beep is produced using the Mini12864's integrated beeper. It is defined like this:

Code:
[output_pin beeper]
pin: EXP1_1
value: 0
shutdown_value: 0
pwm: True
cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz)

This was working fine for a year, but since the CAN upgrade it does not produce different frequencies anymore, so a
BEEP I=1 DUR=200 FREQ=440 sounds exactly like a BEEP I=1 DUR=200 FREQ=880

This could be some side effect of the CAN upgrade, but I don't have an idea right now how to debug this. Maybe the reason is somewhere else, because during the CAN upgrade I also updated all software components to the latest versions and re-flashed klipper. Does someone have an ideo how I can restore the old behaviour?
 
Thank you! That was the reason. For reference, changing the config section of the pin to this solved the problem:

Code:
[pwm_cycle_time beeper]
pin: EXP1_1
value: 0
shutdown_value: 0
cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz)
 
If you recently updated Klipper, this commit is probably why: https://github.com/Klipper3d/klipper/commit/fd2feff67df65c559cafc8fc5f2fd8601355e81a

See https://www.klipper3d.org/Config_Changes.html for the changes marked as 20240123
Thanks for your help !!! Very useful ! Finally have my favorite movie tune at startup :cool:
"Close Encounters of the Third Kind"
gcode:
M300 P491 S784
M300 P504 S880
M300 P496 S698
M300 P504 S349
M300 P1500 S523

if you like... enjoy!!
 
Top