Jump to content

Need some CAN Help!


Recommended Posts

OK so, I'm reaching out to get some help with my first, from scratch, CAN install.

Here's what I'm working with...

Voron 2.4 running Klipper  (Mainsail)

Mainboard/Pi: LDO Leviathan with a Pi 5B piggybacked on top

USB/CAN Interface: Mellow UTOC-1

CAN Toolhead Board: Mellow Fly SB2040 V2 Pro

Toolhead will run std. Rapido with std thermocouple, std Stealthburner 24v hotend and cooling fans, LED's, X endstop, and the rest of whatever I missed.

So far, I have been following the Esoterical CAN BUS Guide and have successfully updated and confirmed the Pi per the "Getting Started" section.

I connected the UTOC-1 to the Pi via USB and confirmed that the UTOC is visible to the Pi.

So far, so good... Everything checks out.

Now I'm at a fork in the road and am reaching out for some advice...

First is with Flashing:

Do I need to flash the UTOC-1? If I do, I assume it's best to NOT have the CAN cable and 24v power connected to it.

Next is Flashing the SB2040:

Do I flash with USB or CANBoot or I think it's called Katapult now. @mvdveer what's your method?

Lastly... I need some confirmation with wiring the UTOC to the SB2040. Currently I have my boards wired per the diagram below. Correct me if I'm wrong here. I have the 4 CAN wires from the cable attached to the end terminal block, on the opposite side is the USB-C and I have 24v and gnd wires connected to the other terminal block, I assume the only way for the toolhead PCB to get 24v is from the PSU. True?

Below is the diagram I used, just want to confirm this is correct

image.thumb.png.00f187c894887a19cb5b7d2b25b10c8b.png

Also, if anyone has some additional resources, please let me know.

Link to comment
Share on other sites

1 hour ago, Penatr8tor said:

Do I need to flash the UTOC-1?

No you don't - it acts as a bridge, you only need to power it with 24V in order to supply the SB2040 with power and connect to the raspi via USB for communication. The firmware come pre-installed. See documentation here.

 

1 hour ago, Penatr8tor said:

Do I flash with USB or CANBoot or I think it's called Katapult now. @mvdveer what's your method?

Put the board in DFU mode by ONLY connecting the USB from the Raspi whilst hiding down the boot button.

Compile Katapult for SB2040.

Flash Canboot/Katapult as per esoterical guide to the SB2040  ( I used this guide.)  Just ignore the flashing of the Octopus board as you are using the Fly UTOC as the bridge.

Setup your can network:

sudo nano /etc/network/interfaces.d/can0

then enter

allow-hotplug can0
iface can0 can static
  bitrate 1000000
  up ifconfig $IFACE txqueuelen 1024

Reboot everything.

Check your can network is up and running:

ip a

Follow the instructions and  and obtain your SB2040 UUID

Compile klipper for SB2040

Connect the Canboard via UTOC (24V, GND, CanH and CanL) and UTOC to raspi (USB) and flash Klipper over Can (Katapult method)

You set to go

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

+1 to all this. UTOC is pre sorted. The hint I'd like to add is to make sure you write down your toolhead uuid when you get to that part, otherwise you have to "klipper service stop" or whatever it is to have your pi find it, and that escaped me the first time.

  • Like 2
Link to comment
Share on other sites

OK, I'm having some issues flashing the SB2040 board.

Correction:

I was having trouble, Now I think I'm good, by going thru everything step by step I was able to get the SB2040 flashed.

I'm keeping these steps here in case anyone else is using an SB2040 with UTOC-1.

I am SSH'd in the Pi and I have successfully completed the following steps:

1. Installed katapult using... Resource link

cd ~/
git clone https://github.com/Arksine/katapult

2. Created .bin file/s using

make clean KCONFIG_CONFIG=config.sb2040v2

and

make menuconfig KCONFIG_CONFIG=config.sb2040v2

Making sure that it's configured per Mellow.

Mine:

image.thumb.png.f62e7bb747f8e3cdc4386977835d60d7.png

Mellows:

image.png.1f90715d4100cc94164ef5143b040fea.png

3. Connected SB2040 to Pi via USB and held down boot button while connecting.

SB2040 is connected to blue USB port on the Pi.

V2.4_Refurb-CANSetup-77.thumb.JPG.d91253d7fc0ce4032c1b1879034d5443.JPG

These are the LEDs that are lit up on the SB2040

V2.4_Refurb-CANSetup-78.thumb.JPG.36b550a342ee7b1eb84ba4679fc36e28.JPG

 

4. I checked to make sure that the SB2040 is connected correctly by running 

lsusb

image.png.f8d5adccb6b987c0ed894cbb33f4aaec.png

 

5. Flashed?

Flashed using:

sudo make KCONFIG_CONFIG=config.sb2040v2 flash FLASH_DEVICE=2e8a:0003

 

Below is the result. Do I need to be worried about the magenta colored alerts?

image.thumb.png.f965129118fe0cafbd5c399c53c896a4.png

 

At the end it does report that the SB2040 is flashed.

image.png.ecfc8bfd8311d8ca9eaca2fda8af8d32.png

and I assume it's flashed because the blue LED next to the boot switch is blinking.

5. Checking to make sure that I get a valid UUID using:

python3 ~/katapult/scripts/flashtool.py -i can0 -q

Test appears to be positive.

image.png.62ec17e6263f1572f04a7459fa4e9c52.png

and my UUID is... UUID: 212bea3bc62a Thanks @Glengus

@mvdveer Question... I do not need to jumper the UTOC-1 for 120 ohm resistor or do I? ...and if I do, which jumper?

 

Link to comment
Share on other sites

27 minutes ago, gueee said:

+1 for Esoterical's CAN guide, just follow it from getting started, proceed with toolhead board combined with your toolboard model section and you'll be happy! 

Actually, the Esoterical instructions for my board/s did not work and I got an error flashing. What did work however, were the instructions from Mellow.

See above.

Thanks tho, 👍

All of the other stuff from Esoterical is working great BTW, just need to detour a little for the SB2040 flashing.

Link to comment
Share on other sites

1 hour ago, Penatr8tor said:

Actually, the Esoterical instructions for my board/s did not work and I got an error flashing.

I almost bet you stumbled across the same tricky part in using Esoterical's guide that I did, cause the config stated on that web page is the exact same as the one from mellow for your particular board. 

to get it right you gotta jump back and forth between toolhead flashing section and mellow fly SB2040v1/v2 section. 

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

1 hour ago, Penatr8tor said:

uestion... I do not need to jumper the UTOC-1 for 120 ohm resistor or do I? ...and if I do, which jumper?

No, mine are not. Just to make sure - the documentation states:

Quote

 

  • The Fly UTOC main CAN bus 120 ohm resistor is not jumpered and always enabled.

 

 

  • Like 1
Link to comment
Share on other sites

13 minutes ago, gueee said:

I almost bet you stumbled across the same tricky part in using Esoterical's guide that I did, cause the config stated on that web page is the exact same as the one from mellow for your particular board. 

to get it right you gotta jump back and forth between toolhead flashing section and mellow fly SB2040v1/v2 section. 

Yup, exactly what I had to do. 👍

Link to comment
Share on other sites

17 minutes ago, mvdveer said:

No, mine are not. Just to make sure - the documentation states:

Interesting that mellow have chosen to have the resistor permanent. If the toolhead board gets its 120R selected then a multimeter will read 60ohms between high and low can, which is what you want.fly_utoc-pins.png.08ea603392c5d27b2b7b3d4203690ee5.png

Looks like those 120R jumpers are only used with the utoc 3 boards and something to do with usb

  • Like 2
Link to comment
Share on other sites

27 minutes ago, Penatr8tor said:

Yup, exactly what I had to do. 👍

Unfortunately documentation seems to be mellows weakness. I bought a fly mini pad when they just released it. After days of trial and error using instructions translated from Chinese I settled on using their custom klipper image.

  • Like 2
Link to comment
Share on other sites

9 minutes ago, Glengus said:

Unfortunately documentation seems to be mellows weakness

Not as bad as Bigtreetech documentation. I have always found Mellow to have all the answers, if you use the correct "site" The problem is there are a few sources for their information. New boards always lag behind in their documentations. The price we pay to be at the forefront of the latest. 🙂

 

  • Like 1
  • Haha 1
Link to comment
Share on other sites

8 minutes ago, mvdveer said:

No, mine are not. Just to make sure - the documentation states:

Yup, Confirmed!

Since my last update I...

rebooted, power everything off and connected the UTOC-1 to 24v and gnd and also the Pi via USB and then the SB2040 via CAN cable.

Success!!!

 Flashed Klipper onto the SB2040 via CAN. Now I'm editing my printer.cfg.

Should have fans fanning and extruders extruding soon. 🙂

 

 

 

  • Like 1
Link to comment
Share on other sites

8 minutes ago, mvdveer said:

The price we pay to be at the forefront of the latest. 🙂

Agree!

I'm fumbling around like a newb because when it comes to CAN...

I'm a Newb. 🤣

Seriously though, it's my first time thru so I'm learning a lot and with many of the tasks I don't know the authors assumptions yet, having never done it before.

But I think I'm getting the hang of it.

It's been fun so far.

Keep ya posted.

  • Like 1
Link to comment
Share on other sites

6 minutes ago, Penatr8tor said:

I'm fumbling around like a newb because when it comes to CAN..

DId not seem like fumbling to me.

9 minutes ago, Penatr8tor said:

I'm learning a lot

I always tell my junior doctors in simulated scenario's that there are "no mistakes, only lessons learned". The mistake would be not to learn the lesson in your erroneous ways, then people would come to harm. 

10 minutes ago, Penatr8tor said:

It's been fun so far.

That is all that matters. Once you have done one, the others will be a breeze. Except if you are going the BTT (EBB36 for VZBot as example) way, there will be slight differences in getting the board into dfu mode, but the rest the same.

  • Like 1
Link to comment
Share on other sites

OK... I'm in the testing phase. I got steppers and hotends and pretty much everything connected from the hotend to the CAN board.

I have two issues:

1 . Extruder throws an error. 

image.png.b8346674ac9a3c1baf8e890b4ef2b148.png

image.png.9dc5847d3780b3337ff81587447c1c9c.png

Looks like something in my printer.cfg needs adjusting.

Below is my extruder section:

#####################################################################
#   Extruder
#####################################################################

##  Connected to SB2040v2
##  Heater - HEATER
##  Thermistor - TH0

## Bondtech LGX_Lite
[extruder]
step_pin: SB2040v2:EXT_STEP
dir_pin: !SB2040v2:EXT_DIR
enable_pin: !SB2040v2:EXT_EN

# gear_ratio: 50:10              # Not required by Bondtech
rotation_distance: 5.7           # 5.7 is Bondtech recommended, prev. was 5.57
microsteps: 32
full_steps_per_rotation: 200
nozzle_diameter: 0.400
filament_diameter: 1.750

max_extrude_only_velocity: 120
max_extrude_only_accel: 800
max_extrude_cross_section: 5
max_extrude_only_distance: 1000.0
max_extrude_only_velocity: 50.0
max_extrude_only_accel: 1500

heater_pin: SB2040v2:HE0
sensor_pin: SB2040v2:TH0
sensor_type: Generic 3950   #ATC Semitec 104GT-2  # this is the default for the Revo heater
#pullup_resistor: 1000             # Uncomment for PT1000 Sensor with jumper installed.
control = pid # Sample PID - perform your own PID tuning for accurate results. 
pid_kp = 26.213
pid_ki = 1.304
pid_kd = 131.721
min_temp: 0
max_temp: 275
min_extrude_temp: 10

[tmc2209 extruder]
uart_pin: SB2040v2:EXT_UART
stealthchop_threshold: 0
run_current: 0.30

Issue #2 "was" my X end stop not working.

I fixed that this morning after checking the "fly_sb2040_v2.cfg" file I created for the install (below is the contents).

## Fly-SB2040-V2 BOARD PINS
[board_pins SB2040v2]
mcu: SB2040v2
aliases:
aliases_2209:
    EXT_EN=gpio7,EXT_STEP=gpio9,EXT_DIR=gpio10,EXT_UART=gpio8
aliases_endstop:
    LIMIT_0=gpio25,LIMIT_1=gpio28,LIMIT_2=gpio29
aliases_cnc_fans:
    FAN0=gpio13,FAN1=gpio14,FAN2=gpio15
aliases_thermistors:
    TH0=gpio27,TH1=gpio26
aliases_heaters:
    HE0=gpio6
aliases_rgb:
    RGBLED=gpio12
aliases_adxl:
    ADXL=gpio1
aliases_pt100:
    PT100=gpio22

Turns out the Mellow decided to name GPIO29 ---> LIMIT_1 in the online guide but in the fly_sb2040_v2.cfg file, it's LIMIT_2.

Change tested and fixed.

So now I'm going to go thru both my extruder setting in my printer.cfg and compare to the fly_sb2040_v2.cfg alias's.

  • Like 1
Link to comment
Share on other sites

The 1st is something to do with your stepper driver. Can you tripple check the aliases_2209 line please?

The IFCNT type errors gave me a headache when i changed to tmc5160 drivers that use spi instead of uart. Tmc2209 should be a simple fix. Will have a closer look during the day (2:30am for me at the moment)

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

23 minutes ago, Glengus said:

The 1st is something to do with your stepper driver. Can you tripple check the aliases_2209 line please?

The IFCNT type errors gave me a headache when i changed to tmc5160 drivers that use spi instead of uart. Tmc2209 should be a simple fix. Will have a closer look during the day (2:30am for me at the moment)

I did double check the alias's and they do indeed match up. The one thing I'm wondering is the jumper for SPI or UART that's next to the 120R jumper. I'm going to pull that jumper and try again.

Thanks @Glengus 👍

Link to comment
Share on other sites

3 hours ago, Penatr8tor said:

I did double check the alias's and they do indeed match up. The one thing I'm wondering is the jumper for SPI or UART that's next to the 120R jumper. I'm going to pull that jumper and try again.

Thanks @Glengus 👍

Oh it's sound's like you might be onto it there. I'm not fluent enough to tell at a glance you if your config is for spi but I doubt it would be intended to be used that way as default. 

@Penatr8tor let us know how you get on or I'll look into it further.

  • Like 1
Link to comment
Share on other sites

Have you rewired your extruder motor? Maybe just check connections and wire order,  I know it sounds obvious, just thinking outside the box. The configs look good. Also can try just changing to sb2040v2:gpio8. I don't use alias - confuses my brain too much 🙂

 

  • Like 1
Link to comment
Share on other sites

2 hours ago, mvdveer said:

Have you rewired your extruder motor? Maybe just check connections and wire order,  I know it sounds obvious, just thinking outside the box. The configs look good. Also can try just changing to sb2040v2:gpio8. I don't use alias - confuses my brain too much 🙂

So I have done some looking around and I have found out something interesting...

My board is a SB2040 Pro and a Pro has a TMC 2240, not a TMC 2209

I think I might need to reflash.

image.thumb.png.2fbfcd8b50da0de3f531428d220c212f.png

I did update my printer config so the I have [TMC2240 EXTRUDER] instead of the 2209 but that did nothing.

Here's a site for the SB2040 Pro, can you take a look and perhaps give me some help re-flashing? I had to set the language to simple Chinese and use google translate on it to get all of the text to appear in English.

  • Sad 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...