We are hosting Hackster Cafe: Open Hardware Summit. Watch now!
Cole Purtzer
Published © GPL3+

Unity - Advanced Thrust Vectoring Rocket

This rocket stabilizes its self using a TVC mount.

AdvancedWork in progress1,600
Unity - Advanced Thrust Vectoring Rocket

Things used in this project

Hardware components

Teensy 4.1
Teensy 4.1
×1
Arduino UNO
Arduino UNO
×1

Software apps and online services

VS Code
Microsoft VS Code

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Avionics Schematic

Code

PID controller

C/C++
PID controller to help you get started! Cannot post more because of ITAR.
#include <Arduino.h>
#include "PID.h"

PID::PID(float kp, float ki, float kd)
{
    this->kp = kp;
    this->ki = ki;
    this->kd = kd;
}

double PID::update(double input, double dt, double thrustSet, float momentArm, float setpoint)
{
    this->momentArm = momentArm;
    this->setpoint = setpoint;

    error = input - setpoint;

    integral += error * dt;
    integral = constrain(integral, -6, 6);

    derivative = (error - prevError) / dt;
    prevError = error;

    ut = (kp * error) + (ki * integral) + (kd * derivative);

    output = asin(ut / (momentArm * thrustSet));

    return output * (180 / PI);
}

Credits

Cole Purtzer
16 projects • 214 followers
Hey I am Cole, the lead engineer at Delta Space Systems! Youtube Channel: https://www.youtube.com/channel/UC7Nhgj_PVCtroPXHMhdku-g
Contact

Comments

Please log in or sign up to comment.