Welcome! Log In Create A New Profile


ESP32 Printer Board

Posted by CthulhuLabs 
Re: ESP32 Printer Board
January 10, 2018 08:38AM
Who would like to review my schematic? I am sure I have missed things. Also pretty sure I have more filtering on the stepper driver motor voltage than is really needed.
open | download - NEMO - (V01).zip (380.2 KB)
Re: ESP32 Printer Board
January 10, 2018 09:04AM
Damn.... I used the wrong TMC2130. I wanted the TMC2130-TA. Completely different pinout.
Re: ESP32 Printer Board
January 10, 2018 09:46AM
I like the NOR heater protection.

What's the purpose of STPR_DIAG on 2ndary uC? It would be useful to have one on ESP32 though.
Are you not planning on sending interrupts from ESP32 to SAMD?
Would be nice to have choice 3.3V or 5V and short protection at the end-stops.
I do not see any servo output.
I figure that power portion is not finished and fuses will be added later and assume endstops will be powered directly from the PSU but still 800mA maybe too little for both uC, steppers and sdcard.

Edited 2 time(s). Last edit at 01/10/2018 10:10AM by newbob.
Re: ESP32 Printer Board
January 10, 2018 10:01AM
looking forward to the first Boards to be available ...

Any Idea, wich Firmware_team should be involved ? Marlin ?
Re: ESP32 Printer Board
January 10, 2018 10:42AM
Took a look at the schematic, looks very promising! Found 3 potential issues, in order of importance:

Spi address demux seems wrong. Aren't gate signals opposed logic levels ANDed together? If so setting all high or all low are both disable.

The SS14 diode after the 3.3V regulator may cause the voltage to drop under 3V when USB/standby powered. Could it be an issue?

Finally to put my OCD at ease, DMX_ADRn to IOn connections feel backwards. Most significative address bit is connected to least significative IO.
Re: ESP32 Printer Board
January 10, 2018 11:01AM

1. Cannot take credit for the NOR heater protection. I took it off the Duet boards with some slight modification to allow both uC to kill the heaters.
2. The STPR_DIAG pin is what the TMC2130s use to tell the uC about issues. It will trigger an interrupt on the SAMD21 which will then throw and interrupt over to the ESP32 using its 3 interrupt pins.
3. Not really sure I need one. The SAMD21 is not really concerned what the ESP32 is doing most of the time. Only time it cares is when the ESP32 wants to talk on the SPI bus but it gets notified of that when the uC_SPI_SS goes active. Can link some of the spare GPIOs for that.
4. Be nice but I am not sure it is necessary
5. Most of the AUX GPIO pins are capable of PWM. As such they could be made into a servo pin in firmware. I just have not set that in stone in the schematic.
6. Yes I need to add fuses. And yeah I had not recalculated the power draw with the SAMD21 yet. Going to move to a 1.5A regulator.


Be a while before I even have a prototype. As for firmware it will be running RepRapFirmware. The Arduino library for the ESP32 currently is very limiting and Marlin basically needs that.
Re: ESP32 Printer Board
January 10, 2018 11:11AM
Who would like to review my schematic? I am sure I have missed things. Also pretty sure I have more filtering on the stepper driver motor voltage than is really needed.

I have not done a full review of your schematic, but in glancing over it I noticed the following:

1. I agree with the previous comment about the diode after the 3.3V regulator. What is its purpose?

2. You should provide 5V gate drive to the heater mosfets, especially for the bed heater. Use a 74HCT device powered from 5V to drive them as we do on the Duets, instead of a 74ALV device powered from 3.3V.

3. What is the purpose of diodes E1_D1 and similar for each motor driver?

4. You have 2 x 100nF plus 2 x 150uF capacitors on the motor supply voltage to each driver chip. Is this necessary? [I haven't checked the TMC2130 datasheet.] 100nF + 100uF is more typical.

5. Pins 10, 17 and 23 of each TMC2130 are left floating, If they are inputs, it would be better to ground them.

6. I didn't spot the thermistor connectors or the associated reference resistors.

7. If you intend to program the SAMD21 via then SW Debug header then I suggest you use a standard connector pinout. At the very least, add a ground pin to the connector.

8. Check whether the SAMD21 needs resistors between it and the USB connector D+ and D- pins.

9. The micro SD card socket needs a capacitor local to it between +3.3V and ground, to handle the current surge when a card is inserted.

10. You have 2 pages with title "E1 motor".

HTH David

Edited 1 time(s). Last edit at 01/10/2018 11:13AM by dc42.

Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet [www.duet3d.com].
Re: ESP32 Printer Board
January 10, 2018 11:31AM

1. You are correct. Fixed that.
2. Probably be a problem. Hmm not even sure I need it.
3. I picked a random order for that honestly, but I did move the uCS to the top as it was bugging me looking at it. Probably wont fix your OCD but it does mine. LOL.
Re: ESP32 Printer Board
January 10, 2018 11:46AM

1. Honestly cannot remember why I put it there.
2. Okay. Will do.
3. Per your suggestion earlier in the thread. To keep a mechanical endstop from sending a signal into the stepper diagnostic pin of the TMC2130s if someone has a the jumper set for stall detection endstops but kept a mechanical one there. Not sure if I hooked that up right though.
4. Honestly not sure if they are necessary. I was basing the stepper drivers off the TMC2130 evaluation board schematic, but it seems overkill.
5. Seem to think the datasheet said to leave them floating, but I will doubt check that.
6. Yep forgot about those. Thanks.
7. Will do.
8. Will do.
9. Done.
10. Stupid labels. Fixed
Re: ESP32 Printer Board
January 10, 2018 12:10PM
The SS14 on the 3.3V supply was the to protect against ATX 3.3V feeding back. You should probably remove the diode AND all connections to the ATX3.3V. They are not needed since you will have +5VSB anyways when the power supply is connected.
Re: ESP32 Printer Board
January 10, 2018 12:17PM
Looks like I skipped a few things on the TMC2130s because they were confusing me at the time and planned to come back to them. They are still confusing me lol.

I am not sure what to set the AIN_IREF to. It is discussed in chapter 8 of the TMC2130 datasheet. Just not following how to calculate what the voltage should be on it.

I am also not sure how to setup dcStep on this thing. The pins for it are DCEN, DCIN, and DCO. I am not quite following at the moment how to configure these pins. I am thinking I can just tie them to ground and configure it via SPI.
Re: ESP32 Printer Board
January 10, 2018 12:30PM
@lhartmann - That's right. I was planning on having the voltage regulator only supply enough power for minimum operation when the ATX supply is off. Not sure if that is a good idea though. The ESP32 draws 400mA+ when doing heavy WiFi which it could do when idle.
Re: ESP32 Printer Board
January 10, 2018 02:16PM
@david (dc42): What board you are testing on ? SAM E70 with Wifi ?

interesting Chip... ARM Cortex-M7 running at up to 300 MHz, Up to 114 I/O lines with external interrupt capability (edge- or level-sensitivity), debouncing, glitch filtering and
On-die Series Resistor Termination , Two 4-channel 16-bit PWMs with complementary outputs, .....

Is that a Board designed by you dc42 ?

best regards

Re: ESP32 Printer Board
January 11, 2018 12:07PM
So I am still a little stuck with the TMC2130s.

I have figured out that the AIN_IREF pin needs to be set to something. A value between 0V and 2.5V scales the current between 0 and 100%. Anything less than 1V is not recommended. I have set it to 2.5V and will use the SPI commands to scale it. So that pin is fine.

DCEN forces the driver into dcStep mode. It can also be configured in software. So as to not force it I have tied that pin to GND. So that pin is now fine.

DC0 is an output pin that indicates when dcStep is skipping steps. It is to signal an external motion controller of this fact. Not sure if I should run all five of these through a 5 way OR gate and into an interrupt pin on the uC. I do not think it is necessary though. Currently have this pin floating.

DCIN is basically a way to syncronize dcStep across multiple drivers. The documentation on it is a bit weird though. In one spot in the datasheet it seems to suggest that it should be high to allow normal operation. In another spot it seems to suggest that it should be low to allow normal operation. The Einsy-Rambo (the board used in Prusa's new printer) has it floating in their schematic. I currently have this pin floating.

Any help on this would be appreciated. Here is the datasheet:


Attached is my revised schematic for the Z Stepper Driver. Once it is finalized I will copy it to the others and make the necessary changes.
open | download - Z_Stepper.zip (510.4 KB)
Re: ESP32 Printer Board
January 11, 2018 02:05PM
The way I read it they can be left floating since they are 'tristate' when SPI_MODE=0.

All pins with suffix CFG0 to CFG6 have a special meaning in this mode. They are evaluated using tristate detection, in
order to differentiate between
- CFG pin tied to GND
- CFG pin open (no connection)
- CFG pin tied to VCC_IO

EDIT: DCEN should(?) be low SPI_MODE=1. When DCEN is low dcStep is disabled so DCIN does not work. (I'm not sure if DCEN should be low or when low it turns off dcStep.)

For reference, here's application note for dcStep

Edited 4 time(s). Last edit at 01/11/2018 02:40PM by newbob.
Re: ESP32 Printer Board
January 11, 2018 02:09PM
We're in spi_mode=1
Re: ESP32 Printer Board
January 11, 2018 02:22PM
From what I've read when DCEN is high it forces dcStep on, but when low you can activate it via settings in the SPI interface.
Re: ESP32 Printer Board
January 11, 2018 02:51PM
18.3.1 Using LOST_STEPS for dcStep Operation
This is the simplest possibility to integrate dcStep with a dedicated motion controller: the motion
controller enables dcStep using DCEN or the internal velocity threshold. The TMC2130 tries to follow
the steps.

I guess you're right - you can enable it via pin (DCEN high) or through velocity threshold (VDCMIN).

on the other hand, below quote says that it's enabled by external pin...

5.4 dcStep Minimum Velocity Register
The automatic commutation dcStep becomes enabled by the
external signal DCEN. VDCMIN is used as the minimum step
velocity when the motor is heavily loaded.
Hint: Also set DCCTRL parameters in order to operate dcStep
Re: ESP32 Printer Board
January 11, 2018 03:16PM
You can see why it's confusing?
Re: ESP32 Printer Board
January 12, 2018 06:43AM
TMC motion controller's spec sheet give a little bit more information about dcStep.

This pretty much settles it:
18.3.2 DCO Interface to Motion Controller
DCEN enables dcStep. It is up to the connected motion controller to enable dcStep either, once a
minimum step velocity is exceeded within the motion ramp, or to use the automatic threshold
VDCMIN for dcStep enable.

Can control dcStep through DCEN and is automatically enabled when VDCMIN threshold is set and exceeded.

EDIT: dcStep is a fullstep mode which is is useless for xyz but could be useful with geared extruders.

Edited 2 time(s). Last edit at 01/12/2018 06:17PM by newbob.
Re: ESP32 Printer Board
January 12, 2018 08:26PM
I realized two things:

1. I am designing a prototype, not the final version.
2. The 64pin version of the SAMD21 costs 0.20 USD more than the 48pin.

As such I am going to switch out the SAMD21 for the larger version. I will run DCEN and DCO to it. DCIN I am going to tie to a 3pin jumper for now. In the final version I will either tie it high or low depending on what it actually needs.
Re: ESP32 Printer Board
January 14, 2018 03:37PM
Since you mention prototyping have you considered separating drivers from uC?

I think the most flexible (and economical) design would be to have a stepper driver cape/shield/daughter board that can be used with multitude of controllers mainly because controllers evolve much faster than driver's do. Plus, stepper drivers benefit from (or require) 4 layer PCBs that is not needed for rest of the system, if you separate drivers people can test them with other controllers and it's also cheaper to stock multiple driver boards instead of two separate controllers with different number of drivers.
Re: ESP32 Printer Board
January 14, 2018 04:15PM
@newbob I like the Idea. But how do you want to connect the driver board to the cpu board? Jumper cables?
Re: ESP32 Printer Board
January 14, 2018 08:25PM
@newbob - while that sounds like a good idea at first, it makes the design much more complex and the socket between the boards would use through hole parts. I would like to avoid that as much as possible to minimize production costs.
Re: ESP32 Printer Board
January 14, 2018 09:17PM
.1" header with SMD mounts, female and male: [www.sparkfun.com]
Re: ESP32 Printer Board
January 15, 2018 05:58AM
Yep I am aware that they make SMT headers, however unless I make one of the boards fit upside down into the other board I have to use through hole for at least one of them.
Re: ESP32 Printer Board
January 15, 2018 07:00AM

(don't want to add to feature creep smiling smiley )

Edited 2 time(s). Last edit at 01/16/2018 07:44AM by newbob.
Re: ESP32 Printer Board
January 16, 2018 10:16AM
@newbob - Thanks smiling smiley I am already running at the limits of my design capabilities.
Re: ESP32 Printer Board
January 16, 2018 11:53AM
Here is the second version for review.

Major changes:
1. Switched SAMD21 from the 48 pin to the 64 pin version
2. Changed the TMC2130-LA's to TMC2130-TA's (handle more current and are easier to solder)
3. Routed the DCEN and DCO pins from the TMC2130s to pins on the SAMD21.
4. Added Thermistor connections
5. Switched the 3.3V regulator from a 800ma one to a 1500ma. (will change after prototyping if overkill).
6. Put more reasonable filtering on the motor voltage at each stepper driver.
7. Added a cap to the SDcard
8. Added screw terminal for the heaters.
9. Added a Z-Probe Header
10. Added a Reset button
11. Added fuses

There were hundreds of other small changes. Please take a look and let me know what problems you find. I am sure I am still missing stuff.
open | download - NEMO - (V01).zip (463.8 KB)
Re: ESP32 Printer Board
January 16, 2018 07:24PM
ADC inputs have no resistors in series.
SDCARD needs pull-up resistors. and, depending how far it will be from the MCU - it may need resistors in series on outputs to suppress signal reflections.

Few things to consider:
3.7.3 Reduction of Resistive Losses by Adding Schottky Diodes Schottky Diodes can be added to the circuit to reduce driver power dissipation when driving high motor currents (see Figure 3.9). The Schottky diodes have a conduction voltage of about 0.5V and will take over more than half of the motor current during the negative half wave of each output in slow decay and fast decay phases, thus leading to a cooler motor driver. This effect starts from a few percent at 1.2A and increases with higher motor current rating up to roughly 20%.

In case well defined velocity settings and precise motor chopper operation are desired, it is supposed to work with an external clock source.

Edited 1 time(s). Last edit at 01/16/2018 07:33PM by newbob.
Sorry, only registered users may post in this forum.

Click here to login