Discuss the working principle behind your project.

 

 

 

 

 

 

 

Locomotion – Code Logic:

How does our snake move? Below is an image of the Pseudocode of how the overall Locomotion code works.

Locomotion - Pseudocode
Locomotion – Pseudocode

To better visualise the snake’s motion in relation to the code, below are some videos of each motion of the snake and what were the PWM signals being sent to them in respect to time. (Serial Plotter Videos; PWM signal intensity is the Y-axis, Time is the X-axis):

void loop for Calibration: Fix all servos to 90°

void loop for Sidewind Motion(left OR right): Servos in vertical plane follow a sine wave, Servos in horizontal plane follow a cosine wave (out of phase by 90°)

Serial Plotter of Sidewind

void loop for Inchworm Motion: Fix Head and Tail servo angles, Fix horizontal plane servos, Vertical Plane Servos follow a zig-zag pattern of PWM signal

Serial Plotter of Inchworm