I was preparing a lecture on ArduPilot’s PID loops - the cascade, what is actually closed in each mode, why we command rate when what we want is an angle. The slides were not enough. I wanted the loops on a live vehicle, not a diagram in a PDF.
So I wrote ArduLoops: a small stand that links to SITL (or any MAVLink craft) and shows the loops in three views.
Plot - angle we want (°) vs rate we command (°/s); stick / target / actual.
Cascade - stock Copter map. PosControl holds where to be, Attitude Control holds the angle. Blocks that the current mode does not close are dimmed. Click a block for its gains.
It is a reading tool. Not a GCS, not a tuning protocol, not a Mission Planner replacement. Wool / Stock / Sharp are just feel presets on the stand. Plane cascade is still a stub.
The same running app also serves MCP. An agent (Cursor, Claude, whatever speaks MCP) can talk to your board or SITL through ArduLoops: connect, read state, get/set params, change mode, arm/disarm, STATUSTEXT. The app is already the MAVLink link; the agent is not a second GCS on the same TCP port.
I would like an outside view. Does the Copter map match how you think about the loops? Is handing MCP to a live craft a useful idea, or a bad one? Corrections welcome.
I am asking the community for help, especially from people who actually fly and tune planes.
I built a small live stand for seeing ArduPilot loops - which blocks the current mode closes, and which knobs sit on them. It started as a copter tool. I recently drew a Plane map, with L1 and TECS as the outer path. I am not a plane person. I would like to ask you to look at the map and the two outer schemes and tell me where they are wrong, incomplete, or the convenient lie.
It is not Mission Planner, not Autotune, and not a tuning protocol.
One picture of the live path. Top is command (stick + mission targets). Then a Navigate band: L1 and TECS sit outside attitude, side by side. Then roll and pitch as two cards, yaw damper, ground steer, then surfaces.
Empty map = this mode’s path (dimmed cards are not closed now). Click a card = only that block’s in and out. Left edge: solid = tune these, hollow double = later, dashed = no knobs.
What I am trying to say with that layout:
There is noPSC_* stack on a wing. Horizontal path is L1 (cross-track → demanded bank). Height/speed is TECS (energy → pitch + throttle). They are not one “outer PID”.
L1 writes nav_roll into the roll loop. TECS writes nav_pitch and throttle. In FBWA the stick is the angle and the left stick is still throttle — L1/TECS should go dim. In AUTO / LOITER / RTL they should light up (TECS also in FBWB / CRUISE).
I may have the live-in-mode list wrong (TAKEOFF, GUIDED, TRAINING, CRUISE vs FBWB). That dimming is the part I trust least.
If the map’s shape is wrong - wrong neighbours, wrong “outside”, a missing first-flight block — that is the most useful reply I can get.
L1 - what the Loop tab draws when you click that card
The scheme is: look a distance L1 ahead of the track → lateral acceleration → bank φ = atan(a/g) → nav_roll for the roll loop.
L1 = (1/π) · DAMPING · PERIOD · groundspeed (so the same PERIOD feels the same at different speeds)
K = 4 · DAMPING²
a = K · V² / L1 · sin(Nu) — Nu and a_y are not on this MAVLink sample; we show nav_roll
NAVL1_PERIOD is the main knob (wiki start ~17, damping 0.75). Smaller = tighter turn. Weaving after a turn: add 1–2 s. Turn too slow: subtract about 5.
Tune roll first. Raising PERIOD will not hold a wing that cannot hold bank. ROLL_LIMIT_DEG is the stall-safe bank, not an L1 gain. WP_RADIUS is fly-through vs turn-early.
Also on the picture: height error and airspeed feed SPE/SKE; throttle and pitch limits (THR_MAX, TRIM_THROTTLE, PTCH_LIM_*, climb/sink) sit at the edges. Click a block for extra knobs under the scheme; the sidebar keeps the main ones.
Stories I need checked:
Throttle cannot set the balance - that is pitch. Pitch cannot set the total - that is throttle.
Without an airspeed estimate, W is forced to 0.
Measure TECS_CLMB_MAX / SINK_MIN / SINK_MAX in FBWA; if they are optimistic, height oscillates.
Porpoise → pitch rate first, then TECS_TIME_CONST. Do not hunt a height P.
In FBWA the left stick is still throttle. TECS should not look “live” there.
If SPE/SKE/STE/SEB/W is not how you think about TECS, or the arrows are swapped, please say so in those letters.
Inner loops (rate FF in FBWA, yaw damper, ground steer) are on the same map below L1/TECS. Happy to hear if those cards are wrong too — but the ask is the Navigate band.
How to try it
Windows or Linux x86_64 from release 1.1.0. SITL in the header → plane thumb → Start. It downloads official SITL and Links tcpout:127.0.0.1:5770.
Then:
Leave it in FBWA. Empty map: L1/TECS dim, roll/pitch live. Does that match the aircraft?
Switch AUTO (or FBWB / CRUISE). Do L1 and TECS light the way you expect?
Click L1, open Loop. Then TECS. Walk the blocks. If a box or an arrow is the lie, name it.
A real board is the same Link (close Mission Planner - one TCP client per SITL port). From source: npm install && npm run dev → http://127.0.0.1:5173.
ArduLoops 2.0 is the same station, with an AI assistant integrated. It is for a first setup and for someone who already tunes. It is still not Mission Planner, not Autotune, and not a tuning protocol. The wiki is still the protocol. The stand still shows which loops the current mode actually closes.
The assistant reads the ArduPilot Wiki and Sources, the parameters on the vehicle, and a DataFlash log, which it can download as well. A number in a reply is a measurement a tool returned. It does not invent one. It does not write a parameter until you Approve changes; that shows the old value, the new value, and the reason. Reject leaves the vehicle as it is. Audit is the list of what was actually written.
Before you type, it offers example jobs:
Download the newest log and judge how well every loop on this airframe is tuned. Name each loop the log and the parameters show.
From the saved parameters, identify the airframe, open its current tuning process, and say the single next change.
Calculate filter settings from the newest downloaded log. Use only a frequency the tools return.
Name the PID term to move, and the size of the step.
If the next step is a calibration rather than a number, it can hand you a wizard. You open it, and you run it. Some of them I want eyes on.
Motors. The picture is the frame already on the vehicle. The numbers are the motors. The setup spins each output, and you tap the arm that turned. If the outputs already match the frame, it says so and does not pretend there is work left. You can ask the Assistant to show the widget explicitly, or it can suggest doing it if motors are not set.
Compass. Stored offsets are the last calibration: offset, length, diagonals, off-diagonals, the live field, and the EKF compass variance. Start runs a new one. You turn the vehicle until every compass fills. Motor-current compensation is a separate step.
The same card can also open the accelerometer, motor-current compensation, the radio ends, the flight-mode switch, or the battery. I am less sure those screens are right. Motors and compass are the ones I want read first.
You can also ask it to draw. For a downloaded log it puts the chart under the reply: the lines that measurement used, with the log field on the axis. For the live link it opens one window of the fields that are actually arriving, or of a parameter on this vehicle. A name that is neither is not drawn. The live window is about the last minute.
When a fact about this airframe is not a parameter, it can ask you to say it and keep it. The usual missing ones are the span, the mass, and the propeller size. It asks only for the ones that are not already in the note and that you have not just said. The note is local to this controller. It is not a parameter and not a log.
It can order a custom build on the official server, custom.ardupilot.org. It reads that catalog for the vehicle, the version, the board, and the features. When you ask it to build, it queues the plan and waits until the build finishes. The download stores the image in the firmware library. A download is not a flash.
A flash is a separate step, over USB, and only while the vehicle is disarmed. Outside safe mode it stops on a card, and nothing is written until you approve it. The phone build has no USB bootloader port, so it cannot flash. A finished flash is not a flight test.
There is a great deal more than the pieces above. Those are only a small part of what it will do. Ask it in ordinary language about any part of setting up ArduPilot. Describe how the vehicle behaves now, and ask it to improve that. I have found it absorbing, and effective.
The loops page did not go away. Map on the left, the selected block as a scheme, traces underneath. Dimmed blocks are not closed in this mode.
Installers are ArduLoops 2.0.0. Windows, Linux, and macOS. SITL in the header, or Link a board. Android is a link client. Source is still npm install && npm run dev.
I would like the same kind of correction as last time.
For a first flight: is that setup order missing a step, or is a step in the wrong place?
For someone who already tunes: is “name the loop, name the term, do not write” a useful first reply, or should the proposal come sooner?
Beside Yuri comment, thanks for this . I didn’t try yet, but that look interesting to help people to understand what is really happening on control loop !
Thank @Yuri_Rage , it makes sense to post updates in the same topic. I’ll do this for the following updates.
The reason I’ve created a separate topic for this update is to share a completely new experience: AI-assisted ArduPilot configuration.
It is working great, and it is fast for me to make my 5-inch drone stable using OF stabilisation.
So, I want to share not just a product update, but the new experience.
Anyway, thanks for the suggestion! I appreciate it!