Building a DIY public domain low cost stepper motor analyzer
-
@T3P3Tony said in Building a DIY public domain low cost stepper motor analyzer:
@zapta this is a great project! thanks for documenting it as you go through. Worth a submission to hackaday once complete I think!
Hi Tony, yes I plan to do that, to get more awareness. My goal is to provide a baseline hardware and firmware such that more knowledgable and creative people can use to provide useful tools for the community.
-
After procrastinating on this project for some time I realized that having to implement the UI with a low level screen API was distracting so I decided to switch to a smart touch display (Nextion 4.5") and things started to move fast. Here are a few pictures with the current state. Next I plan to redesign the PCB for the new LCD and clean up the UI.
The old PCB with connected to the new display:
The home screen with summary data:
The setup screen. It allows to set the zero current and to reverse the steps direction.
The distance graph. Graphs moves up/down in real time with the steps counter:
Histogram of time by speed. I am thinking adding a similar screen with histogram of distance by speed.
Histogram of peak current vs speed. In this example, a 12V 1.2A stepper, the max current starts to drop at ~7000 steps per sec.
A tachometer that shows speed in real time.
A capture of the current signals in the two stepper coils. This one is at high speed with only 12V supply which resulted in poor current pattern, close to the speed limit of the system. (ideally the two signals should look like sine/cosine).
-
@zapta your project is very interesting. Can you tell me please whether you were able to analyse currents with microstepping and to which detail?
Thank you for pointing me to the ACS70331. I have a couple of ACS712, but they are much too slow.
I would like to analyze the correlation between step commands to the TMC, the created currents from TCM to stepper and the resulting movement of the stepper.
-
Hi @JoergS5, think it shouldn't be too difficult to decode x16 microsteping. When going through a full step, the current in the two coils behave like the graph below. X16 can be achieved by breaking the cycle to x4, x2 and x2:
x4 - detection of a quadrant (90deg) is already already done and needed to determine the direction.
X2 - each quadrant can be divided int two (45deg each) by comparing the absolute value of the two channels.
X2 - each sub quadrant can be divided by 2 using the ratio of the high coil current to the low coil current.
I think this is straight forward and doable, given the two currents, and can also be come manually using the two current readings.
BTW, I send the new PCB layout to manufacturing. Should arrive in a few weeks. It's a small 40x50mm board.
All the source files are on github and should work though I plan to do some cleanup.
https://github.com/zapta/misc/tree/master/stepper_analyzer
Schema is in the link below. As you can see there is no much there:
https://github.com/zapta/misc/blob/master/stepper_analyzer/kicad/main/stepper_analyzer.pdf -
@zapta Thanks for your information and the source location. Lucky me I bought a Nextion 3.5 last year, because I liked the idea that the display offers GUI logic, so I can start with your source.
It will take some time until I can start with the project, but I can keep you informed what I develop. -
@zapta said in Building a DIY public domain low cost stepper motor analyzer:
All the source files are on github and should work though I plan to do some cleanup.
I don't see how to download all of the files related to this project.
Does each file have to be downloaded separately?
Frederick
-
@fcwilt easy way is to clone or download the whole https://github.com/zapta/misc repository.
Alternatively you can turn to google to try and download just a sub directory from github
-
@bearer said in Building a DIY public domain low cost stepper motor analyzer:
@fcwilt easy way is to clone or download the whole https://github.com/zapta/misc repository.
Well that is certainly not the way I thought it would be done but if it works...
Thanks.
Frederick
-
@fcwilt said in Building a DIY public domain low cost stepper motor analyzer:
if it works...
it does. but packing several projects into a single repo doesn't lend itself well to sharing or collaboration - but it is easy for a single user.
anyways https://stackoverflow.com/questions/7106012/download-a-single-folder-or-directory-from-a-github-repo and other search results does provide options but to me its always seemed like more hassle than just getting the whole thing and discarding what I don't need/want.
-
@bearer said in Building a DIY public domain low cost stepper motor analyzer:
it does. but packing several projects into a single repo doesn't lend itself well to sharing or collaboration
Sorry about that. This is my catch all 'misc' repository. I plan to clean up the stepper analyzer in the next week or two so will also move to an independent repository.
Meanwhile, if you encounter any problem, let me know here. I will monitor this thread more closely.
Flushing the firmware has two parts, flashing the Nextion 3.5" using a micro SD card or the nextion designer with a serial port, and flashing the Teensy 4 which I currently do with the Arduino IDE (need to install the Teensy 4 extensions) but am looking for a simpler way (any suggestions?)
-
@zapta said in Building a DIY public domain low cost stepper motor analyzer:
but am looking for a simpler way
platformio? (for the teensy at least)
-
I copied the stepper analyzer files to a dedicated repository https://github.com/zapta/stepper_analyzer (will delete files from the old repository later).
It also includes a release directory with binaries for the teensy and the nextion 3.5". The teensy firmware can be flashed with a teensy loader (https://www.pjrc.com/teensy/loader.html) and the nextion using its sd card.
It's still rough and I plan to clean it up in the next week or two. Please let me know how it works for you.
-
Thats awesome, its on my list to try and build one! Thanks for putting this out there man!
-
The new PCBs arrive and I like how small and simple they are:
I also added a retraction analysis screen. It is cumulative such that retract 10 steps extruder 3 steps, retract 5 steps will show retraction of 12 steps.
The graph moves in real time so the camera didn't capture it well. The little noise at the bottom of the graph are tiny retractions due to pressure advance (0.08).
I plan to commit the changes to github later today.
-
Hi,
Have you considered building a small batch of complete units and selling them to us poor souls who would love to get our hands on one?
Frederick
-
I'd could be down for crowd sourcing myself one if such a thing were to be a thing.
-
@fcwilt, I would love to do that because I think the makers' 3D printer market needs a tool like this but I can't do it myself. My hope is that someone can pick it up and provide to the community, this exact design or a lower cost version of it (with a stand alone MCU and a dumb LCD). The license is very liberal, non need to attribute, no need to share code changes, commercial OK, etc.
I just created a documentation page in github. It explains the various functions, how to flash the firmware and a BOM.
-
I'd be happy to build and test (some) additional boards when I make mine, but despite the BOM being about $50-60 (10 seconds guesstimate) statistically it'd be close to double that after shipping, taxes and fees + another $7 to ship it out again. There is no real need for me to source the teensy and screen which brings the rest down to $10-20 (before shipping, taxes and fees). So my location is probably a bit cost prohibitive even when not making a profit.
@zapta is the SD card required for the nextion to run, or just the programming? I'm still waiting for that aliexpress order ... 176 days is the 2020 shipping highscore:/
-
@bearer
If you've got a PayPal account I'd buy a unit from you.
Frederick
-
@fcwilt i do. i've posted an informal doodle https://doodle.com/poll/hhw2iyirf8fctmn4 where interest could be gauged, but admittedly very skeptical as global shipping is very unreliable these days.