Custom Extension Module

After getting the Idea of making a custom module, i orderd a couple parts and got to work.
As im not great in coding, ive started with a separat CANbus only module.
I want a more open Connectorsystem, ive chosen DB9 connectors.
There are no Cable from SN to DB9 so ive orderd 4 and 8 Pin cables.
When looking at the 4Pin ive noticed, they are keyed, Comparing to what i have already, i got PSU-Controller cabels. Some filing later its now a universal cabel :smiley:.
Looking into the 4Pin Connectors, ive also noticed one Powerpin is longer then the rest, GND i assumed. Checking with my DMM, NOPE its not! its 24V.
Urm okey, lets see when i cut the cable if the colors match their use. Nope they dont! The longer Pin has Black Insulation, the Shorter one has Red. So the Cable Pining and Insulation colors make sens, the Use is not unfortunatly. Something other Modulemakers will have to keep in mind. Bit of a Desingfail imo.
Update 1: The 8Pin cabel has the CORRECT (Red 24V, Black GND) assignments (WHY!?)
Update 2: Looks like only Addon3 Port has reversed Polarity (the only other 4pin is the Heated bed, which doesnt care). All 8Pin ports have the same Powerpinout as mentioned in Update 1.

Setting that aside,Hardware my module has inside and Functions planed for it:

-Teensy 4.0 MCU of the Module

  • 2 CAN Transceiver (sofar only 1 added for SN coms.). 2nd one will be used for DB9 based connections
  • 4 Kbit FRAM, Storage of Toolhead Usage hours
  • 8 Channel ADC, PTC Temperature sensors on linearmodules,1 Ambient temp., 2 spare channels
  • 3 Buttons (Planed)
  • 3 LEDs (single colour)
  • OLED screen for infos (Planed)
  • Rotary endocer for Menu on OLED (Planed)

Cutup cable, Long powerpin on the left, shorterone on the right.

The Wiring mess the Module is currently
ADC on the front Breadboard, White Breadboard: LEDs, Buttons, FRAM, CAN Transceiver, Teensey 4

As i do have 4Pin connectors, chaining off the Enclosure will be my only option, without cuttign a 8 Pin cabel. To my annoyance after checking, the Encolsure isnt on the same CAnbus as the rest of the modules. So i’d either have to start sending commands for other modules on this Bus aswell or im going to cut up a 8Pin cable aswell.

Cheers, thanks for the Read and if you have feedback for more feature creep :smiley:


Very, very interesting and clever work, keep us up to date!
What do you think are going to be the roundly costs.
And what can you do with these Leds and switches you speak from?

as its purely a ocupational thing over christmas, costs and timeframe arent realy a thing :smiley:
LEDs and Buttons were planed for indications, like Laser/CNC running, simple stuff. Bottons for acknowledgement for filament change as the touchscreen doesnt have that feature. Purley planed no implementations on the SN controller side yet.

Let me call you “MASTERBRAIN”!!!

a pair of solderd D-Subs later

Testing them also didnt kill my Controller and the Analyser is able to read CANbus so im assuming they are “to spec” ?

Pinouts of the Snapmaker cabels, only CAN and power are used in my Connectors, Step and such arent requierd for my usage so they are shrinked off.

DB9 Connector Pinout:
2: CAN_L
6: GND
7: CAN_H
Pin 3 and Pin 6 are connected inside the D-Sub Connectors in my case. (as no PCB bridge exists sofar and having 2 GND connections sounds better)
CAN_PWR is carrying 24V (didnt see a voltage described in the Spec.)

1 Like

DB9 connectors have standard pin numbers, and they’re not the same as the ones you’re using. Here’s some documentation.

The Pinouts are from the SN cabels, ive added clarification to the post.

1 Like

As im happy with the current Hardware setup i decided to make a schematic of the Module. Ill gladly change things if improvements can be made.
ADC/ Tempsensor Page:

1 Like

Thats great - looks very nice wow!

Why the 2 separate CAN interfaces? Is the internal CAN bus not homogenous between the controller and modules? I did see 2 CAN interfaces in the firmware, but never took the time to understand why.

as you mention it, on the J2 CANbus im missing a 120Ohm termination resistor.
The J1 (left) CANbus is directly from the SN2 with its single 60Ohm termination resistor for most modules. Toolhead 3 (enclosure) and PSU share a CAN interface afaik (based on the fact that the enclosure Bus is pretty quiet apart from LEDs on and off). Not even sure if the PSU is running a CANbus or just a “Power :white_check_mark:” signal. But there are two Transceivers on the Controller.
J2 Canbus is meant to be bridged over to the SN CANbus but seperated to be “compliant” with the 120Ohm termination resistors on the ends of the Bus. Possibly do a bit of filtering to not have the 500ms update of the toolhead on the Bus if you use the 8Pin variant. The enclosure would be “easier” to work wtih but also coding in the ctronller requierd, if you just hijack the main bus you can manipulate temps and endstops to your hearts content, for better or the worse.

I have looked at that, and the power supply is not CAN, just a voltage signal here.

I might have had the wrong idea of your architecture here: I was thinking J1 and J2 were both connected to the Snapmaker. It’s sounding now like like J1 connects to the Snapmaker and J2 is a utility port for debugging / additional external modules.

Thanks for clarifying.

Correct, basicly my Module would be a Canbus bridge between the two “worlds”. J1 is going to the Snapmaker, J2 is to other modules. notsure about if debugging has to be considerd as the teensy has its own USB port and ive left a couple connections open for debugging/ extensions beeing plugged in.

So it sounds like you settled on cutting up the 8pin and dropping the 4 pin connector, so no CAN interaction with the enclosure?

I think that’s for the best. If you need to interact with the enclosure just add a custom controller firmware callback functions that allows you to control the enclosure from the main CAN bus.

There’s yet another option - the enclosure module has 2 ports on it - alternatively you could add a custom controller firmware callback that recognizes specific commands coming from the enclosure canbus and having the main controller mirror that for you. I’d say the motivation for doing that is small, but it a) allows you to control all devices from a single canbus, and b) allows you to plug into the enclosure instead of the main controller. A separate problem to be solved is the lack of responses from main can bus to the aux - that would have to be solved as well in the controller firmware.

I think requiring a custom firmware addition is not so bad. Easy to maintain as well as long as the modifications are succinct.

guess where i have the Pinouts and Wirecolors from? The Pic in teh initial post is a 4 Pin, the Linked post has two Dsubs , the top one has a couple wiers shrinked off (DIR, STEP,EN). I do have D-Subs for each of the cabels now, but yeah most likely. Either get to know how to make a sorta crosscom inside the controller to the enclosure port, as the Enclosure also has a left open port OR clip onto the main Bus and get the enslosure throught the controller, as you mentioned.

Since the teensy has 3 can ports, would you be interested in plugging 2 ports into each of the snapmaker can buses, and then using the 3rd for future modules? Or alternatively using UART for future modules? If you’re doing future development it doesn’t really have to be CAN based, could be TWI or anything else, then you wouldn’t have to worry about the CAN transceivers and level shifting either.

the 3rd port is at the bottom of the Teensy, i wanted to keep everything as handsolderable as possible. And easy to remove if it blows up do to an error somewhere. The footprints of teh DIP packages are a bit bigger as they are prepared to be sockatable, as i would do it on my perf boards. Sure you could chain UART throught the modules. thats why Serial2 and i2C0 are "exposed, if you call the OLED screenheader a open port. What my main plan is currently, get the ADC running so i can read/log temperatures and if a stepper gets to hot the printer gets a timeout until a acceptable temp is reached again. (via a filament runout event or a simpler Pause-Resume feature.

After some small changes and lots of fiddling around, Here is the first version of the layouted PCB, not all components are final yet, placement i hope is sorta okey though.
BOM isnt done yet, as im mainly checking on Mouser, Partno. will be from there.

With filling up BOM and looking at the Datasheets ive noticed lots of missing parts :roll_eyes:
Bypass Caps, my Bulk cap next to the DC-DCConverter is not possible with the package, the Buzzer needs a Transistor. Lots of Things to change.

As this is my first PCB Layout, coments and Feedback is verry much appriciated.



V2 of the PCB, which im now thinking about to order.

1 Like

OKey my fellow Techwizzards, Has someone looked into the Module/controller code how the registering of a module works? Ive looked into the controller side briefly but didnt see “Starting register…Done Registering, going ahead with daily buisness” sort of code.

Yes. What do you want to know?

On the module side it just has to respond to a request for function codes, which is handled mainly in the registry: Snapmaker2-Modules/registry.cpp at main · Snapmaker/Snapmaker2-Modules · GitHub

1 Like