Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4844

Automation, sensing and robotics • Re: Waveshare Stepper Motor HAT and optical endstop switch

$
0
0
The deviation seen with 1..3mm on your paper, how far is the paper away from the axis? Or to phrase it different, what is the angular/step error of this setup?

The driver chip on this board DRV8825 is specified for 250kHz max step frequency. Python scripts won't be that fast as your "delay of 0.000001", but you should prepare for a rampup and rampdown phase in the movements. Especially if the 'moment of inertia' is large.

python and linux both are not very precise in timings. Usually a good idea to have a microcontroller dedicated to produce the pulse trains. Have a look to 'GRBL' for this approach.
It's pretty precise when I move the laser manually. 1mm of paper grid takes 4 motor steps in the center and 2-3 close to it's borders. It's non-linear value and exact amount of steps couldn't be mapped to specific coordinate by using tangent/polynome formulas. The best result is achieved by manual mapping of a 400 points and ML-trained Pytorch model to map the whole area of 160x160mm.
The problem is that every time I launch this machine I have to calibrate zero coordinate very sharp. Or else, the mapped steps wont point my laser exactly at physical coordinate.
Additionally, both motor types I used have this jump at certain phase positions when I move them manually. You move the laser step by step and at some point it jumps like for 3-4 steps more then you expect. If you reverse direction there is no jumping back.
It's like you count one-axis steps from coordinate A to B: 1, 2, 3, 4, jump 8. Reverse, then 7, 6, 5, 4, 3, 2, 1. Reverse again: 1, 2, 3, 4, jump 8

About speed. I tried different speeds assuming the faster it goes the more step it throw. Even at delay=0.01 I cannot return to a stable zero point.
It's okay to change the microcontroller, switch to another HAT or standalone board but I need to handle endstops from python or the board must have interrupt pins for my two axis.

Statistics: Posted by scolger — Wed Nov 13, 2024 8:41 am



Viewing all articles
Browse latest Browse all 4844

Trending Articles