-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add option to ignore endstops during startup #747
base: master
Are you sure you want to change the base?
Conversation
This is useful for devices where the endstop is pressed while power is off, due to gravity, springs, or otherwise. When the ODrive initially starts up, it sees the limit switch(es) pressed and disarms the motor(s) immediately. With this setting enabled, the limit switch will not cause the motor to disarm during inital startup, making the `odrive.axis*.config.startup_*` flags useful again.
This is useful for devices where the endstop is pressed while power is off, due to gravity, springs, or otherwise. When combined with odriverobotics#747, this allows the ODrive to start up the motors and perform the encoder index search while one of the endstops is pressed. With this setting enabled, the limit switch will not cause the motor to disarm during the encoder index search, making the `odrive.axis*.config.startup_encoder_index_search` flag useful again.
Thanks for your contribution! This sounds like a reasonable use case. As it is written currently, the endstops are edge triggered, so if the axis is just sitting on the endstop, it shouldn't trigger it. Could you elaborate more what commands you ran and what behavior you observed? And just to make sure, you're using ODrive v3.6, correct? Because the newer (current generation) ODrives are not covered by this repository, see note here. |
I noticed that it appears to be edge triggered (checking
When I turn off all the
Yes, I'm using a V3.6 56V board (well, technically 3 boards for a total of 6 motors). I previously upgraded from the 24V boards, which I believe had the same issue, but am not 100% sure as I upgraded over a year ago and haven't used them since. Also, I noticed after submitting this PR that, for only 1 of my 3 ODrives, one axis would still fail on startup (a failure rate of 1 in 6), and after a bit more troubleshooting, I realized that it was actually failing during the index search, hence #748. |
Sorry for the late reply. For clarity I should say that due to the NRND status of ODrive v3.6, this repository is fairly deprioritized at this point, see also note here. So I try to be careful with changes because I wouldn't be testing them myself. That means we rely more on code inspection and the rigor of contributors for evaluating changes. In this case, could you try to find out more on a code level what makes the error occur? From your last message it seems that the error doesn't only occur immediately on startup, but just the first time the axis is enabled. This means that the proposed fix (checking for AXIS_STATE_UNDEFINED) would not address the root problem. Ideally, you're able to track down which variables have the wrong value under which conditions. You can do this through experiments and code inspection. Understanding the problem at the code level will be important to decide what a suitable fix is. If you prefer to not spend more time on this, or have moved on to other things, that's also fine with us, in this case you're free to close the PR. |
This is useful for devices where the endstop is pressed while power is off, due to gravity, springs, or otherwise. When the ODrive initially starts up, it sees the limit switch(es) pressed and disarms the motor(s) immediately. With this setting enabled, the limit switch will not cause the motor to disarm during inital startup, making the
odrive.axis*.config.startup_*
flags useful again.As an example of a potential use case, I'm building a flight simulator, where the pod the rider sits is supported on 6 linear actuators. Each actuator has a lower endstop (
odrive.axis*.min_endstop
) and is configured withstartup_encoder_index_search
,startup_homing
, andstartup_closed_loop_control
all enabled. However, currently, when powering on the machine, it needs 3 people to help hold the weight of the pod and a 4th operator to manually rotate the motors to lift each actuator off the endstops. Obviously, this is not ideal, and while there are potential solutions that we've thought of, the simplest (and, in my opinion, safest) is to just have it allow the startup sequence to run while the endstops are pressed. The settings forstartup_encoder_index_search
can be configured to make the actuators always move up, and thenstartup_homing
takes over and moves the actuators away from the endstops.If there are any concerns around this PR, I'd be happy to discuss them. As far as I can tell, using
AXIS_STATE_UNDEFINED
as a flag for initial startup seems to be correct, as it's used for that purpose in axis.cpp#458 and is used as the condition for theis_booting()
variable in main.cpp#45-47.