Re: ESP32 Printer Board October 31, 2017 03:19PM |
Registered: 7 years ago Posts: 7 |
Re: ESP32 Printer Board October 31, 2017 03:52PM |
Registered: 8 years ago Posts: 363 |
Re: ESP32 Printer Board October 31, 2017 05:15PM |
Registered: 11 years ago Posts: 126 |
Re: ESP32 Printer Board October 31, 2017 10:16PM |
Registered: 8 years ago Posts: 363 |
Re: ESP32 Printer Board November 01, 2017 04:06AM |
Registered: 7 years ago Posts: 7 |
Re: ESP32 Printer Board November 07, 2017 10:02AM |
Registered: 7 years ago Posts: 270 |
Quote
dc42
Hubberthus, thanks for that analysis. A few comments:
- The ARM specific assembly code in RRF is only there to provide a register and stack dump if an exception occurs, to help identify the cause. So it can be left out, or equivalent ESP32 code substituted.
- Even if a USB interface isn't needed, it's well worth keeping the UART pins available for debugging purposes, and to update the firmware when OTA isn't working.
- An 8-bit DAC provides enough resolution if it is used to feed Vref pins to set motor current.
- The problem with using I/O expanders is the increase in latency. They should not be used for signals to stepper motors. OTOH an I/O expander such as the SX1509B with built-in PWM capability that we use on the DueXn expansion board could be used to drive heaters, fans and Vref pins. The main limitation of that chip is that it can't do the low PWM frequencies that some SSRs and some fans need, or to generate a servo signal.
Re: ESP32 Printer Board November 07, 2017 11:35AM |
Registered: 10 years ago Posts: 14,685 |
Quote
newbob
SX1509B seems to be one the best (another one would be CY8C9520A for 2x the price). I am curious why led blink mode available on SX1509B would not drive an SSR?
Re: ESP32 Printer Board November 07, 2017 01:22PM |
Registered: 7 years ago Posts: 270 |
Quote
dc42
Quote
newbob
SX1509B seems to be one the best (another one would be CY8C9520A for 2x the price). I am curious why led blink mode available on SX1509B would not drive an SSR?
Because DC-AC SSRs need low frequency PWM (or low frequency sigma-delta modulation) to give predictable results. RRF uses 10Hz for them.
Re: ESP32 Printer Board November 07, 2017 03:07PM |
Registered: 10 years ago Posts: 14,685 |
Re: ESP32 Printer Board November 07, 2017 03:41PM |
Registered: 7 years ago Posts: 270 |
Quote
dc42
I'm sorry, I forgot that the SX1509B has a blink mode as well as a PWM mode. It does appear that the blink mode may be usable for this purpose.
Re: ESP32 Printer Board November 08, 2017 01:59AM |
Registered: 10 years ago Posts: 14,685 |
Re: ESP32 Printer Board November 08, 2017 12:01PM |
Registered: 7 years ago Posts: 270 |
Re: ESP32 Printer Board December 19, 2017 01:29PM |
Registered: 10 years ago Posts: 117 |
ESP-WROOM-32 1 - GND 2 - 3V3 3 - EN 4 - FAN_PWM1 5 - FAN_PWM2 6 - TEMP_1 7 - TEMP_2 8 - TEMP_B 9 - H1_PWM 10 - H2_PWM 11 - HB_PWM 12 - X_ENDS 13 - Y_ENDS 14 - Z_ENDS 15 - GND 16 - Z_PROBE 17 - SD_DATA2 18 - SD_DATA3 19 - SD_CMD 20 - SD_CLK 21 - SD_DATA0 22 - SD_DATA1 23 - SPI_SCK 24 - SPI_MOSI 25 - SPI_MISO 26 - MUX_ADDR0 27 - MUX_ADDR1 28 - MUX_ADDR2 29 - MUX_ADDR3 30 - SRV1_PWM 31 - SRV2_PWM 32 - NC 33 - GPIO21 34 - UART_RX 35 - UART_TX 36 - GPIO22 37 - GPIO23 38 - GND MUX CHIP 1 - DIR 2 - X_STEP 3 - Y_STEP 4 - Z_STEP 5 - E1_STEP 6 - E2_STEP 7 - XYZ_EN 8 - E1_EN 9 - E2_EN 10 - SPI_X_SS 11 - SPI_Y_SS 12 - SPI_Z_SS 13 - SPI_E1_SS 14 - SPI_E2_SS 15 - DIG_OUT1 16 - DIG_OUT2
Re: ESP32 Printer Board December 24, 2017 08:28PM |
Registered: 13 years ago Posts: 57 |
Re: ESP32 Printer Board December 24, 2017 10:17PM |
Registered: 13 years ago Posts: 57 |
Re: ESP32 Printer Board December 25, 2017 02:35AM |
Registered: 10 years ago Posts: 14,685 |
Re: ESP32 Printer Board December 25, 2017 10:15PM |
Registered: 10 years ago Posts: 117 |
Re: ESP32 Printer Board December 27, 2017 02:45PM |
Registered: 10 years ago Posts: 117 |
ESP-WROOM-32 1 - GND 2 - 3V3 3 - EN 4 - I2C-SDA 5 - I2C-SCL 6 - TEMP_1 7 - TEMP_2 8 - TEMP_B 9 - H1_PWM 10 - H2_PWM 11 - HB_PWM 12 - SPARE_GPIO 13 - Y_ENDS 14 - Z_ENDS 15 - GND 16 - IO_INT (MCP23S08) 17 - SD_DATA2 18 - SD_DATA3 19 - SD_CMD 20 - SD_CLK 21 - SD_DATA0 22 - SD_DATA1 23 - SPI_SCK 24 - SPI_MOSI 25 - SPI_MISO 26 - MUX_ADDR0 27 - MUX_ADDR1 28 - MUX_ADDR2 29 - MUX_ADDR3 30 - SPARE_GPIO 31 - SPARE_GPIO 32 - NC 33 - SPARE_GPIO 34 - UART_RX 35 - UART_TX 36 - TACH1 37 - TACH2 38 - GND I2C PWM CHIP 1 - E-REF-PWM 2 - XY-REF-PWM 3 - Z-REF-PWM 4 - FAN1_PWM 5 - FAN2_PWM 6 - AUX1-PWM 7 - AUX2-PWM 8 - AUX3-PWM MCP23S08 1 - E1_DIAG 2 - E2_DIAG 3 - X_DIAG 4 - Y_DIAG 5 - Z_DIAG 6 - X_ENDS 7 - Y_ENDS 8 - Z_ENDS MUX CHIP 1 - DIR 2 - X_STEP 3 - Y_STEP 4 - Z_STEP 5 - E1_STEP 6 - E2_STEP 7 - XYZ_EN 8 - E1_EN 9 - E2_EN 10 - SPI_X_SS 11 - SPI_Y_SS 12 - SPI_Z_SS 13 - SPI_E1_SS 14 - SPI_E2_SS 15 - SPI_IO_SS 16 - DIG_OUT1
Re: ESP32 Printer Board December 27, 2017 04:27PM |
Registered: 13 years ago Posts: 57 |
Re: ESP32 Printer Board December 27, 2017 05:19PM |
Registered: 10 years ago Posts: 117 |
Re: ESP32 Printer Board December 27, 2017 06:14PM |
Registered: 10 years ago Posts: 14,685 |
Re: ESP32 Printer Board December 28, 2017 10:05AM |
Registered: 10 years ago Posts: 117 |
Thanks! I missed that. Do you think the internal sense resistor system is good enough or should I add an external one?Quote
dc42
- The 2130 does support software-controlled motor current, it's the IRUN field of register 0x10
Cool.Quote
dc42
- You don't need separate ENN signals for each chip because you can disable drivers individually by setting TOFF to zero in the chopper control register. One ENN signal feeding all the stepper drivers is sufficient
This comes back to my latency question earlier. In the event someone is using stallGuard2 as an endstop, would the MCU be able to check all of the status registers in time to figure out which axis to stop?Quote
dc42
- It may be nice to feed the DIAG pin of each chip to the MCU individually, but it's not essential. They are open collector outputs, so you can tie them all together. When one of them signals a fault, the MCU can read the status registers to determine which one reported the problem.
Totally agree. I am just using other projects as starting points and reference. I plan on optimizing and improving the design several times before even making a single board.Quote
dc42
By all means look at other open source projects to get ideas, but don't assume that the designers of other projects got everything right or had the same goals as you. Many of the open source 8-bit controller board designs use the same bad choice of mosfet to control the bed heater, and I suspect that a poor choice made by one designer was perpetuated by others who copied that aspect of his design without checking whether it was a good choice or not.
Re: ESP32 Printer Board December 28, 2017 10:35AM |
Registered: 13 years ago Posts: 57 |
Re: ESP32 Printer Board December 28, 2017 10:43AM |
Registered: 10 years ago Posts: 14,685 |
Quote
CthulhuLabs
Thanks! I missed that. Do you think the internal sense resistor system is good enough or should I add an external one?
Quote
CthulhuLabs
This comes back to my latency question earlier. In the event someone is using stallGuard2 as an endstop, would the MCU be able to check all of the status registers in time to figure out which axis to stop?Quote
dc42
- It may be nice to feed the DIAG pin of each chip to the MCU individually, but it's not essential. They are open collector outputs, so you can tie them all together. When one of them signals a fault, the MCU can read the status registers to determine which one reported the problem.
Re: ESP32 Printer Board December 28, 2017 10:57AM |
Registered: 10 years ago Posts: 117 |
ESP-WROOM-32 1 - GND 2 - 3V3 3 - EN 4 - TEMP_1 5 - TEMP_2 6 - TEMP_B 7 - H1_PWM 8 - H2_PWM 9 - HB_PWM 10 - X_ENDS 11 - Y_ENDS 12 - Z_ENDS 13 - AUX_GPIO1 MTMS 14 - AUX_GPIO2 MTDI 15 - GND 16 - AUX_GPIO3 MTCK 17 - SD_DATA2 18 - SD_DATA3 19 - SD_CMD 20 - SD_CLK 21 - SD_DATA0 22 - SD_DATA1 23 - AUX_GPIO4 MTDO 24 - FAN1_PWM 25 - FAN2_PWM 26 - MUX_ADDR0 27 - MUX_ADDR1 28 - MUX_ADDR2 29 - MUX_ADDR3 30 - SPI_CLK 31 - SPI_MISO 32 - NC 33 - STPR_DIAG 34 - UART_RX 35 - UART_TX 36 - AUX_GPIO5 37 - SPI_MOSI 38 - GND MUX CHIP STPR_EN X_SPI_SS Y_SPI_SS Z_SPI_SS E1_SPI_SS E2_SPI_SS DIR X_STEP Y_STEP Z_STEP E1_STEP E2_STEP AUX_DO1 AUX_DO2 AUX_DO3 AUX_DO4
1 - AUX_GPIO1 2 - AUX_GPIO2 3 - AUX_GPIO3 4 - AUX_SPIO4 5 - AUX_SPIO5 6 - AUX_DO1 7 - AUX_DO2 8 - AUX_DO3 9 - AUX_DO4 10 - SPI_MOSI 11 - SPI_MISO 12 - SPI_CLK
Re: ESP32 Printer Board December 28, 2017 11:23AM |
Registered: 10 years ago Posts: 117 |
Too early to tell, but I will keep that in mind.Quote
dc42
Unless you are very tight on PCB space, I suggest an external one.
I think what I will do is have a 3 pin jumper for each of the X,Y, and Z TMC2130s. In the first position one of the DIAG pins is tied to the STEP_DIAG pin on the ESP32. In the second position that DIAG pin is tied to the appropriate endstop with a diode. The other DIAG pins will always be tied to the STEP_DIAG pin on the ESP32. This is based off figure 17.1 in the TMC2130 datasheet. The question is which pin to route to the jumper. Both DIAG pins can report a stall. The DIA0 pin always shows Power On Reset and can optionally show driver errors and temp warnings. The DIA1 pin can show when the micro stepper is at index 0, when the chopper is on, and when steps were skipped.Quote
dc42
Decide how and for what purposes you want to use stall detection. Take account of its limitations, which I describe at [duet3d.com]. If you just want to use stall detection for sensorless homing, you can enable stall detection just for the axis being homed, so you need only one MCU pin for the DIAG outputs. If you want to use it to detect missed steps too, then you can either poll the drivers continuously (which is what we do on the Duets, using DMA to keep the overhead low), or feed each DIAG output to a separate MCU pin. Either way, you may get false stall warnings at low motor speeds and you will need to have the firmware ignore them.
You could consider using the same MCU pin for both the DIAG output of a driver and the corresponding external endstop input, with a diode to prevent a 3-wire external endstop fighting with the open collector output of the driver.
The stall detection in the driver is only updated every 1 or 4 full steps depending on how you configure it, so aiming for super low latency stall detection isn't worthwhile.
Re: ESP32 Printer Board December 28, 2017 11:31AM |
Registered: 10 years ago Posts: 117 |
Re: ESP32 Printer Board December 28, 2017 11:46AM |
Registered: 13 years ago Posts: 57 |
Re: ESP32 Printer Board December 28, 2017 11:56AM |
Registered: 10 years ago Posts: 117 |
Re: ESP32 Printer Board December 28, 2017 01:04PM |
Registered: 10 years ago Posts: 117 |