Skip to main content

Connecting the Blocks

Main block connections:

I2C Communication:
  • startAll.start → mpu6050.start → i2c.start

  • i2c.sdaIn ↔ mpu_sda (bidirectional pin)

  • i2c.sdaOutReg → inverterC.A → AND2b.A

  • i2c.isSending → AND2b.B → AND2b.Y → mpu_sda

  • i2c.scl → mpu_scl (I2C clock output)

MPU6050 Sensor:
  • mpu6050.accelX/Y/Z, gyrosX/Y/Z: raw data outputs from the sensor

  • mpu6050 ↔ i2c (via: instruction, toSend, i2cEnable, received, complete, nack)

Angle Calculation:
  • arctanCORDIC 1: x = accelZ, y = accelY

  • arctanCORDIC 2: x = accelZ, y = accelX

  • Both have active and sig outputs, plus value (calculated angle)

Filtering:
  • Each value output from the arctanCORDIC modules goes to a lowPassFilter for signal smoothing.

Control:
  • The filtered signals are sent to closeLoop, with referenceMF = 0 (leveling reference).

  • The calculated error generates active (2-bit) and sig (direction) control outputs.

Servo Actuation:
  • The control outputs from closeLoop feed into two servo blocks that adjust the platform’s tilt.