simon-jouet / ESP32Controller

ESP32-based 3D printer controller
120 stars 29 forks source link

R2 - Routed PCB #6

Closed Ringel closed 5 years ago

Ringel commented 5 years ago

Great project - to play with it, i've designed the board out of your schematic. I've routed to 4" x 3.25" - 2 Layer board with 0.17mm Trace/Space width.

kkszysiu commented 5 years ago

Awesome @Ringel

simon-jouet commented 5 years ago

Thanks @Ringel I will have a look at that in a bit more details when i get some time this week :)

simon-jouet commented 5 years ago

Hey @Ringel going through the changes in the schematic, I've noticed the therm2 line that you've fixed, any chance you could point out the other changes you've made if you don't mind (so i can bring them in knowing what it is :))

I like the PCB layout, very few lines on the bottom plane which is great. I've got a few concerns though (some that might be irrelevant) but it's clearly a good start

And some other stuff that needs some thought from all of us :)

Out of curiosity is this handrouted or you used an autorouter?

Ringel commented 5 years ago

I've noticed the therm2 line that you've fixed, any chance you could point out the other changes you've made if you don't mind (so i can bring them in knowing what it is :))

Hello @simon-jouet. Mirror the jumpers J16-J20 and therm2 was the only schematic change - for further changes i've used my r3 branch.

I like the PCB layout, very few lines on the bottom plane which is great.

A good GND plane was one of my goals

* The ESP32 placement should likely be in the corner in order to follow the design guidelines 

Corner Placement might improve antenna performance, but makes escape routing for the side pins harder and costs some more precious side-space. But current placement respects at least the keepout areas.

* The current I2S lines are quite long as they cross most of the PCB, i'm wondering if this will cause some noise considering the frequency?

If we keep J6 it's easier to long-route I2S and serial. Having a closed GND plane, the should be minimal cross talk.

* To optimise the space I think J3/4/5 should be side by side like on RAMPS boards. I should probably have made a conn_03x03 symbol/footprint

For productive PCBs without J5/J8 it could be much more compact. I'd also prefer 5mm pitch screw terminals and micro USB to have more edge.

* I don't know if the connector for power + mosfet should be on the edge, I was trying to avoid that previously because if you mount it on the side of a printer (for instance a prusa) then the wires going out will likely interfere with the motion. 

The 24V should only be used at 2 L-shaped sides for clean routing - not interfering the inner PCB with 24V. If the bottom side is used for the motors, the 24V input and FET outputs should fit on the right.

* Should we put the huge I2S and esp32 breakout connectors (32 pins) on the edges? connecting anything to them if they are in the middle will likely result in quite a ratsnest.

For productive version we should only connect unused pins to the connector - maybe ~15 pins from the shift registers. An ideal PCB has all connectors at the side - maybe even angled to have a low profile. And nothing on top to interfere with the airflow of the driver cooling fan ;)

* Should we change the jumper connector for the 5V source of the LDO to use a comparator + FET like the arduino (not sure it's very much worth it?)

A diode from VUSB should be sufficient - to only draw current from USB if there is no 24V supplied. (e.g. for programming)

Out of curiosity is this handrouted or you used an autorouter?

Handrouted. Routing isn't the most afford - i use most time for placement ;)

simon-jouet commented 5 years ago

For productive PCBs without J5/J8 it could be much more compact. I'd also prefer 5mm pitch screw terminals and micro USB to have more edge.

The previous version used micro USB and I still have about 90 left from the previous batch but the issue is that the board is too heavy and the connector strip from the PCB and pull the tracks... That's why I went for a type B connector instead. A through hole (at least for the USB shield) micro B might be okay. I guess we could go for a type C connector too, it's the most resilient of all USB connectors and they are quite cheap now.

Any suggestions on the power connectors? We could do it the same way as the Duet use, it would save quite a bit of space compared to the current ones:

For productive version we should only connect unused pins to the connector - maybe ~15 pins from the shift registers.

Yeah I agree with that, at the moment i'm exposing everything because it will be helpful to test stuff that isn't too settled yet. I guess we could do this one already as I doubt there won't be much at all to experiment with the stepper drivers.

Can you have a look at some of the other points i've made in the previous message, having your input will be helpful (one was about the power connector which you've raised here too). I think the next step would be to get a new board with most of those points addressed, so we can test out the remaining things (for instance running the mosfet from I2s) once that's done we should be able to make a more user friendly (and smaller) PCB. If you are keen on that, I could to give you access to this repo so we can keep working in one consistent place instead of having multiple forks that we need to sync :)

Ringel commented 5 years ago

Hello @simon-jouet

I guess we could go for a type C connector too, it's the most resilient of all USB connectors and they are quite cheap now.

Type C seems to be best option ... found some 16 Pin ones that might fit.

Any suggestions on the power connectors? We could do it the same way as the Duet use, it would save quite a bit of space compared to the current ones:

4 Screw terminals for supply and bed should handle the current. Maybe KF7.62

At the moment the power rail is split for the BED and the rest, we could have a single connector for the board but I do think two is nicer

I'm always using only 24V fans/heaters - so single connector is fine for me.

* KF128 with 3.50mm pitch for the heater/fan

For the < 3A Outputs (heater, fans,...) Dupont connectors or JST XH (used by most fans) should be enough. A single connector could carry everything for the hotend/effector (2 fans, temp, heater, z-probe) - and could ease the wiring.

Can you have a look at some of the other points i've made in the previous message

We might need more current on the stepdown - maybe the popular TPS5430 for several amps.

I think the next step would be to get a new board with most of those points addressed, so we can test out the remaining things (for instance running the mosfet from I2s) once that's done we should be able to make a more user friendly (and smaller) PCB.

My r3 PCB's should arrive end of the week - using 2 of the i2s at 5V to drive the mosfets. Maybe i can even setup the display.

If you are keen on that, I could to give you access to this repo so we can keep working in one consistent place instead of having multiple forks that we need to sync :)

Merging shouldn't be that of a problem ... at least when the schematic is settled little more.

vivian-ng commented 5 years ago

I tried using the I2S outputs for LCD pins, but it doesn't work (at least, not for LCD_D4, D5, D6, D7 pins). I will see if I2S works for BEEPER, LCD_EN, and LCD_RS pins.

Update: Trying to use I2S outputs for BEEPER, LCD_EN, and LCD_RS pins didn't work too.

simon-jouet commented 5 years ago

I've pushed an updated schematic. It's now split into different sheets to make things cleaner

4 Screw terminals for supply and bed should handle the current. Maybe KF7.62

That's what I used in the R1 but people complained that the connector was too wide (I like it because we can use spade connectors)

My r3 PCB's should arrive end of the week - using 2 of the i2s at 5V to drive the mosfets. Maybe i can even setup the display.

Did you get your board :) ?

@vivian-ng Are you sure your I2s stream is working properly? I would have thought the LCD was slow enough to work with the i2s stream. Which pins are you using? You should likely use pins 16-32 (the third and fourth shift register) if you use the first two registers then it's expected for it not to work (because its used by the i2s stream for the steppers) -- read the i2s MR there should be details on the difference between the two channels

Ringel commented 5 years ago

I've pushed an updated schematic. It's now split into different sheets to make things cleaner

@simon-jouet Great - stepper pinout seems to fit my r3, and everything from the discussion is integrated ;)

* The buck converter is now a TPS5430 (thanks @Ringel for the suggestion)

You might want to use the placement and copper planes from the example in the datasheet.

* Still need to change the breakout header for the ESP32 to simplify the routing

Yes - but your Placement looks quite compact - nice!

Did you get your board :) ?

Arrived yesterday ... but hadn't the time to solder it. I'll report if i can get it up.

Ringel commented 5 years ago

Unfortunately i have ordered the 74HC595D with SOIC16 footprint - but have placed TSSOP16 footprint only fitting 74HC595PW.

@simon-jouet: Do you prefer the smaller 74HC595PW you placed too over the easier to solder (and source) but double the length 74HC595D?

Fortunately i've just found some 74HC595PW at ebay.

simon-jouet commented 5 years ago

@simon-jouet: Do you prefer the smaller 74HC595PW you placed too over the easier to solder (and source) but double the length 74HC595D?

I picked the tsop16 package at the time because pricewise it was the same and the tsop package is smaller. I think TSOP16 is still fairly reasonable to handsolder so I will stay with that for the time being.

I got 40 of them coming from aliexpress but I can see them in stock also in farnell/rs so getting a hand on some shouldn't be too complicated (on farnell they are actually cheaper by a fraction than the soic package)

Hopefully I get the routed PCB pushed this week, I'm almost there, mostly the routing around the ESP32 that's left to do/improve

simon-jouet commented 5 years ago

Okay I just pushed the fully router R2, hopefully there isn't too many mistakes... Just ordered 10 on JLCPCB for $5.45 (not sure how pcbs can be so cheap)

The 3d render if anybody is interested

Screenshot_2019-07-05_19-13-01

Ringel commented 5 years ago

After fiddling with the pins-file i've got some progress in my r3 board running yesterdays Marlin/bugfix-2.0.x

Maybe we should close this PR ... and move discussion to another issue;)

simon-jouet commented 5 years ago

Temperatures are somehow working - 100°C are quite accurate. but disconnected shows 26°C and Ice-Water is measured between 30-50°C

Temperatures above ~30ish should be working fine, the issue is that the reference voltage for the ADC is 3.3V but the ADC will still return the highest value up to around 3V IIRC so you can't measure low temperatures. I didn't put too much effort in that at the moment because not being able to measure low temps is not very critical.

Steppers work most of the time Evey 4ms there is no Out-signal for 4 BLCKs Sometimes after a stop the steppers are continuously (very slow) driven - even after motor disable time there is an enable for 4 BLCK's with a step inside. Maybe there's something wrong when changing DMA blocks?!? @simon-jouet did you ever experience something like that?

Considering the timing I would say it does sound like something to do with the i2s stream. I'm surprised you have no signal for 4bclks, I don't remember seeing this. Could be some changes to the HAL, I haven't touched it in a while. I will have a look see if I have the same issue. But before no i've never had anything like that although I don't have many hours printing over i2s.

Fan FET are't driven at all - there is just no signal in the i2s stream. Need to dig deeper in the left/right signal and Pin numbering.

Someone might have modified the upstream HAL but IIRC in my latest commits the higher 16 bits of the I2S stream was the constant value. so you any pin 144+ should work for that (although that might depends on how Marlin does it, i can't remember from the top of my head). The easiest to test the upper 16 bits is to use M42 IIRC

Besides OTA the websocket-serial doesn't seem to work - maybe the website doesn't fit the server.

It definitely used to work at some point. I will try that when i get my board soldered (@Idorobots said it was working fine, in marlin #14345)

Yeah let's close the PR and we can start an issue do discuss that