Introduction: Flight Computer

Segments AND SUPPLIES

Minuscule 3.6×1Arduino UNO and Genuino UNO×1 NECESSARY TOOLS AND MACHINES Soldering iron (generic)Solder Flux, SolderingSoldering Gun Kit, Instant Heat APPS AND ONLINE SERVICES Arduino IDE ABOUT THIS PROJECT Hey Everyone! I have been taking a shot at this undertaking for 9 months at this point and I am at long last prepared to open source the flight PC!!! In the event that you might want to manufacture one and you need assistance get in touch with me on my site: https://deltaspacesystems.wixsite.com/rockets The unit to assemble the PC is on my site alongside directions.

section 2:

section 3: https://youtu.be/ - D9K5fKUPLc

CODE: OmegaSoft-1.052.inoI2C.ino OmegaSoft-1.052.inoC/C++

/2020 Delta Space Systems/glide PIDX, PIDY, errorX, errorY, previous_errorX, previous_errorY, pwmX, pwmY; #include/Source: https://github.com/TKJElectronics/KalmanFilter #include #define RESTRICT_PITCH/Comment out to confine move to 90deg rather - if you don't mind read: http://www.freescale.com/records/sensors/doc/app_no... Servo servoY; Servo servoX; Kalman kalmanX;/Create the Kalman occurrences Kalman kalmanY;

twofold accX, accY, accZ; twofold gyroX, gyroY, gyroZ; int desired_angleX = 193;//servoY int desired_angleY = - 18;/servoX twofold gyroXangle, gyroYangle;/Angle compute utilizing the gyro just twofold kalAngleX, kalAngleY;/Calculated point utilizing a Kalman channel int ledblu=2; int ledgrn=5; int ledred=6; int buzzer=21; uint32_t clock; uint8_t i2cData[14];/Buffer for I2C information glide pidX_p=0; skim pidX_i=0; drift pidX_d=0; coast pidY_p=0; coast pidY_d=0;//PID CONSTANTS//twofold kp=0.16;//3.55 twofold ki=0;//2.05 twofold kd=0.045;//2.05///int State = 0; void arrangement() { pinMode(ledblu, OUTPUT); pinMode(ledgrn, OUTPUT); pinMode(ledred, OUTPUT); pinMode(buzzer, OUTPUT); servoY.attach(30); servoX.attach(29); Serial.begin(115200); Wire.begin(); #if ARDUINO >= 157 Wire.setClock(400000UL);/Set I2C recurrence to 400kHz #else TWBR = ((F_CPU/400000UL) - 16)/2;/Set I2C recurrence to 400kHz #endif

i2cData[0] = 7;/Set the example rate to 1000Hz - 8kHz/(7+1) = 1000Hz i2cData[1] = 0x00;/Disable FSYNC and set 260 Hz Acc sifting, 256 Hz Gyro separating, 8 KHz examining i2cData[2] = 0x00;/Set Gyro Full Scale Range to 250deg/s i2cData[3] = 0x00;/Set Accelerometer Full Scale Range to 2g while (i2cWrite(0x19, i2cData, 4, bogus));/Write to every one of the four registers immediately while (i2cWrite(0x6B, 0x01, valid));/PLL with X pivot spinner reference and debilitate rest mode

while (i2cRead(0x75, i2cData, 1)); if (i2cData[0] != 0x68) {/Read "WHO_AM_I" register Serial.print(F("Error perusing sensor")); while (1); } delay(100);/Wait for sensor to balance out while (i2cRead(0x3B, i2cData, 6)); accX = (int16_t)((i2cData[0] << 8) | i2cData[1]); accY = (int16_t)((i2cData[2] << 8) | i2cData[3]); accZ = (int16_t)((i2cData[4] << 8) | i2cData[5]);

#ifdef RESTRICT_PITCH/Eq. 25 and 26 twofold roll = atan2(accY, accZ) * RAD_TO_DEG; twofold pitch = atan(- accX/sqrt(accY * accY + accZ * accZ)) * RAD_TO_DEG; #else/Eq. 28 and 29 twofold roll = atan(accY/sqrt(accX * accX + accZ * accZ)) * RAD_TO_DEG; twofold pitch = atan2(- accX, accZ) * RAD_TO_DEG; #endif kalmanX.setAngle(roll);/Set beginning edge kalmanY.setAngle(pitch); gyroXangle = move; gyroYangle = pitch; clock = micros(); digitalWrite(ledgrn, HIGH); servoX.write(93); servoY.write(103); delay(1000); digitalWrite(ledgrn, LOW); digitalWrite(buzzer, HIGH); digitalWrite(ledred, HIGH); servoX.write(107); delay(200); digitalWrite(buzzer, LOW); servoY.write(123); delay(200); digitalWrite(ledred, LOW); digitalWrite(buzzer, HIGH); digitalWrite(ledblu, HIGH); servoX.write(93); delay(200); digitalWrite(buzzer, LOW); servoY.write(103); delay(200); digitalWrite(ledblu, LOW); digitalWrite(buzzer, HIGH); digitalWrite(ledgrn, HIGH); servoX.write(80); delay(200); digitalWrite(buzzer, LOW); servoY.write(83); delay(200); servoX.write(93); delay(200); servoY.write(103); delay(500); }

void circle() {/* Update all the qualities */while (i2cRead(0x3B, i2cData, 14)); accX = (int16_t)((i2cData[0] << 8) | i2cData[1]); accY = (int16_t)((i2cData[2] << 8) | i2cData[3]); accZ = (int16_t)((i2cData[4] << 8) | i2cData[5]); gyroX = (int16_t)((i2cData[8] << 8) | i2cData[9]); gyroY = (int16_t)((i2cData[10] << 8) | i2cData[11]); gyroZ = (int16_t)((i2cData[12] << 8) | i2cData[13]);; systemstateabort(); pidcompute(); } void pidcompute () { twofold dt = (double)(micros() - clock)/1000000;/Calculate delta time clock = micros(); #ifdef RESTRICT_PITCH/Eq. 25 and 26 twofold roll = atan2(accY, accZ) * RAD_TO_DEG; twofold pitch = atan(- accX/sqrt(accY * accY + accZ * accZ)) * RAD_TO_DEG; #else/Eq. 28 and 29 twofold roll = atan(accY/sqrt(accX * accX + accZ * accZ)) * RAD_TO_DEG; twofold pitch = atan2(- accX, accZ) * RAD_TO_DEG; #endif

twofold gyroXrate = gyroX/131.0;/Convert to deg/s twofold gyroYrate = gyroY/131.0;/Convert to deg/s

#ifdef RESTRICT_PITCH/This fixes the change issue when the accelerometer edge bounces between - 180 and 180 degrees if ((roll < - 90 && kalAngleX > 90) || (roll > 90 && kalAngleX < - 90)) { kalmanX.setAngle(roll); kalAngleX = move; gyroXangle = roll; } else kalAngleX = kalmanX.getAngle(roll, gyroXrate, dt);/Calculate the edge utilizing a Kalman channel

on the off chance that (abs(kalAngleX) > 90) gyroYrate = - gyroYrate;/Invert rate, so it fits the restriced accelerometer perusing kalAngleY = kalmanY.getAngle(pitch, gyroYrate, dt); #else/This fixes the progress issue when the accelerometer point bounces between - 180 and 180 degrees if ((pitch < - 90 && kalAngleY > 90) || (pitch > 90 && kalAngleY < - 90)) { kalmanY.setAngle(pitch); kalAngleY = pitch; gyroYangle = pitch; } else kalAngleY = kalmanY.getAngle(pitch, gyroYrate, dt);/Calculate the edge utilizing a Kalman channel

on the off chance that (abs(kalAngleY) > 90) gyroXrate = - gyroXrate;/Invert rate, so it fits the restriced accelerometer perusing kalAngleX = kalmanX.getAngle(roll, gyroXrate, dt);/Calculate the point utilizing a Kalman channel #endif pwmX = max(pwmX, (desired_angleX - 20)); pwmY = max(pwmY, (desired_angleY - 20)); pwmX = min(pwmX, (desired_angleX + 20)); pwmY = min(pwmY, (desired_angleY + 20));

errorX = kalAngleX - desired_angleX; errorY = kalAngleY - desired_angleY; pidX_p = kp*errorX; pidX_d = kd*((errorX - previous_errorX)/dt); pidY_p = kp*errorY; pidY_d = kd*((errorY - previous_errorY)/dt); pidX_i = ki*errorX*dt; previous_errorX = errorX; previous_errorY = errorY; PIDX = pidX_p + pidX_i + pidX_d; PIDY = pidY_p + pidY_d; pwmX = - 1*((PIDX * 5.8) + 90); pwmY = ((PIDY * 5.8) + 90); servowrite(); }

void servowrite () { servoX.write(pwmX); servoY.write(pwmY);

}

void systemstateabort() { if (kalAngleX > 40 || kalAngleY > 40){ digitalWrite(ledgrn, LOW); digitalWrite(ledblu, HIGH);/digitalWrite(buzzer, HIGH); }

CUSTOM PARTS AND ENCLOSURES gerber_boardoutline_nfeZPaERQ1.GKO DOWNLOAD

gerber_boardoutline_nfeZPaERQ1.GKO

gerber_topsilklayer_B65K2qOteS.GTO DOWNLOAD

gerber_topsilklayer_B65K2qOteS.GTO

gerber_bottomlayer_Mnp3NuN8aY.GBL DOWNLOAD

gerber_bottomlayer_Mnp3NuN8aY.GBL

gerber_bottompastemasklayer_vM8SdpWS8r.GBP DOWNLOAD

gerber_bottompastemasklayer_vM8SdpWS8r.GBP

gerber_bottomsilklayer_qmijTbiPer.GBO DOWNLOAD

gerber_bottomsilklayer_qmijTbiPer.GBO

gerber_bottomsoldermasklayer_Da65enU9fY.GBS DOWNLOAD

gerber_bottomsoldermasklayer_Da65enU9fY.GBS

gerber_drill_npth_Z1JX8U4DOj.DRL DOWNLOAD

gerber_drill_npth_Z1JX8U4DOj.DRL

gerber_drill_pth_N77NwzoHLQ.DRL DOWNLOAD

gerber_drill_pth_N77NwzoHLQ.DRL

gerber_toplayer_Dk145N7EUm.GTL DOWNLOAD

gerber_toplayer_Dk145N7EUm.GTL

gerber_toppastemasklayer_P1YAtQ6sp3.GTP DOWNLOAD

gerber_toppastemasklayer_P1YAtQ6sp3.GTP

gerber_topsoldermasklayer_4As8yQ2tmM.GTS DOWNLOAD

gerber_topsoldermasklayer_4As8yQ2tmM.GTS

omega_flight_computer_mount_v2_v6_0bl8Rpgbwe.stl DOWNLOAD

SCHEMATICS omega_v4_dev_iH8wTGMZul.png DOWNLOAD

Space Challenge

Participated in the
Space Challenge