-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
Shutdown ESCs when IDLE #97
base: main
Are you sure you want to change the base?
Conversation
Align IMU accelerometer axes. Calculate pitch, roll, and overall tilt angles. Set ESC shutdown pin to HIGH if: - not on a slope (pitch < 15deg) and... - ROS is running and... - current mode is IDLE Requires killswitch to be set to ADC2_HIGH in xesc app config (Based on the work of @Pete_MI632 on discord)
Interesting PR! Planned to test it today, but after I reviewed it once more, I've some brain-blocker. Think it's due to my limited brain- resources, so please be so kind and help my rusty brain to get on track ;-)
I don't get the logic behind this (as well as in the code). If so: Why shutdown ESC when not on a slope? What's the reason for shutting down the ESC's dependent on slope? Is it some kind of safety, but without triggering emergency? If "ESC shutdown" get triggered due to pitch(/roll), also the drive ESCs get shutdown right? Means we've a mower standing around without recognizing, because no emergency got triggered? Please don't understand me wrong. I do like the PR but I miss somehow (parts of) the reasoning behind ;-) |
My understanding is that on a slope, the mower might roll off the docking station. So we need the motors to break actively, for which we need the ESC to be powered on. |
Maybe you missed the point that this is for power saving and less heat while the mower is docked, not to stop the mowing motor in a potentially dangerous situation. |
Wohoo! That's the part I missed ;-). |
Yes, I missed that fully!! Anyway, I do like the idea to use the IMU for it and I think we can/should use it for both reasons? |
Like: |
Can't really judge because my lawn is almost flat. I think some users have a steeper lawn though, and as long as the hall sensors don't raise an alarm, they probably don't want it to trigger emergency mode. And shutting down the wheel ESCs would be a bad idea in that case as well. Maybe it might make sense the other way around: If emergency is triggered, the mower ESC could be turned off, and also the wheel ESCs if it's not steep. That said, I think it would be a completely different intention, different implementation and to be discussed with other affected users, so I would separate it from this PR. I guess from your additional commits, the only thing to keep would be using the constant? |
Good point. Mine is also nearly 15° I guess, but didn't tested in real yet, that's why I didn't increased that value (with my wrong reasoned assumption). You're right, could be bad to shutdown the ESCs on a hill... even though it shouldn't trigger with a reasonable value like 20-25°, except one lift it from the back or side, in which case. Bla bla ... ;-)
Okay, no problem. But >15° as roll-out undock protection look really very high to me.
Take or drop whatever you (dis)like ;-) |
Guys, i am not sure, but i think you have a map of the yard in memory, you probably should also have stored surface angles, when taking the map. You also now exactly the possition of the mower at any time. Couldnt you just say turn shit off, if the angle of the mower differes a certain ammount from mapped angle? |
No, not in LowLevel ;-)
No, don't think so. As far as I know our map is 2D
I'm sorry to say: "No not in LowLevel" ;-)
Unfortunately not "at any time". We can't expect GNSS data in docking station
No ;-). But luckily that's not the question anymore. |
This is quite off-topic, but when recording the map, you only drive the outline of the area and obstacles. So there's no knowledge about any hills in the middle of the area. Besides that, the angles obviously depend on the mower orientation, so we'd have to be very sure about that one. I'd say it only makes sense to trigger emergency based on IMU for really extreme values (like: nose pointing down, mower upside down). |
It will shutdown the ESCs when the mower status is IDLE (so docked or when stuck in emergency, although I think it will now stay mowing/PAUSED instead of failing to IDLE so need to update this logic), and not on a slope so it doesn't roll into a pond if it's stuck in emergency |
@olliewalsh Any idea how to verify that it works properly? The only indicator I have right now is that the docking station consumes ~0.6W less when the mower is docked and fully charged. I bought an IR thermometer, but the measured temperature varies so much even under seemingly stable conditions that I don't trust it. From d432b54, only |
One sign that it works is, that you are able to turn the wheel when idle (if not on slope).. when picking up back on a higher angle, wheels should brake.. Btw. I checked behavior of stock mower: it has the brake activated in docking station in flat ground.. although for me it sounds reasonable not to use the break when not needed.. |
Align IMU accelerometer axes.
Calculate pitch, roll, and overall tilt angles.
Set ESC shutdown pin to HIGH if:
Requires killswitch to be set to ADC2_HIGH in xesc app config
(Based on the work of @Pete_MI632 on discord)