Secondary MCU for the print head

I was thinking about putting an MCU on the print head, so that it only needs power and data lines rather than the bundle of 11 wires that it currently has.
The multi-MCU capability of Klipper ought to make this easy, but I’ve fallen at the first hurdle because I can’t see how to create the firmware for the second MCU, and I also don’t see how to connect the second MCU to the printer.

Sorry, I imagine this is a daft question to anybody who has a clue what they’re doing…

1 Like

There is a project for a Toolhead board already going. You can see it on GitHub

2 Likes

Interesting, but use a Bowden myself, so that one looks to be a lot more complicated than I was thinking… maybe I just wasn’t thinking clearly?

Well, you don’t need to use the Stepper on the board if you’re using a Bowden. But at that point, it becomes a bit less interesting. One of the reasons I didn’t make my printer with a direct driver was the added weight to the carriage, but now with extruders like the Orbiter and Sherpa and a CAN board like this, it becomes really appealing.

You could also use a small arduino like a Beetle or Seeduino and a mosfet if you’re not using a driver on your carriage.

Yes, that was what I was thinking, but I’m still stuck on this:

You build firmware for secondary MCUs just as you would for the primary MCU, using menuconfig. You would need to configure it to support your board, then flash it using make flash assuming your board has a supported bootloader.

The secondary MCU connects to the host (usually a Raspberry Pi) via USB (or CAN, but it seems you don’t want to go that route). Then you configure the MCU in printer.cfg. There is a sample multi-mcu in the repo.

That’s what I thought, but there are fairly limited options for the microcontroller in menuconfg: how can I add others?

It isn’t that I don’t want to use CAN, it’s just that I don’t know it. Can CAN run from the printer mainboard to the secondary MCU, or does it need to come from the host?
I wondered also about WiFi, but that’s probably not sensible.

That’s what I thought, but there are fairly limited options for the microcontroller in menuconfg: how can I add others?

Klipper supports quite a few MCUs. Atmel AVR, Atmel SAM, STM32, NXP lpc176x, etc. Go through the various architecture and model menus to see them all. If your MCU is not in there then then new code would be required.

It isn’t that I don’t want to use CAN, it’s just that I don’t know it. Can CAN run from the printer mainboard to the secondary MCU, or does it need to come from the host?

It needs to run to the host. See the documentation for requirements and details.