-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design feedback #18
Comments
Very good and valuable feedback. Makes sense to me and I will change it on the next version. The RP2040 might be a good candidate. I only knew it running micro python and didn't like it. Having two cores with C++ would actually be very beneficial for the motor control. Thanks again! |
Just a quick note on RP2040, IIRC its ADC is not super great; something like 1 hardware ADC multiplexed to 3 pins and low bit resolution. I haven't looked at your stepper driver code to see how much real closed loop servo control you're doing, but I did see you have a pair of shunt resistors so the RP2040's ADCs might not be suitable depending on the accuracy you're targeting. Also would like to upvote the ESD protection - adding protection and ideally opto-isolating anything going in/out. Not sure about the projects you typically do, but in my medium-sized projects, anything without opto-isolation of communication ports always blows up eventually due to EMI & ground loops. And this is an unrelated comment, but I personally would love to see (eg in README's):
Super cool work and I'm really excited by this! |
Yeah, that's a good point about the ADC. You can improve the accuracy a bit (https://youtu.be/F0o1C7nEgw0?si=pLa2Wp7sBuP2In6G&t=422), but still the number of channels is kinda rough compared to the STM32. Getting the UART output working with the RP2040 in C/C++ is super easy and you can redefine the USB descriptor if needed (vid/pid/sn/description can all be redefined with pre-processor macros). Can't really say if ethernet will be easy or not, but Bluetooth was pretty simple. I agree that Opto-isolators would be great, but it'll be tough to do that for every stepper motor signal. RX/TX are easy, but then you have the analog signals to worry about (current shunt voltages, power supplies, etc). Totally doable, but you'll probably have to totally redo the layout. Couple more items:
*RF chokes are nice to have on your supply. You can use to block conducted emissions from cables or isolate some part of your analog circuit (can improve ADC performance). SW - STM32 code
SW - I looked in python on the master/main branch
from ethersweep import ethersweep
|
I just saw the youtube video you posted and it looks like you've made a lot of good progress on this project. I decided to check out your schematic/layout and here's some feedback. I just did a quick review of it, so if I got an old design let me know (I went dev and the latest "complete looking" board).
I did not review the firmware, but I do have some STM experience so maybe I'll be inspired to do that later.
You should start using 0201 components for all your smaller cap's (anything below 100nF) and small resistors (pull-ups, 0 ohm jumpers, etc). Most fab places do not charge extra anymore for this size (jlcpcb hasn't for several years) and those parts can be cheaper sometimes than 0402's. I realize reworking 0201's is tough, but for all the little bypass caps you probably won't be reworking those. Plus the design seems more refined now.
100mil is standard for headers, but they do make 50mil headers. Might save you some room if you're doing a multi-board thing (you make the LCD board right?)
Kicad now supports multiple sheets in version 7.0, so you could split up the schematic into logical blocks (maybe power, uC/com/display, motor control). The board isn't too complex though, so it's kind of a toss-up.
The routing around C38 is really tight, but you have tons of room on the back layer below it. Same with the motor controller (C40, D6, D5, C11 could all go on the back side. keep the 100n bypass caps on the same side)
J2 didn't load for me, but is this just a 2-pin terminal block? (the green connectors with screw adjusts)
Do you really need an 8MHz crystal? The STM32 has a decent (+/- 2% over full temp range) RC oscillator called the HSI that runs at 8MHz. This would save you a bit of cost and a "giant" part in the middle of your board.
If you want an easy flashing header that adds zero cost, look into tag-connect. Another option would be writing a little bootloader in the STM32 that has just enough code to do ethernet IO & flash memory. Then you could do all the programming entirely with ethernet (you flash the bootloader via a header, then upgrades are done via ethernet).
** To do this you can create a separate linker file and relocate your code somewhere else in memory. The STM32 will boot into the bootloader, the bootloader will check the "upgrade image" and if it's okay boot from it. Then you just need a mechanism to revert back to the upgrade image if needed (push button maybe?)
You should look into adding ESD/EMI protection to all exposed ports and accessibly supply rails (probably 5V, must you can skip 3.3V). There are single chip options for USB and you'll need them for the stepper motor driver. The TMC2209 has example protection circuitry in the datasheet that you should have. Aim for at least 16kV rating on the ESD stuff (32kV would be better, but it isn't required).
Crazy ideas:
Switch to USB-C for power and get one chip that drives the CC1/2 lines so you can get 28-48V via USB power delivery. Yeah, I old PD 3.0 doesn't go past 20V, but the new USB PD standard supports 28V/36V/48V at up to 5A. You can still use the DP/DM lines for the UART. Here's a chip that'll do PD 3.1 (28V): https://en.hynetek.com/pddrp.html HUSB311
I know you just switched to a new uC, but have you looked at the RPI Pico? It has a dual core M0 running at >100MHz and it's cheaper than the STM ($0.97 vs $1.41 at JLCPCB, although you'll need a crystal & flash for it - so probably same cost). The C/C++ API for the RPI Pico is really well tested and you can probably port a lot of code. No motor controller though, so you'll probably need to dedicate one core to the motor/feedback sensor.
For the ethernet control format, how about supporting a queue of commands with precise timing? You could then build up a small language of motor operation and queue them all up on the controller (ex: sweep 20 degrees at x steps/s, wait 40ms, repeat 10 times)
The text was updated successfully, but these errors were encountered: