Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driving Motors by Tachometer Counts #12

Open
vmaddur opened this issue May 5, 2020 · 2 comments
Open

Driving Motors by Tachometer Counts #12

vmaddur opened this issue May 5, 2020 · 2 comments

Comments

@vmaddur
Copy link

vmaddur commented May 5, 2020

On the AnalyticPhysics page for the assembly (see here), it states that when driving motors by tachometer counts you pause program execution using OUTPUT_READY. However, it also states that in practice this often pauses the program indefinitely, so we work around this by using an additional timer. Do the wait statements from the timer come before or after the OUTPUT_READY statement? It would be helpful if you could provide a sample assembly sequence using OUTPUT_STEP_POWER or OUTPUT_STEP_SPEED with the timer.

@vmaddur
Copy link
Author

vmaddur commented May 5, 2020

The way I currently understand it, we could do something like this:

TIMER_WAIT(time up+time run+time down+C,timer)
OUTPUT_TIME_POWER(layer,motors,power,time up,time run,time down,brake)
TIMER_READY(timer)

for some small positive constant C (accounting for minor deviations) for timing the execution of time-based motor movements. However, I do not see a way to modify this for tachometer counts (based on rotations not timings).

@dlech
Copy link
Member

dlech commented May 5, 2020

As far as I know, OUTPUT_READY will only block indefinitely if the motor is physically obstructed from reaching its target. OUTPUT_TIME_POWER should not need an extra timer since it depends only on time already.

To avoid blocking calls, I suspect OUTPUT_TEST could be used instead of OUTPUT_READY to test if the motor has reached its target. OUTPUT_READ could also probably be used to implement some sort of stall detection (e.g if speed from OUTPUT_READY is 0 for 1 second and OUTPUT_TEST is still busy, then the motor must be stalled).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants