Smartening Up

A project log for SpiderWing

Spider robot powered by Adafruit Feather boards and CircuitPython.

dehipude Éhipu 05/15/2017 at 19:470 Comments

I got the gait code to work on the small crab robot -- actually it only needed some adjustments for the smaller legs. I'm a bit disappointed about how slow the code runs on the M0 -- I didn't even need to add delays for the servos, the calculations take enough time for them to move into place. Oh well. That means the gait is still jerky (because I couldn't do the continuous servo updates), but it works fine.

Then I worked a little bit on the robot's "intelligence". Right now it only has only one sensor, the distance sensor in front. So its behavior is as follows:

And that's it. I also added exception catching, so when the legs get tangled into an impossible position (that happens sometimes), they are moved into their home positions, and then the program resumes.

This procedure gives the robot a nice behavior. It will walk towards things to examine them, and follow people, but if the things don't move, it will get bored with them and walk away, looking for other interesting things.

I'm considering adding one more state, for when it gets bored with scanning -- perhaps it could just shut down and go to sleep then.