UBCSailbot / sailbot_workspace

UBC Sailbot's monorepo
https://ubcsailbot.github.io/sailbot_workspace/main/
Apache License 2.0
5 stars 2 forks source link

Implement the PID controller class #305

Open DFriend01 opened 1 year ago

DFriend01 commented 1 year ago

Purpose

We want to simulate the PID mechanism of the rudder controller. In the simulator, we use a software PID to achieve this.

Description

What to change

A class template is provided in boat_controller/nodes/low_level_control/control.py. You will need to implement the classes PID and RudderPID in this file.

What value are we using for error

We would be using the current heading and desired heading to compute the error $e(t)$. This Stackoverflow post tells you how to compute the signed delta angle between two angles. This would be implemented in RudderPID when we compute the error.

What tuning constants should we use

The ELEC team gave us some very early numbers:

You can use these as default values if you would like, but when you test, be sure to use different parameters other than these ones.

Plant Process

The plant process is essentially the physics engine node. You pass the current rudder angle to it and we will observe a change in the current heading. This is $y(t)$, and the desired heading is $r(t)$.

Resources

stevenxu27 commented 8 months ago

This issue remains unfinished for the simulator implementation. Please refer to the PID Controller Jupyter Notebook in the notebooks/boat_simulator repository for testing and documentation of different PID implementations. Currently proceeding with using Raye's old controller for a temporary controller solution in the simulator.

DFriend01 commented 8 months ago

Let's keep this issue open for the future when we want to revisit

stevenxu27 commented 8 months ago

Sounds good haha sorry I wasn't too sure whether to close it or not after leaving the comment.