SANAA
UREMBO NA USTAWI
UJANJA
UTAMADUNI NA HISTORIA
BURUDANI
MAZINGIRA
CHAKULA NA VINYWAJI
REVERSE ENGINEERING
SAYANSI
MICHEZO
TEKNOLOJIA
VAZI
The Sperry Gyro Autopilot
Martin

Imeundwa na

Martin

31. Agosti 2026NO
0
0
0
0
0

The Sperry Gyro Autopilot

A gyrocompass tells a ship where north is and then stops. Elmer Sperry's question from about 1910 was what happens if the gyro does not merely report the attitude but ACTS on it - if the instrument is wired to the controls, so the machine flies itself. His son Lawrence demonstrated the answer at the aircraft safety competition at Bezons, near Paris, on 18 June 1914: he flew a Curtiss flying boat past the judges with both hands in the air while his mechanic walked out along the wing, and the gyroscopic stabiliser held it level. It won the prize and it is the first machine that flew itself. The control lesson is the one that recurs in every blueprint after it. Feed the roll ANGLE back to the ailerons and you have not built a stabiliser, you have built a torsion spring: push the aircraft off level and it comes back, overshoots, comes back again. An early aeroplane's aerodynamic damping is worth a damping ratio of only about 0.3, so the machine wallows for half a minute after every gust. Nothing in that loop takes energy out. The fix is to feed back the RATE of roll as well - how fast it is getting worse, not just how bad it is - and the beauty of it is that a spinning gyro in gimbals gives you both from one instrument. The angle comes from the gyro staying put while the aircraft moves around it; the rate comes from the torque it takes to precess it. The second term costs no extra sensor, only the wit to use what the first one already produced. There is a limit that no amount of gain gets past. A stiff loop asks for more aileron than the surface has, and a control surface hard against its stop is not in a feedback loop at all.
Juu
4 hours

Maagizo

1

A plank on a bearing

Pivot a 400 mm plywood beam on a single ball bearing so it rolls freely about its long axis, and screw the IMU flat at the centre. Mount the servo to the frame and link its horn to one end of the beam with a stiff wire, so the servo can tilt the beam a few degrees either way. Balance it until it sits level with the servo centred - an unbalanced rig hides everything you are about to measure.

Vifaa kwa hatua hii:

Baltic Birch Plywood (1/8 inch, 12x12, 10-Pack)Baltic Birch Plywood (1/8 inch, 12x12, 10-Pack)1 karatasi
Ball BearingBall Bearing1 kipande
Piano WirePiano Wire200 mm
M3 Hex NutM3 Hex Nut8 vipande

Zana zinazohitajika:

Cordless DrillCordless Drill
Steel Ruler (30cm)Steel Ruler (30cm)
Digital Caliper 6-InchDigital Caliper 6-Inch
Screwdriver SetScrewdriver Set
2

The stabiliser sketch

One hundred loops a second: read the angle, read the rate, command the servo. The two gains at the top are the whole experiment. Leave `KD` at zero first - that is a 1912 attitude-only stabiliser, and it will wallow. Then raise it and watch the wallow die.
gyro_stabiliser.inocpp
// Sperry's argument, on a bench: attitude alone is not enough.
//
// One IMU, one servo, one plank on a bearing. The loop reads roll angle, works out how
// far to move the "aileron", and writes it to the servo. Everything about how it behaves
// is in the two gains below.
//
//   KP  acts on the ANGLE       -- how far from level am I?
//   KD  acts on the RATE        -- how fast am I getting worse?
//
// Set KD to 0 and you have a 1912 attitude-only stabiliser. It will not fall over, and it
// will not stop moving either: it wallows, because nothing in the loop takes energy out.
// Wind KD up and the wallow dies. That single constant is the whole lesson.
//
// Wiring: MPU-6050 on I2C (SDA A4, SCL A5, VCC 5V, GND GND). Servo signal on D9, servo
// power from a SEPARATE 5 V supply with its ground tied to the Arduino's -- a servo
// stalling against the plank will brown out the board and reset it mid-experiment.

#include <Wire.h>
#include <Servo.h>

const float KP = 1.8;        // servo degrees per degree of roll error
const float KD = 0.0;        // servo degrees per (degree/second) of roll rate  <-- CHANGE ME
const float SETPOINT = 0.0;  // degrees; wings level

const int   SERVO_PIN   = 9;
const int   SERVO_TRIM  = 90;   // servo angle that leaves the plank level
const float SERVO_LIMIT = 45.0; // do not command past the linkage travel
const unsigned long DT_MS = 10; // 100 Hz loop

const int MPU = 0x68;
Servo aileron;

float angle = 0.0;           // degrees, complementary-filtered
unsigned long tPrev = 0;

void mpuWrite(byte reg, byte val) {
  Wire.beginTransmission(MPU); Wire.write(reg); Wire.write(val); Wire.endTransmission(true);
}

void setup() {
  Serial.begin(115200);
  Wire.begin();
  mpuWrite(0x6B, 0x00);      // wake up
  mpuWrite(0x1C, 0x00);      // accel +/-2 g
  mpuWrite(0x1B, 0x00);      // gyro  +/-250 deg/s
  aileron.attach(SERVO_PIN);
  aileron.write(SERVO_TRIM);
  delay(500);
  Serial.println(F("t_ms,angle_deg,rate_dps,command_deg"));
  tPrev = millis();
}

void loop() {
  unsigned long tNow = millis();
  if (tNow - tPrev < DT_MS) return;
  float dt = (tNow - tPrev) / 1000.0;
  tPrev = tNow;

  // Read accelerometer and gyro in one burst.
  Wire.beginTransmission(MPU); Wire.write(0x3B); Wire.endTransmission(false);
  Wire.requestFrom(MPU, 14, true);
  int16_t ax = Wire.read() << 8 | Wire.read();
  int16_t ay = Wire.read() << 8 | Wire.read();
  int16_t az = Wire.read() << 8 | Wire.read();
  Wire.read(); Wire.read();                    // temperature, discarded
  int16_t gx = Wire.read() << 8 | Wire.read();

  float accAngle = atan2((float)ay, (float)az) * 57.2958;   // degrees, noisy but drift-free
  float rate     = (float)gx / 131.0;                       // deg/s, smooth but drifts

  // Complementary filter: trust the gyro over a second, the accelerometer over a minute.
  // This is itself a feedback loop -- the accelerometer slowly corrects the integrated gyro.
  angle = 0.98 * (angle + rate * dt) + 0.02 * accAngle;

  float error   = SETPOINT - angle;
  float command = KP * error - KD * rate;      // rate opposes the motion, hence the minus

  if (command >  SERVO_LIMIT) command =  SERVO_LIMIT;
  if (command < -SERVO_LIMIT) command = -SERVO_LIMIT;
  aileron.write(SERVO_TRIM + (int)command);

  Serial.print(tNow);       Serial.print(',');
  Serial.print(angle, 2);   Serial.print(',');
  Serial.print(rate, 2);    Serial.print(',');
  Serial.println(command, 2);
}

Vifaa kwa hatua hii:

3-Axis Gyro/Accelerometer IC - MPU-60503-Axis Gyro/Accelerometer IC - MPU-60501 kipande
Arduino Servo Motor Pack (5-Pack)Arduino Servo Motor Pack (5-Pack)1 paketi
Dupont Jumper Wire Set (M-F, 40-Way)Dupont Jumper Wire Set (M-F, 40-Way)1 seti

Zana zinazohitajika:

Arduino Uno R3 SMDArduino Uno R3 SMD
Breadboard - ClassicBreadboard - Classic
Desktop ComputerDesktop Computer
Bench Power Supply (30V/5A)Bench Power Supply (30V/5A)
3

Spring, stabiliser, and four ways to stay level

Loading Jupyter Notebook...

Zana zinazohitajika:

Desktop ComputerDesktop Computer
4

Compendium: what the gyro cannot tell you

A gyroscope holds a direction in space, not relative to the earth, so over an hour it drifts - a few degrees at best on 1914 bearings. Left alone the autopilot would fly a steadily banking turn while insisting the wings were level. Sperry's erection system fixes it with pendulous weights or air jets that slowly torque the gyro back towards the local vertical, a second and much slower feedback loop wrapped around the first. The sketch here does the same thing digitally: the complementary filter trusts the gyro over one second and the accelerometer over a minute, because one is smooth and drifts while the other is noisy and does not. That second loop has a failure mode built into it. An accelerometer cannot distinguish gravity from acceleration, so in a steady coordinated turn the apparent vertical tilts with the aircraft and the erection system patiently teaches the gyro that the banked attitude is level. Real autopilots cut the erection out whenever a turn is detected. It is worth recognising because the same trap catches every balancing robot ever built for the same reason: the reference the slow loop trusts is only trustworthy while the vehicle is not doing anything interesting.

Zana zinazohitajika:

Notebook and PencilNotebook and Pencil

Vifaa

7

Zana Zinazohitajika

9
Jumla inayokadiriwa
$13.00

CC0 Umma Wote

Mchoro huu umetolewa chini ya CC0. Uko huru kunakili, kubadilisha, kusambaza, na kutumia kazi hii kwa madhumuni yoyote, bila kuomba ruhusa.

Saidia Mtengenezaji kwa kununua bidhaa kupitia Mchoro wao ambapo wanapata Kamisheni ya Mtengenezaji iliyowekwa na Wachuuzi, au unda marudio mapya ya Mchoro huu na uiunganishe kama kiungo katika Mchoro wako kuchangia mapato.

Majadiliano

(0)

Ingia kujiunga na majadiliano

Inapakia maoni...