we might be cooked man

This commit is contained in:
2025-11-30 19:05:57 -06:00
parent 138c04f7a1
commit 0580c44aa3
10 changed files with 1130 additions and 57 deletions

View File

@@ -6,7 +6,7 @@ Ported from decentralizedPIDcontroller.m
import numpy as np
class DecentralizedPIDController:
class AdditivePIDController:
"""
Decentralized PID controller for quadrotor/maglev control.
Controls altitude, roll, and pitch using gap sensor feedback.
@@ -151,6 +151,6 @@ def decentralized_pid_controller(R, S, P, controller=None):
4-element vector with voltages applied to each yoke
"""
if controller is None:
controller = DecentralizedPIDController()
controller = AdditivePIDController()
return controller.control(R, S, P)

View File

@@ -7,7 +7,7 @@ import numpy as np
from scipy.integrate import solve_ivp
from utils import euler2dcm, dcm2euler
from dynamics import quad_ode_function_hf
from controller import DecentralizedPIDController
from MAGLEV_DIGITALTWIN_PYTHON.additiveController import AdditivePIDController
def simulate_maglev_control(R, S, P):
@@ -84,7 +84,7 @@ def simulate_maglev_control(R, S, P):
xk = x0
# Create controller instance to maintain state
controller = DecentralizedPIDController()
controller = AdditivePIDController()
for k in range(N - 1): # loop through each time step
tspan = np.arange(S['tVec'][k], S['tVec'][k+1] + dt/2, dt)