May 26. Update

A project log for <n>pod, controller board and simulator

Golang hexapod simulator and controller.

hans-jrgen-grimstadHans Jørgen Grimstad 05/27/2024 at 11:120 Comments

In addition to streaming live servo parameters, I have now added recording functionality to the simulator. 

That means that you now can record "motion primitives" (taking a step, posing the bot etc) and save the series of servo angles as files. These files can then be stored in a SPIFFS partion on the controller.

The primitives can then be triggered via a remote controller or via a simple protocol over the network.

All an aspiring hexapod builder then will have to do is to implement a simple command protocol and then use standard libraries for reading from files and setting goal positions on the servos (I'll of course provide example code for this)

The new "export" command also lets you provide the maximum servo angle and a bitmask that let you specify the direction of the servi horn (if it is pointing towards positive or negative Z in the kinematic reference frame). I am normalizing this to a 0-1024 range (with a midpoint of 512 defining 0 degrees)

This also means that exported motion data from the simulator/designer/playgorund is servo agnostic. If you are using PWM servos, only a simple translator from a normalized value to the corresponding servo PWM signal is required.

Achieving seamless transitions between motion primitives complicates stuff somewhat on my end, but it will make life much easier for the user. 

Another update is that it is now possible to customize each leg separately. This means that every leg in the pod can potentially be totally different in terms of rest angles and segment lenght (The kinematics code is totally generic, so the pod will still be able to walk as long as it is stable with the stance phase legs). As an example, a spider like octopod topology is now possible with longer front and hind legs.

An added bonus for the user (that didn't really hit me until recently) is that a hexapod builder armed with this software tool no longer needs to understand forward or inverse kinematics to be able build and control a <n>pod - which is kinda nice. This stuff used to be hard :)