Neumi / ethersweep

Open Source, easy to use Ethernet connected stepper motor controller. Built in FreeCAD, KiCAD and Arduino.
Other
476 stars 56 forks source link

Design feedback #18

Open pylogger-html opened 9 months ago

pylogger-html commented 9 months ago

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.

Crazy ideas:

Neumi commented 9 months ago

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. USB PD was on the list of requests but I didn't want too many chips/complex parts on the board for now and keep them all on one side for cost reasons. Maybe this could change in the future. (but for now, keep complexity low) The Ethernet software update would be very cool. But it should be easy to understand and doable for the average maker. ESD/EMI protection was not really taken care of due to a lack of knowledge and testing equipment. Tag-connect is cool, but I think having USB is also cool if you only need to run one Ethersweep controller from your computer. Not using the USB/Serial bootloader feels like a waste of potential. A 2% oscillator would most likely be okay. It might be good to free up some space. The pin headers have to be 16mm long. I'm not sure if you get them with the low pitch. So I kept the normal ones. J2 is an xt30 connector. Standard in RC copters and planes and some motor controllers. Maybe this could change to a more professional/strain-reliefed connector.

Thanks again!

gchenfc commented 9 months ago

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!

pylogger-html commented 9 months ago

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 foo = ethersweep() foo.connect(ip=192.168.1.55, port=8888) foo.info() # returns motor SN, sw/hw rev, maybe a user configurable name foo.getpos() # returns the stepper angle foo.hold() # holds current position foo.getStatus() # returns currents/voltages foo.setpos(angle=33.3, angPerSec=0.1) #you can use **kwargs to define several possible parameters, like deltaAngle, absAngle, moveTime. This way you don't have a ton of required parameters) foo.close()