Here is a video I made at an earlier stage of this project showing the machine's layout. The question Im asking in this old video was about measuring distance, and I found the solution with the slide potentiometer so disregard that part: https://www.youtube.com/watch?v=WhsNTUPkNVQjoan wrote: ↑Tue Sep 17, 2019 12:56 pmIt sounds like something easy to do on the Pi. Of course you would need an ADC.
How many steps per second per motor? How accurately do the pulses need to be timed? Must they be synchronised? These are the sort of questions which will let you know if an Arduino is more suitable.
Pootle thanks for the information! I looked on Trinamic's site and saw dozens of drivers that would meet the power specs of the motor in question, all of these boards have many features I dont know about making it difficult to choose. From what I see the TMC5160 seems to be a good choice for me and a larger brother of the 5130 chip you tested on your blog.pootle wrote: ↑Wed Sep 18, 2019 7:34 amAt the upper end are chips from the likes of TMC. These effectively run the motor autonomously, and (once the various settings are configued), just require commands such as 'GOTO step X', and the chip takes care of timing, ramping, current limiting and if set up properly can detect if the motor stalls etc.
I did some testing of these described here.
There is no problem at all running to motors simultaneously.
All of the ones in that family - 5130, 5160 etc, I would expect to run pretty simply:
Code: Select all
Check at position zero clear crash flag repeat 111 times: set goto position max sleep(.1) read ramp stat register while not position reached and not crash: #flag in ramp stat register sleep(.1) read ramp stat register if not crash: set goto position min sleep(.1) read ramp stat register while not position reached: sleep(.1) read ramp stat register set twist motor position +x etc.
End stop switches are in the plans for future development. I could probably do that with optical sensors.IanS wrote: ↑Mon Sep 23, 2019 8:26 amI would suggest having end-stop switches on the back-and-forth motion. Then, move to and fro until the switches trigger instead of going a fixed distance. This way you can cope with skipped steps and it does not matter if the power gets interrupts part way along leaving the device to restart in an unknown position.