▶ Try it its model runs in your browser, nothing to install

template · verified

arche/quadrotor

Quadrotor

A quadrotor: a free body with four rotors (thrusters with their drag torque), an IMU, an attitude sensor and a position fix, and a flight controller that holds its attitude, its place and its altitude, and steps to a new altitude; its plant in MuJoCo, its test cases run against it.

plantmujocodronequadrotorattitudealtitudecontrol

archec add main.arche arche/quadrotor@^0.1

Package

Kindtemplate
Version0.1.0
LicenseApache-2.0
Export controlnone
Works witharchec >=0.10
Edition0.12
Handlersthe action language (```arche), run as TypeScript from its code
Homehttps://github.com/arche-lang/arche-lang

Model

SystemsQuad
ComponentsFrame Rotor Imu Ahrs Gps FlightController
Requirements4
Messages4

Code it brings

WhereLanguageLines
main.arche · FlightController.on_motion.bodyarche3
main.arche · FlightController.on_attitude.bodyarche5
main.arche · FlightController.on_fix.bodyarche29

Quadrotor

A 1 kg quadrotor in the "+" layout: a free body and four rotors 0.15 m from its centre, each a thruster (0 to 10 N) that turns the frame back about z by its drag (prop reaction, ±0.016 N·m per N: front and back one way, left and right the other). An IMU gives the rates, an attitude sensor the quaternion, a position fix the place. It starts in the air at 1 m.

| | | |---|---| | Plant | a free body, 4 thrusters on sites, IMU, attitude (framequat), position (framepos), 1 ms step | | Controller | place → tilt, attitude PD per axis, altitude PD around the hover thrust, the mixer, 200 Hz | | Requirements | REQ-QD-HOLD, REQ-QD-STEP (±0.05 m in 3 s), REQ-QD-MOVE, REQ-QD-SAFE (formal "never fc in Failsafe") | | Test plan | TP-QD: hover at 1 m, climb to 1.5 m, move 0.5 m along x |

archec new my-drone --template quadrotor     a project from it, yours to change
archec gen main.arche --target mujoco -o out
archec sim main.arche --plant out/mujoco/plant_bridge.py --test

In MuJoCo (4.0): the hover holds 1 m exactly (nothing disturbs it); a step to 1.5 m is within 0.05 m from 0.4 s after it, overshooting by 14 mm; a move of 0.5 m along x is within 0.05 m 1.7 s after it, tilting 0.11 rad at most, the altitude held within 1 mm. Wind and rotor dynamics are not in the plant.

Versions

VersionPublishedarchecState
0.1.02026-11-12>=0.10public

Signature

Signed by arche with key e660d0a8851875b9. Files: 3, fingerprint sha256-5128c8a480dd395c623e…. archec add checks both before it writes anything.

Discussion

Loading…