# Control logic¶

In short:

- To move forward, the front wheel stays stationary, and the left and right wheels rotate forward at the same velocity.
- To move backward, the front wheel stays stationary, and the left and right wheels rotate backward at the same velocity.
- To move left, left and right wheels rotate at same speed, left wheel forward, right wheel backward, and the front wheel needs to rotate forward at half the speed of left/right wheel.
- To move right, left and right wheels rotate at same speed, left wheel backward, right wheel forward, and the front wheel needs to rotate backward at half the speed of left/right wheel.

I found a paper that also mentions a similar calculation, and for the full kinematics I would probably write a model similar to the one mentioned in the paper.

I was then met with a dilemma; Where should the logic of calculation of speed be?

After looking at how most robots in the Robot Operation System ecosystem is configured, I think that having the main microcontroller handle the speeds to stepper make the most sense. The entire logic for calculation should be offloaded to a dedicated controller. In the future, I would like to try attaching a Raspberry Pi or even a Jetson Xavier NX to the robot base to handle these logic and integrate the entire ROS navigation stack.

This means that the movements of can be hardcoded into my week15 assignment, and send these velocities to the robot instead. Then, we can make the robot move in those directions.

View the final video at integration section