I’m experiencing some issues while operating a rover in guided mode with a companion computer. When using wheel encoders, if the rover receives a speed target over about 1m/s, the rover increases throttle apparently without limit, until disarmed. Confusingly, this problematic behavior goes away if I disconnect the encoders from the autopilot.
The rover is a custom build, with the following setup:
- CubePilot Orange autopilot
- Two tank treads, each driven by a GoBilda “Yellow Jacket” motor with a built-in encoder.
- A companion computer, connected to the USB port on the autopilot, for control in Guided mode
- A Futaba RC receiver connected to the RC IN port on the autopilot, for control in Manual mode.
- A telemetry radio connection to a laptop, so I can monitor everything in Mission Planner.
- A playstation controller hooked up to in-house-developed software on the companion computer. Software reads the playstation stick values, then sends SET_POSITION_TARGET_LOCAL_NED commands in the MAV_FRAME_BODY_OFFSET_NED frame with target X velocity and target yaw rate.
My intent is to operate this rover just based on dead-reckoning, and have no reliance at all on GPS. Since I wanted to rule out GPS instability as a possible issue, I unplugged the GPS receiver entirely.
I followed the directions on this page: Wheel Encoders — Rover documentation (If you see any discrepancy between the directions on this page and the attached parameters file, please let me know.)
I’ve been conducting the following tests with the rover up on blocks on my desk. I figure the EKF should be getting its speed solution from the motor encoders, so the IMU shouldn’t have to actually move in order to get some reasonable behavior. The last time I put it on the ground for this test, the rover ran off at high speed and slammed into my office wall. So I’m really hoping to be able to confirm that this behavior is fixed before letting it roam free.
When I set the autopilot into “manual” mode, the rover can be operated with the RC controller, and behaves as expected. Driving the stick forward moves the rover forward. Wheel distances, as viewed in Mavlink Inspector, move as expected. When the rover goes forward, the left wheel distance reports values that become more and more negative, while the right wheel distance becomes more and more positive. (This is consistent with the screenshot on the wheel encoders page, but if this is backwards, please let me know). The ground speed reported in Mission Planner does something a little strange: it flips between 0.0 m/s, and some sane speed that appears to match the speed of the treads.
I then set the autopilot into “guided” mode. I tell our software to command a velocity target using the SET_POSITION_TARGET_LOCAL_NED, masked to command a target X veocity and a target yaw rate, in the frame MAV_FRAME_BODY_OFFSET_NED. If the encoders are disconnected, this commands movement of the chassis in exactly the desired manner - forward X values cause the rover to move both treads the same way, etc. However, if the encoders are connected, when the target speed goes above some threshold, it seems like the rover enters some sort of positive feedback cycle, and it accelerates, seemingly without bound.
Can anyone spot an issue here?
2024-02-22 rover 1 at time of log.param (16.3 KB)
I’ll try to get the log uploaded to a sharing service and comment with it.