-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
[Bug] Hold after running forever leads to sudden motion #956
Comments
This looks related to the motor not being able to hit the commanded speed in the first move. |
Indeed, the same happens on SPIKE if the speed limit cap is raised. This means it can also happen with the normal cap if it can't reach the target speed under a load. try:
from pybricks.pupdevices import Motor
except ImportError:
from pybricks.ev3devices import Motor
from pybricks.tools import wait
from pybricks.parameters import Port
from pybricks import version
print(version)
# Initialize the motor.
motor = Motor(Port.A)
# Allocate the data logs.
DURATION = 7000
motor.control.limits(speed=2000)
motor.log.start(DURATION)
motor.control.log.start(DURATION)
motor.run(2000)
wait(2000)
motor.run(100)
wait(2000)
motor.hold()
wait(2000)
# Transfer data logs.
print("Transferring data...")
motor.log.save("servo.txt")
motor.control.log.save("control.txt")
print("Done") |
There is also still something wrong with the condition that releases the integrator pause. The position error gets inflated rather than slowed down. See new issue in #958. Also notice the long time between commands. Is this delay EV3 specific? try:
from pybricks.pupdevices import Motor
except ImportError:
from pybricks.ev3devices import Motor
from pybricks.tools import wait
from pybricks.parameters import Port
from pybricks import version
print(version)
# Initialize the motor.
motor = Motor(Port.A) # EV3 Large
# Allocate the data logs.
DURATION = 7000
motor.control.limits(speed=2000)
motor.log.start(DURATION)
motor.control.log.start(DURATION)
motor.run_time(1800, 3000)
motor.run_time(100, 1000)
motor.run_angle(500, 720)
# Transfer data logs.
print("Transferring data...")
motor.log.save("servo.txt")
motor.control.log.save("control.txt")
print("Done") |
It seems like the new position trajectory does not compensate for the angle spent "stalling" on the time trajectory, so it catches up to compensate. We need to compensate for this when transitioning from a speed based to an angle based trajectory, just as we have a transition case for the other way around already. |
Describe the bug
The hold triggers it to suddenly move fast instead of hold, because there is an unexpected jump in the target position.
To reproduce
The text was updated successfully, but these errors were encountered: