Acceleration
Acceleration code seems to work, at least according to my scoping of signals. Time to test it on the robot, this should make it never loose steps or overshoot.
Merge request reports
Activity
requested review from @pkorysko
added 1 commit
- 43584ef4 - Tweak timings and remove interrupts so the grabber works
added 1 commit
- d7bb0cc6 - Add note document (handwritten...) on stepper acceleration
Seems like disabling interrupts was a bad idea: Servo works by pulse-width modulated pulses with 20ms cycle time, which are generated using timers. Disabling the interrupts disables the timers used to generate these pulses.
For now re-enabling interrupts ( 43584ef4 ) even if this results in some jitter.
In the future, it would be better to use hardware interrupt timers to generate these pulses...
Info on Arduino timers and interrupts:
- https://www.robotshop.com/community/forum/t/arduino-101-timers-and-interrupts/13072
- https://github.com/khoih-prog/TimerInterrupt#more-useful-information
Making the stepper-functions timer based instead of software sleep would enable:
- Simultaneous X-Y movement
- Network I/O during movement (network in main loop, movement with interrupts)
- -> Possible to have a soft STOP command (that should also clear the command queue)
- Output of what is current position during movement
Edited by Kyrre Ness Sjobaekmentioned in issue #9
OK, I implemented accleration to slow speed as well as fast, used in both
STEPPER POS
andSTEPPER ZEROSEEK
. Also fixed some small bugs in interval generation.This means that we again have
stepper_delay_slow
in the config, and the acceleration will just truncate the program when it reaches this speed, then continue at this speed.As mentioned in the previous comment I actually now see a possible way to implement a STOP command, and maybe even bring the jitter down - however if doing this it will be in a separate branch.
It's ready to be tested again!
mentioned in commit f935554b