Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed documentation to remove superfluous and incorrect information #139

Open
wants to merge 4 commits into
base: v2.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions site/blog/2022-11-08-no-you-dont-want-to-use-can.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,35 @@ tags: [RatOS, CAN, USB, Klipper, Rant]

## No, you don't want to use CAN.

For some reason, the entire 3d printing community has convinced itself that it needs to use CAN bus connections for everything. I'm here to tell you why that's a waste of your time when running klipper.
For some reason, the entire 3d printing community has convinced itself that it needs to use CAN bus connections for everything. I'm here to tell you why that's not needed with RatOS.

## What is CAN bus?

CAN bus is a multi-master protocol in which any device can initiate a message to any other on embedded systems where every device is known and there are no strangers. It can work over long distances and is less susceptible to noise than USB.
CAN bus is also the opposite of plug and play, requiring configuration for each device and setup. It's also not very fast, and requires a lot of overhead to work. It was developed for use in vehicles, where redundancy is critical.
CAN bus is a brodcast like protocol in which any device can initiate a message to any other on device on the bus. It can work over longer distances and is less susceptible to noise than USB.
CAN bus also requires configuration for each device and setup. Max speed for CAN is 1Mbps and requires more overhead to work. It was developed for use in vehicles to reduce wiring.

The strengths of CAN boil down to:

- Redundancy
- Noise tolerance
- Long distance
- 4 wires (power and data).

## What is USB?

USB is a strict master/slave protocol, where unknown devices can be connected to a host which controls them. It was made so you grandmother can plug in a keyboard without knowing the intricacy of serial communications, device mapping and drivers. USB is fast, has ultra low latency but works best over short distances.
USB is a point to point connection that and is used as a transport layer for many different protocols. It was made to simplify device connections to computer systems. USB is fast, has ultra low latency but works best over short distances.

The strengths of USB boil down to:

- Plug and play
- Low latency
- High throughput
- Low overhead.
- 3 wires (usb cable and power)

## Why CAN has no benefits over USB for 3d printers running klipper.
## Why CAN has little benefit over USB for 3d printers running klipper.

Klippy (the klipper brain that runs on your raspberry pi) is in charge of everything going on in your 3d printer. It's the master. Your control boards are slaves, they do what they're told by Klippy. Latency is critical for homing and nobody likes additional overhead.
We have 4 USB ports (and you can add more via hubs) on a standard raspberry pi, that means you can connect a virtually unlimited amount of boards to your printer.
Communication between Klippy (the klipper brain that runs on your raspberry pi) works the same between CAN and USB but with the additional overhead in setting up, CAN makes no sense. Nobody likes additional overhead.

We have 4 USB ports (and you can add more via hubs) on a standard raspberry pi, that means you can connect a virtually unlimited amount of boards to your printer with hubs.

### But Mikkel, USB cables are so fragile?

Expand All @@ -46,16 +45,11 @@ No. Good modern USB cables are made to take years of abuse from teenagers pluggi

Also no. If you use a modern 3.1 or better spec USB cable they come with heavy shielding and have no issues operating inside your 3d printer. You're not running 10 meters of cable here, even on a V-Core 500, you won't need much more than 1.5 meters. It's a non issue.

### But what about redundancy?

CAN redundancy is wasted on klipper, your raspberry pi is the single point of failure anyway, so it literally doesn't matter if you connect a bunch of can devices together and then to the pi or you connect a bunch of devices via USB directly to the pi. If the pi dies, everything dies, CAN or no CAN.

### But Mikkel, CAN is so much more reliable!

Is it? Your control board has run on USB for ever. It's been tested and proven to work. It works just as well for toolboards too.

None of the benefits CAN brings are relevant to 3d printing. You're wasting your time trying to get it to work, when you could just plug in a USB cable and be on your way.
Your control board has run on USB for ever. It's been tested and proven to work. It works just as well for toolboards too. There is no difference in reliability.

CAN is slower, has higher latency, uses more system resources, requires more configuration and is more expensive to implement, and you benefit from none of it.
None of the benefits CAN brings are relevant to 3d printing. You could be wasting your time trying to get it to work, when you could just plug in a USB cable and be on your way.

Stop worrying about CAN, and save yourself the headache!
2 changes: 1 addition & 1 deletion site/docs/configuration/toolboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RatOS supports multiple toolboards connected via USB. They can be flashed initia

# What about CAN?

No CAN do. RatOS does not provide any means of setting up a CAN connection to your toolboard. At this point for this use case, CAN has no benefits and is harder to use. See [No, you don't want to use CAN](/blog/no-you-dont-want-to-use-can) for more details on why CAN isn't the default protocol in RatOS. Besides the points listed in that blog post, CAN devices cannot be identified automatically, which violates RatOS' design principle.
No CAN do. RatOS does not provide any means of setting up a CAN connection to your toolboard. At this point for RatOS, CAN is not needed and unnecessary. See [No, you don't want to use CAN](/blog/no-you-dont-want-to-use-can) for more details on why CAN isn't the default protocol in RatOS.

If, despite all this, you still want to use CAN, you can do so manually just like every other klipper installation.

Expand Down