Close

Glitches

A project log for Smart leash

Simple navigation for pet robots

lion-mclionheadlion mclionhead 07/15/2023 at 05:300 Comments

Got another glitch where it was retracted to several ft & reset to 0.  Saw the 0 point on the phone.  When it retracts further, the truck firmware clamps it at 0.  Other ideas are the power switch glitching, a bad cable, or static electricity from retraction. 

The leash logic in the truck is ponderous & had an unrelated bug.

Reducing oscillation has been long & hard.  With very low P, I & relatively high D, it's surprising just how damped the leash can get, purely based on input from the leash & not any gyro. It takes a lot of deflection to make it turn but it doesn't oscillate. In a few places, it doesn't respond in time to avoid the curb. Maybe it would be more responsive without oscillating if it used the truck gyro to detect turn rate instead of the leash pot.

Then again, the truck gyro doesn't detect a turn until after the leash detects a turn & commands the servo to move. There is a scenario where a gyro is stuffed on the leash board. Then it just detects the difference in rate between the leash gyro & truck gyro. This would give the fastest rate updates but absolute heading would be prone to drifting. The pot would always be necessary to anchor the gyro.

Reduced P yielded another problem where fully deflecting right or left can cause it to run away.  It won't turn enough to retract the leash, instead extending it when it moves.  In the fully deflected mode, you have to slow down.  1 idea is reducing maximum speed proportionally to the turn angle.  This might allow higher maximum speeds than it can currently reach.

The speed limit is only to keep it from running away.  If it's going forward, it'll run into the lion or it'll deflect sideways before it runs away.  If it's going sideways, it'll go in a circle.  If it completely breaks & only detects maximum forward, it could run away. Reduce the speed too much & it'll erratically lock the wheels, losing steering control. 

Discussions