Code Monkey home page Code Monkey logo

Comments (3)

gchenfc avatar gchenfc commented on May 26, 2024 2

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):

  • timing precision / latency + reliability (# packets lost) tests, ideally with e.g. 3 motors running simultaneously, including with motors enabled since EMI is presumably significant
  • rough bandwidth figures you'd be able to achieve - I assume 100Mbps ethernet so maybe 250Hz or something? Not sure
  • a rough JLCPCB cost estimate in one of the README's would save the trouble of uploading the zip to jlc to investigate whether I want to more seriously consider trying out a run of these boards
  • schematic & board pdf's uploaded to github, so I can do a review without cloning :)

Super cool work and I'm really excited by this!

from ethersweep.

pylogger-html avatar pylogger-html commented on May 26, 2024 2

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:

  • You're using a ~300uF aluminum capacitor which I think has <1A ripple current rating (my translated datasheet for the part could be wrong), but you're probably using more than that to drive the stepper. Aluminum polymer caps can do 5-10x more current, they're more reliable, have better failure modes, but they cost more. You can probably get away with a bit less voltage de-rating too (I have a commercial design with 35V alum-poly caps running at 33V). The DC current isn't the issue here, but the instantaneous peak current you're getting from the cap and how often that happens.

  • I saw in one video that you cut PCB's with a saw. If you do that, be sure to wear a mask due to the harmful dust. A paper cutter can work too and should easily slice through thinner boards (32 mil should be easy, might need a few passes for 62 mil)

*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

  • wow, I didn't realize arduino like stuff would run on the STM32. I thought you'd go the STM32IDE & STM32CubeMX route, but a networking stack would be a challenge. I don't do much work with this API, so I'll skip this.

SW - I looked in python on the master/main branch

  • You've got your venv in version control (venv should always be in your .gitignore and never in a commit). You should have a setup.py for your project or requirements.txt to build your venv. You can do "pip freeze > requirements.txt" to generate this and it'll help if anyone else runs this. I like to do some had refinements of mine to just have the few high level packages I actually need and let the maintainers deal with dependencies.
    ** pycharm should recognize these files once you have them and it'll make setting up your project on another machine really easy.

  • I recommend making an "ethersweep" python package that has a central class object and member routines that abstract the details of sockets, command formating (json, url's, etc). For development you can install this as a local editable module with "pip install -e ." provided you have a setup.py. Your code would then do something like this:

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()

  • Once you have this basic framework going, you'll need automated tests (to test python & your firmware). I like using pytest and I can give you a ton a tips when you get to that stage.

from ethersweep.

Neumi avatar Neumi commented on May 26, 2024

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!

from ethersweep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.