2024-04-12 | [3d-printing]
I replaced my toolhead PCB with a CAN bus version some time ago (this one, the EBB SB2240_2209 CAN), but it always had some problem with it because despite having a built in accelerometer, it will fail while doing TEST_RESONANCES
with the error "Timer too close". My best guess is that this is what happens when too much data is trying to be sent down the can bus, so I need to up the baud rate so it doesn't pile up.
Building the micro-controller
with the configuration shown below.STMicroelectronics STM32
STM32G0B1
8KiB bootloader
No bootloader
8 MHz crystal
USB (on PA11/PA12)
CAN bus (on PB0/PB1)
make menuconfig
againSTM32F446
)No bootloader
)12 MHz crystal
)USB to CAN bus bridge (USB on PA11/PA12)
)CAN bus (on PD0/PD1)
)1000000
) CAN bus speed~/klipper/out/klipper.bin
make flash FLASH_DEVICE=0483:df11
will upload the firmware.bin onto the device from the raspberry pi itself. The FLASH_DEVICE is the USB Id from lsusb
make flash
runs, which is sudo dfu-util -d ,0483:df11 -R -a 0 -s 0x8000000:leave -D out/klipper.bin
contents of /etc/network/interfaces.d/can0:
allow-hotplug can0
iface can0 can static
bitrate 1000000
up ifconfig $IFACE txqueuelen 1024
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
scan command.For what it's worth, after the 1000000 upgrade, the accelerometer does work properly.
Late last year, I tried to do some upgrades on the printer. I was having some issues getting the first layer correct, so I upgraded to a Voron TAP kit. In doing so, I got another SD card, to start over with a fresh Klipper installation on the Raspberry Pi, because I could not figure out how to remove the auto z calibration plugin.
The new Klipper install wanted updated firmware on the MCUs, so I did that, and then I started to experience some problems related to the CAN bus. I could not trace it effectively, but I think the problem has to do with the BTT octopus working as a CAN bridge. I am more inclined to believe it is software/firmware related than hardware.
So maybe it is better to use USB instead.
First, I did the previous steps with make menuconfig
and make flash
but changed the settings to use USB instead of the CAN interfaces (not serial, I think this puts the interface on the mcu's UART instead of a USB Serial port).
Then, in the printer.cfg
file, swap over the interface for the MCUs to use a serial port instead of CAN:
[mcu]
## Obtain definition by "ls -l /dev/serial/by-id/" then unplug to verify
##--------------------------------------------------------------------
serial: /dev/serial/by-id/usb-Klipper_stm32f446xx_320034000550314D35323820-if00
# canbus_uuid: 32813f9e77c0
#restart_method: command
##--------------------------------------------------------------------
[mcu can0]
serial: /dev/serial/by-id/usb-Klipper_stm32g0b1xx_1F0029001650425539393020-if00
# canbus_uuid: e291d48ebcaa
Since I didn't feel like running a USB cable through a wiring harness to the toolhead, I thought I would try to run the USB data lines through the two wires that used to carry the CAN bus.
So now, I have a tether with GND, 24V, and USB D+ and D-. Seems to be good so far. After 1 day and printing a fe hours, it seems to work OK.
I got myself one of those 3DO Nozzle Camera V2s. Most of the solutions of this seem to print a new cover for the stealthburner and put the camera right in the middle (exactly where you normally look to inspect the nozzle). They also normally put the USB board behind the part cooling fan, but I have the breakout from the EBB kit there.
A better location seems to be as hung on the ADXL accelerometer mounting point. I used this one for the Minition Camera to get the location close for my camera.
get the step file | get the FreeCAD source
I ran the cable behind the hotend cage. It's not a perfect fit, but the exposed parts of the cable do not seem to be in a position to be crushed by anything.