Jump to content

Voron 0.2, Picobilical and CANBUS


YaaJ

Recommended Posts

I'm thinking of replacing the 14-wire umbilical with a 4-wire one : Canbus...

The printer being a LDO kit, it came with the Picobilical. I'm happy with it, except for the accelerometer and its nasty flat printed cable, even after I broke out the 4-pin connector into the chamber and can use a 20 cm cable instead of the 1 meter FPC cable that came with the kit, and even if I don't have to open the electronics compartment anymore. These tiny connectors are a pain in the back !

But I'm also happy with the RPi 5V power, looking better than the SKR Pico supply (maybe I'm wrong), and the two Neopixel channels are really handy.

I had an idea... On the Picobilical breakout board, we have two Molex Microfit connectors. a 2x7 one for the umbilical, and a 4 pin one that is just a passthrough for the E-motor (don't really understand why, as it is also on the umbilical - maybe for a Bowden extruder ?).

I have a EBB36 I got for the 2.4 (work in progress...), and a U2C.

First of all, the U2C is too large, it would be difficult to fit...

After watching this video :

 

I had an idea. Keeping the Picobilical breakout board, and repurposing the 2x7 connector + cable : no crimping (I have half a dozen of crimping tools, none for Molex). We need GND and +24V : they are on the connector. We need H and L signals : they could reuse two of the stepper wires (they are just passthrough). Using GND, HEATER+ for +24V (Heater+ being 24V on the SKR Pico), and B1/B2 for CAN, the 4 wires are there !
Convenient : 4 adjacent pins, exactly in the middle of a row !
Then just have to remove the unused wires, and make the 4-pin connector on the EBB side. Nice 14 to 4 umbilical. Neat.

Picobilical.PNG.436979998bd1c602b3a9350f98e9d319.PNG

Then we need a "something to CANBUS bridge". In the video, it is the SKR Pico with a serial (UART) to CAN : a tiny and inexpensive sn65HVD230 module. Meaning everything would go over the SKR Pico USB virtual serial port.

- is this topology known good ? In terms of bandwidth (thinking of the accelerometer...). I'd also prefer (just prefer...) be using one of the USB 2.0 ports on the Pi 4, not a 3.0
- I don't have a Molex Microfit pin extractor. In fact I had one long ago : it broke at the first use. I've seen some workarounds and printable tools. Any suggestion ?

For example :

https://www.printables.com/fr/model/394113-molex-microfit-30-extractor-using-staplers-din-246

[EDIT] after some readings, it seems the SN65HVD230 is not a good choice : many communication errors due to undersized Tx and Rx buffers ?

 

 

Edited by YaaJ
Link to comment
Share on other sites

Yes, exactly.

Forgot to ask... Not using the first SPI port on the Pi anymore for the accelerometer, why not a SPI -> CAN bridge ? This way, data wouldn't have to go over USB + MCU for the EBB.

Playing with STM32 Bluepills and RPi, I have been using a 24 MHz SPI clock (DMA on the STM32, C++ on the Pi). By using, I mean on a real thing I've been using every day (a 12864 emulator for displaying Marlin on the OctoPi HDMI display). Problems were happening beyond 28MHz, probably on the STM32 side.

If someone says SPI isn't fast enough, it's because of Python. Hardware can do it more than easily.

There are very few examples with SPI to CAN, and didn't see any printer.cfg example.

(the best way to make me do something is to tell me not to do it 🤣 )

  • Like 1
Link to comment
Share on other sites

I've recently completed the switch from picobilical to canbus and it feels great!

There is plenty of spcace on the back, I've managed to neately fit RPi 3, SKR Pico, Mellow UTOC and Klipper Expander. And the only reason I was able to do this is because CanBus frees so much space by simplifying all the wiring. (I've uploaded the mounting clips to printables)

Here is how it looks in the end:

On the other hand, if you don't want to buy UTOC module and save some money, it is possible indeed to use SKR Pico as a CanBus bridge. But then you lose the UART port, which is quite helpful to power the Pi and the setup is quite fiddly! I've managed to make it work on the other printer, where I used the BTT Pi and UART port was available.

IMG_0763.jpeg

IMG_0788.jpeg

  • Like 2
Link to comment
Share on other sites

Oh thanks !

Wasn't taking into account all the wires that can be removed, and didn't think of mounting the U2C vertically !

Just have to remove the duct, redisign my custom bracket and add straps for a couple of zip ties to . Had a look to the UTOC, looks very similar to the BTT U2C. They seem to have the same footprint and holes spacing.

About SPI to CAN : bad option ; didn't remember where I read about buffers, it's there :  https://github.com/bondus/KlipperToolboard/blob/master/doc/canbus.md

Anyway, will experiment with UART to CAN on the SKR Pico, because it requires very minor modifications (only wiring). The 0.2 currently is in use for the 2.4, and can't take it apart for now. If you look at the Keystone modules (third picture), you will see that I just have to plug a external USB cable between the Pi et the SKR Pico, and make a flying UART to CAN adapter cable with such a module :

71s38cyr-RL._AC_SL1500_.jpg.2b3c2ac4cdbbac7e94d33d309b61a55d.jpg

 

There's room for a vertical U2C (or UTOC...) after removing the duct :

 

20230827_034040.thumb.jpg.2e3faddac586278ba5e3fbf974cf6cfc.jpg

 

Picture taken before two RGB cables, a Picam and a DSI touchscreen were added (2x 3 wire cable + 2x FPC cables)

 

layout.jpg.634e9ef275111dfbe7140ba037d4d57f.jpg

Now, the only problem to solve is removing contacts from Microfit connectors... The LDO cables are great because they are made of PTFE (and also copper...), already crimped, and have the perfect length)

 

Edited by YaaJ
  • Like 1
Link to comment
Share on other sites

Received the UART -> CAN module. Really small, it can be made even smaller. No need for the screw terminal, and no need for the pin headers. The PCB will be trimmed. It can be as small as 31mm x 10.5mm x 3.5mm (just removing the terminal, the pin headers and doing some soldering). Inline with wires, in a heat shrink, it will be smaller than a USB A connector.

Unfortunately, the UART pinout does not match the SKR Pico. +Vcc and GND do match each others, but would RX face Rx and Tx would face Tx. Will not be a piggyback PCB.

The silkscreen says "3V3", but the IC datasheet says "max 6V".

It seems to me I read somewhere, maybe on the Klipper forum, that such a topology could lead to problems while measuring vibrations. Depending on the microsteps, the USB could be a bottleneck (?).

DSC00481.JPG.3d3363b1992995a0c57c4f222d7d64c6.JPG

Link to comment
Share on other sites

  • 3 months later...
On 10/17/2023 at 10:24 AM, YaaJ said:

Yes, exactly.

Forgot to ask... Not using the first SPI port on the Pi anymore for the accelerometer, why not a SPI -> CAN bridge ? This way, data wouldn't have to go over USB + MCU for the EBB.

Playing with STM32 Bluepills and RPi, I have been using a 24 MHz SPI clock (DMA on the STM32, C++ on the Pi). By using, I mean on a real thing I've been using every day (a 12864 emulator for displaying Marlin on the OctoPi HDMI display). Problems were happening beyond 28MHz, probably on the STM32 side.

If someone says SPI isn't fast enough, it's because of Python. Hardware can do it more than easily.

There are very few examples with SPI to CAN, and didn't see any printer.cfg example.

(the best way to make me do something is to tell me not to do it 🤣 )

Why use CAN?   I think you'd do better with a USB cable directly from the Pi to the print head.   New USB-C cable can deliver quite a lot of power, up to about 200W, more than enough to run a hot end.  USB is faster too.   From Klipper's point of via the board in the print head is just another MCU.   All you need in the printhead PCB is an RP2040 chip, a TMC2209 chip and a MOSFET to switch the hot end heater.  The RP2040's built-in ADC might be good enough for the thermistor.     The RP2040 can directly connect to an accelerometer over SPI and drive neopixels too.     It is basically a dual-core STM32 M0+.  I had a look at the Kipller code and they are not even bothering (yet) to take advantage of the second CPU core.

If you wanted to prototype this, you could literally zip tie a BTT "pico" MCU board to the print head and wire it up.  It would work perfectly with no new software development needed.  But it would look stupid.   Then remove everything from the board you can. and get it down to about 20 x 10 mm size with just one stepper driver.

JLCPCB makes custom PCBs that size for under $1 each plus the cost of the parts.  You can have the above for about $10 each with a minimum order of five.  OK you do need some new software to handle the power that is delivered over the USB cable.   And you need another small PCB near the Pi to inject the power into the cable.  You need something like a high-end phone charger near the Pi.

 

BTW, yes there are SPI to CAN bridges for the Pi you can buy off the shelf today.  These are used in industry for a million different things. https://copperhilltech.com/pican-2-can-bus-interface-for-raspberry-pi/

Here is a low-cost DIY Pi -> CAN via SPI experiment you can try https://www.hackster.io/youness/how-to-connect-raspberry-pi-to-can-bus-b60235

I am using this for a robotics project.  The robot has 12 motors all controlled via CAN and the main processor is a Pi.  I tried the above experiment to understand how this works.   CAN is great for robots and cars but USB-C is better for the printer use case.

I actualy own a CAN to WiFi bridge.   You can buy these for under $20 to use on your car to pull data from the car to a phone or computer while you drive. Or just to read and reset error codes. 

Edited by chrisalbertson
Link to comment
Share on other sites

Why use CAN ? Because, for now, it's the only way to get a toolhead PCB that does everything, from the extruder driver to the accelerometer).
But things are changing : see LDO Nitehawk. Unfortunately not for the 0.2 : https://docs.ldomotors.com/en/voron/nitehawk-sb
Others will do the same (BTT, etc.), no doubt. Pretty sure CAN will not survive. But not worth designing something that will cost much more (the 1$ PCBs were for the first design, and didn't include taxes and P&P - already ordered from them)

The problem with USB is sourcing a motion rated cable. Only source I know is Bamboo : https://eu.store.bambulab.com/fr-fr/collections/spare-parts-for-x1-series/products/bambu-usb-c-cable ; data + power. But Bamboo parts have nothing to do on a Voron !

Sourcing a motion rated CAN cable is easy : reuse the Teflon cables that come with the LDO kit. Did it on the 2.4, twisted by hand, works fine, no dropped frames (for now...).

[EDIT] forgot to say... Two days ago, searched about W-USB (wireless). It's now dead. Wireless would be great.

 

Edited by YaaJ
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...