Welcome! Log In Create A New Profile

Advanced

ESP32 Printer Board

Posted by CthulhuLabs 
Re: ESP32 Printer Board
December 28, 2017 01:43PM
Woohoo ! Awesome man ! damn thats a nice mill !

and even better that you have access to one lol

One day i will make one myself too, only need a very small one if im to do PCB's with it, as it wont need so much industrial-type power or torque..

Hmm there seems to be a problem with CircuitMaker's website - when i try to register/sign-up, the screen comes up blank.

is anyone else having this problem, ive tried using Google Chrome and IE to no avail and also used a VPN but still no dice sad smiley
Re: ESP32 Printer Board
December 28, 2017 04:57PM
Well I think I have the X Stepper Driver schematic setup. Not entirely sure I have VSA hooked up correctly or about the power filtering near it. Also need to add that diode to X_J1 pin 3, but not sure what type to use or how to hook it up.

Someone mind checking my work? NEMO - (V01)
Re: ESP32 Printer Board
December 29, 2017 12:00PM
ARGH !

This is completely annoying and quite disheartening quite frankly that i cant even sign up on CircuitMarker's own website...

@CthulhuLabs

Is there any way you could send me an image file, pitcure of the schematic and i will just port it into Eagle as i have been trying for 2 days now to either post a forum post on CircuitMakers forum to tell them that the Sign-Up page isnt working or to try 3 different browsers with all adblocking and such alike securities turned off, still no way to sign up or post a forum post because you have to be signed up in the first pace to post forum topics LOL

we got pastebin for sharing temporary copy/paste text, but they also have [filebin.ca] - file-bin so we can quickly and effortlessly share files/pitcures, i mean, if thats okay with you that you dont mind me using Eagle as i am having this much difficulty in even signing up, im wondering what other major problems i'll encounter with this platform..

Very sad really, i was very impressed with what CircuitMaker can do and the extra awesome features it has, ive even tried googling for the actual download file .exe to see if i can get the software via other ways and still nothing ! lol

this is what screen i get when i press the sign-up button;

Sign Up Page ScreenShot
Re: ESP32 Printer Board
December 29, 2017 02:40PM
@offtherails2010 PMed you.
Re: ESP32 Printer Board
December 29, 2017 03:06PM
@offtherails2010 could KiCad be an alternative ?
Re: ESP32 Printer Board
December 29, 2017 04:09PM
@CthulhuLabs, on your last pinout chart, GPIO35 (#7) is input only therefore will not output PWM.

Btw, how are you going to provide DIR, STEP and EN through demux? Doesn't CD74HC154M96 output one state at a time?

Edited 2 time(s). Last edit at 12/29/2017 06:49PM by newbob.
Re: ESP32 Printer Board
December 29, 2017 09:18PM
Hmm pretty sure I checked all the pins. Can switch it for the stepper diagnostic pin.

Also.... I'm a dumbass. Forgot that was a demux when I was assigning it functions and rolled with it. Well guess a PWM chip is coming back.
Re: ESP32 Printer Board
December 29, 2017 11:53PM
Quote
CthulhuLabs
@offtherails2010 PMed you.

Thanks loads man, really grateful for the help, i am in your debt man !!!
Re: ESP32 Printer Board
December 30, 2017 12:03AM
Well I fixed the issues newbob pointed out.
Re: ESP32 Printer Board
December 30, 2017 12:10AM
Quote
JustAnotherOne
@offtherails2010 could KiCad be an alternative ?

howdy Dude !

sadly i wont use Kicad as its just not complicated enough, i really do need alot of options and massive libraries for parts, i know Kicad is growing and getting much better than it was, but its like driving a Mercedes with Cadsoft Eagle, then going back to a Ford for kicad, you really don't want to use anything else once you've used Eagle lolz

i did use Kicad when i was starting my soldering & SMD Adventures, as well as Altium, Allegro, Easy EDA, PCB Webdesigner, Zenit PCB (similar to Eagle), and a LOAD of other software's for even really basic ones for stripboard/perfboard/veroboard and some dead simple copy & paste software 's lol

But after using and testing a whole host of software's, i always go back to Eagle (EAGLE = Easy Applicable Graphical Layout Editor !) lol

NOT Saying that any other software's are bad or not giving any of them negative feedback - its personal preference that i love using Eagle rather than any other..

I'd not heard about this one, CircuitMaker, its feature-rich so will give it a shot, if i dont like it i'll probably just port it over to eagle but will still work on it to geet used to the software as i dont want you @CthulhuLabs to start bothering yourself to learn a new software, most people dont want to do that but i dont mind, i'll use anything as long as it lets me create awesome PCB's !!!

Also as for the Routing of Kicad, it really does look very basic, where i need traces upto the tolerance levels of the manufacturer, 0.6mm precision
Re: ESP32 Printer Board
December 30, 2017 12:23AM
Tempted to switch to a 16bit GPIO chip. It would allow the board to have DIR pins for every stepper. Also they are maybe 10cents more per chip.
Re: ESP32 Printer Board
December 30, 2017 12:38AM
16 bit ? like what, could you furnish me with an example please ? Atmel ? ST ? Ti ?
Re: ESP32 Printer Board
December 30, 2017 12:55AM
16bits of GPIO like this guy:
[datasheet.octopart.com]
Re: ESP32 Printer Board
December 30, 2017 01:53AM
@CthulhuLabs

Awesome man ! Cheers !

the software is just installing now so i think it'll take me a few short hours to sort out the 3D Printer when it arrives but in the meantime i can check out your PCB smiling smiley
Re: ESP32 Printer Board
December 30, 2017 06:04AM
@CthulhuLabs

MCP23017/MCP23S17 is a very nice microcontroller, ive seen its only 10 Mhz clock speed, would that be okay to use or would it be slow ?

Atmel Atmega328P-PU chips can be overclocked to 20 Mhz

Silicon Labs contender, where it is only 8-bit too, it has built-in USB capability without needing another IC ==--->> The C8051F320 (which this IC was on a Liquid Cooling System) and this is running at 25 Mhz - wow !

This last microcontroller is a dated one, there are no doubt much better ones available these days, It was included in a PCB made for Thermaltake's BigWater 780e all in one 3-bay Watercooling Unit. i already had the 2-bay unit and acquired the BigWater 780e 3-bay unit from ebay, second hand
Re: ESP32 Printer Board
December 30, 2017 07:43AM
Given the shortage of I/O pins on the ESP32 and the issues with its ADC, maybe it would be simpler/cheaper to use a ATSAM4S microcontroller and ESP8266? It would take very little work to make RepRapFirmware run on that combination.

Edited 1 time(s). Last edit at 12/30/2017 07:47AM 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.
Re: ESP32 Printer Board
December 30, 2017 10:15AM
ATSAM4S looks great and is not that expensive - strange that there were no controller boards made even though it's been out for three years and it's 79GPIO should be enough for any kind of printer controller. Compared to ESP32, ATSAM4SA16BA-MU is twice the price, 1/2 less flash and probably 1/4 speed (EDIT: SAM4S 180 DMIPS vs 600 DMIPS ESP32 vs 125 DMIPS SAM3 in Duet.)

as to IO expanders:

SX1509B - is my favorite , it's also used in Duet WIFI. I2C port expander with hardware PWM and blink functions. Lots of code examples available in C and Arduino.
SX1512B - same as SX1509B but with SPI interface. Not as popular, more expensive and harder to obtain.

MCP23S17 - is great if you are OK with doing PWM in software. Is't unique feature are two interrupts that that can be configured to fire on every state change or when state does not match a register. When using two of them (for 4 interrupts) interrupts could be configured to trigger for endstops when homing for low latency response (avoids pulling registers through SPI interface). Alternatively one interrupt could be used for all endstops but that's not optimal for delta style printers.

Edited 1 time(s). Last edit at 12/30/2017 10:46AM by newbob.
Re: ESP32 Printer Board
December 30, 2017 12:26PM
Quote
newbob
ATSAM4S looks great and is not that expensive - strange that there were no controller boards made even though it's been out for three years and it's 79GPIO should be enough for any kind of printer controller. Compared to ESP32, ATSAM4SA16BA-MU is twice the price, 1/2 less flash and probably 1/4 speed (EDIT: SAM4S 180 DMIPS vs 600 DMIPS ESP32 vs 125 DMIPS SAM3 in Duet.)

I think I first said on these forums around three years ago that the SAM3S would be a good MCU to use in a 3D printer controller if Ethernet is not required, and more recently that the SAM4S would be a good one to use. I wouldn't use the ATSAM4SA16BA, which has not enough pins and more flash memory than required. I'd use the ATSAM4S8CA instead. 512Kb flash is plenty, that's what all the Duets have and we're not anywhere close to filling it up.

I suggest you view the ESP32 DMIPS figures with caution. Like the ESP8266, program code has to be fetched from external flash memory over a slow SPI but into local RAM to be executed. The DMIPS figure is almost certainly quoted when all the code being executed is in the RAM cache. I had a quick look at the ESP32 datasheet but I didn't find any mention of how large the RAM cache is.

Also consider the quality of the documentation. the Atmel/Microchip documentation is excellent. When I was writing the WiFi code for the ESP8266, I was hampered by the exceedingly poor hardware documentation. To drive the HSPI interface I had to use data that has been reverse engineered by users.

Quote
newbob
as to IO expanders:

SX1509B - is my favorite , it's also used in Duet WIFI. I2C port expander with hardware PWM and blink functions. Lots of code examples available in C and Arduino.
SX1512B - same as SX1509B but with SPI interface. Not as popular, more expensive and harder to obtain.

MCP23S17 - is great if you are OK with doing PWM in software. Is't unique feature are two interrupts that that can be configured to fire on every state change or when state does not match a register. When using two of them (for 4 interrupts) interrupts could be configured to trigger for endstops when homing for low latency response (avoids pulling registers through SPI interface). Alternatively one interrupt could be used for all endstops but that's not optimal for delta style printers.

I've somewhat gone off the SX1509B I/O expander because of its limitations. In particular, the latency is high (you can get an interrupt when an input changes, but then you have to do an I2C transaction to find out which one(s)), they tie up the CPU for longer than I am happy with when doing transactions (it's the same for any I2C device), and they provide limited control of the PWM frequency which is a problem for some fans.

Edited 1 time(s). Last edit at 12/30/2017 12:27PM 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.
Re: ESP32 Printer Board
December 30, 2017 02:05PM
@offtherails2010 I think I confused you which has gotten this thread somewhat off topic. I added a GPIO expansion chip to make up for the lack of GPIO on the ESP32. The chip I choose is 8bit. Meaning it has 8 GPIO pins on it. I am thinking of replacing it with a 16bit GPIO chip as that will allow me to put DIR pins for all the steppers.


Now as for MCU's, some of the reasons I choose the ESP32 are that it is running FreeRTOS, is fast, has something like 520k of internal SRAM (4x the SAM3S), some of this SRAM can be used for caching the external flash, and has 32kB of cache per core. Admittedly the GPIO pins are somewhat limiting, but I think the above specs make up for it.

With regards to the IO expansion chip I choose an SPI one as it is faster than I2C, the SPI bus on the ESP32 I have mapped through the low latency IO_MUX and not the GPIO_MATRIX, and it can be DMA mapped in the MCU. This should hopefully yield good IO performance from it. It also does not need to do any PWM because the ESP32 as I was able to fit the PWM on the ESP32 itself.

@dc42 - Please take a moment to look through the ESP32 tech ref doc.. As for the ADC, the are not linear, but there is a lookup table now for them so it isnt really an issue.
Re: ESP32 Printer Board
December 30, 2017 02:25PM
Howdy Guys smiling smiley

Firstlly i love THIS Microcontroller, ATSAM4S !

Also if we would be theorising about using a non 32 bit ESP module, couuld we possibly use an ESP that has a U.FL Pigtail to SMA connection on the board so we can attach a higher gain aerial/antenna ?

i have some of those male U.FL PCB connectors so can put them onto boards that dont have them and omit using the PCB aerials, but the ESP's that already come with it like the ESP-07 would be a perfect fit - the ESP-07S i think, its the one without the chip-antenna, like this also they are very cheap

Secondly, i know we are still ironing out viability with checking out what would run and what wouldnt, im asuming we will STILL be usiing the TMC2130 Stepper Drivers ???

Being run via SPI, the ATSAM4S only has 3 SPI lanes, so only 3 stepper motors can be used unless one uses 2 for the Z axis, then throwing another TMC2130 into a Parallel configuration i think should also be included in this board..

That still isnt enough though for this microcontroller, any idea's how we can get this ATSAM4S to work for us ?

Also upon further investigation into the TMC2130 IC's, there is an eTQFP48 which has amperage ability to go to 1.4 amps as opposed to 1.2 amps on the QFN36 package SMD Stepper driver...

So appears the eTQFP Can use slightly higher Amps, plus i really love the feature where it corrects missing steps or if the print head and nozzle moved accidentally by nudging into the printer, this is really shweet !

Yes it is more work using the RAW IC's instead of the pre-soldered ones, but if the pre-soldered ones are cheap enough then tbh i wouldnt really care if they are clones or not from China, as long as they work as advertised plus my income is non existant atm, so i would be very likely to buy everything i need from Aliexpress/Ebay/Banggood etc

So how do we wire up the TMC2130 Drivers, if anyone can show me how to do one, then i can go about doing the rest smiling smiley

@CthulhuLabs

ive had so much trouble with CircuitMaker that im just going to throw this stuff into Eagle but also work on the CircuitMaker to still give it a fair chance, minus the major startup problems, even after which the scheatic of yours diddnt open up which was high infuriating, but being windows, all it finally took was a restart of the craptop....

So integrated TMC2130's which would ya'll go for ? - the 1.2A or 1.4A version ?? The 1.4A version by the way, can be easily hand-soldered where as the 1.2A version would need a hotplate/heatgun plus somme specialist tools and solder paste - i only ever use Lead-Free solder and solder none of my designs have Lead in them...

So what you guys think about this lots ? lol

Edited 2 time(s). Last edit at 12/30/2017 02:45PM by offtherails2010.
Re: ESP32 Printer Board
December 30, 2017 02:51PM
@CthulhuLabs

ahh i getcha now, yaa sorry imm back on the same page hehe, yeap id rather have the ESP32 since youve made the argument pretty clear for the pro's outweighing the con's smiling smiley)

Also apologies i had completely missed the mention of the SPI GPIO Expansion IC, all the problems and head scratching i got from CircuitMaker not working right outta the box kinda messed my head about a bit..
Re: ESP32 Printer Board
December 30, 2017 03:34PM
Quick Question for the MCP23S17 SPI Expander;

in the datasheet it shows that its speed is 10Mhz MAXIMUM, would this become a problem for a 3D Printer being a bottleneck ??
Re: ESP32 Printer Board
December 30, 2017 03:48PM
Thanks everyone, wishing you all a very happy new year into 2018, may fortune & prosperity follow your every footsteps smiling smiley
Re: ESP32 Printer Board
December 30, 2017 03:55PM
Quote
offtherails2010
Howdy Guys smiling smiley

Firstlly i love THIS Microcontroller, ATSAM4S !

Also if we would be theorising about using a non 32 bit ESP module, couuld we possibly use an ESP that has a U.FL Pigtail to SMA connection on the board so we can attach a higher gain aerial/antenna ?

The ESP-07S is suitable. I converted a Duet WiFi to use one and published how to do it on the Duet3D wiki. A few other Duet WiFi owners have done this too.

Quote
offtherails2010
Secondly, i know we are still ironing out viability with checking out what would run and what wouldnt, im asuming we will STILL be usiing the TMC2130 Stepper Drivers ???

Being run via SPI, the ATSAM4S only has 3 SPI lanes, so only 3 stepper motors can be used unless one uses 2 for the Z axis, then throwing another TMC2130 into a Parallel configuration i think should also be included in this board..

That still isnt enough though for this microcontroller, any idea's how we can get this ATSAM4S to work for us

You can use a single SPI channel for all the drivers, that's what the CS pins are for. On the Duet WiFi we use one SPI channel to communicate with the ESP8266, one to control up to 10 stepper drivers, and one for accessories.

Edited 2 time(s). Last edit at 12/30/2017 03:56PM 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.
Re: ESP32 Printer Board
December 30, 2017 10:53PM
Any recommendations on MOSFETs or USB-to-UART to use?
Re: ESP32 Printer Board
December 31, 2017 03:21PM
Switched out the gpio ic last night for the 16 but one.
Re: ESP32 Printer Board
January 02, 2018 05:49AM
Quote
offtherails2010
Quick Question for the MCP23S17 SPI Expander;

in the datasheet it shows that its speed is 10Mhz MAXIMUM, would this become a problem for a 3D Printer being a bottleneck ??

In my experimental ESP8266 + MCP23S17 + MCP3008 + Marlin + Duet Web Control "Frankenstein project" I tried it out and yes, it is a bottleneck.

Well of course with the ESP32 it would be much more efficient but you still have some time lag. Putting both the "step+dir" and "endstop" pins is clearly a disaster, even with the MCP23S17's hardware interrupt.
Because reading in the interrupt info + writing out new stuff takes some time.
For the ESP32 the interrupt pins can be direct GPIOs, but you still have a lag for the output on the expander.
This lag is very small, but to compensate, the movement code has to be slower than it would normally be in order for the reaction to be precise.

Of course the endstop is not used that much, so this can go to "ignore" during printing, and then prey. smiling smiley
Re: ESP32 Printer Board
January 02, 2018 06:34AM
A small amount of lag on the endstop inputs doesn't matter because the firmware can do a fast initial homing followed by a slow precise homing. High precision in homing isn't important unless either you are trying to implement resume-after-power fail so that you need highly reproducible endstops positions, or you are homing a delta printer and not doing auto calibration between homing and printing, or you are homing Z on a Cartesian or CoreXY printer to an endstop and not using a Z probe to correct the Z=0 position.

Putting step pins on an I/O expander is certainly a very bad idea because you need to be able to write step pulses very quickly. I wouldn't put direction pins on an I/O expander either.

I am surprised that you are running out of pins, because when I did an initial investigation of the feasibility of using the ESP32 to control a 3D printer, I came to the conclusion that it had enough pins without using an I/O expander if you accepted that there would be very little expansion. That included setting the motor currents in firmware using PWM output pins, whereas the TMC2130 drivers don't need those pins. Given the poor ADC performance of the ESP32, have you considered using an SPI ADC and connecting everything else directly to the ESP32?


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.
Re: ESP32 Printer Board
January 02, 2018 09:15AM
With the precision I was thinking especially about delta printers. And yes, of course a Z probe would also need some precision.

The expander very surprisingly gave better results with the PWM than I expected, but that is constant SPI usage. I just did an experiment, see what it can do. Some steps were skipped randomly.

Ah, don't be surprised, I'm just still stuck with the old-fashioned way of thinking, because I have a bunch of A4988 -s and dunno what to do with them grinning smiley
The best option is what you say, TMC2130 or anything which uses SPI.
And the SPI ADC can be used if the ESP32 ADC really has very poor performance.
Re: ESP32 Printer Board
January 02, 2018 09:56AM
@dc42 the difference between my design and yours is that I have two extruders and am trying to have a small amount of expansion.
Sorry, only registered users may post in this forum.

Click here to login