Your Companion in Tech, only Techlania

Opening interactive features…

techlaniaA Robotics & Drone Solutions Company for Industry & Education

Tune a PID controller safely

By Techlania Team · Control Systems

Check the setup, limits and feedback before tuning.

Editorial illustration: a stationary quadcopter on a bench fixture.

A three-axis drone test rig can help a university team observe roll, pitch and yaw responses without starting every experiment with a take-off. It is most useful when the experiment has a defined question, a suitable fixture and a clear stopping procedure.

A rig does not make a powered aircraft inherently safe. This article is a planning framework for a supervised laboratory, not operating instructions for an unverified rig or a particular Techlania product. Use the aircraft, firmware and rig manufacturers' approved procedures.

Concept feedback loop linking a target angle, PID controller, three-axis drone rig and measured response.
Concept feedback loop linking a target angle, PID controller, three-axis drone rig and measured response.

Understand what the rig changes

A restrained aircraft and a freely flying aircraft are different control plants. Bearings, mounting hardware, cables, mechanical stops and the fixture's inertia can influence the measured response. A smooth bench response therefore does not establish that the same gains are suitable for flight.

Record which axes are free, the permitted angular travel and the configuration under test. If the fixture is intended only for demonstrations, do not assume it is suitable for quantitative flight-controller identification.

Stock airborne autotuning is particularly important here. ArduPilot's AutoTune documentation describes an aircraft that is already flyable and a procedure involving flight manoeuvres. Do not run an airborne AutoTune routine on a restrained aircraft unless the firmware and rig suppliers explicitly document a compatible bench procedure.

Prepare the experiment before connecting propulsion power

Start with the test objective. For example, compare the repeatability of a small attitude response under two documented controller configurations. Choose the acceptance criteria before adjusting gains.

The lab supervisor should approve:

  • The rig's compatibility with the aircraft's mass, geometry, thrust and expected loads.
  • Fixture integrity, attachment points, guards, clearances and a controlled exclusion area.
  • The maximum permitted commands, travel, run duration and equipment temperatures.
  • The emergency stopping and power-isolation arrangement.
  • Who operates the controls, who observes the test and who can stop it.

Keep the aircraft unpowered while installing or adjusting its fixture. Inspect electrical connections and route cables so that movement cannot pull a connector into a propeller or alter an axis unexpectedly.

Complete propeller-off checks first

Remove the propellers for configuration and permitted motor-function checks. Confirm the firmware's frame configuration, output mapping, motor direction and sensor orientation using its own documentation. A motor-numbering diagram from a different flight stack is not a substitute.

The ArduPilot motor-connection guide provides frame-specific mapping information. PX4's basic PID guide also identifies configuration checks that precede tuning.

Verify the feedback sign and displayed attitude with propulsion disabled. Incorrect sensor orientation or motor mapping must be corrected before evaluating PID behaviour. Increasing gains cannot repair those faults.

Test the documented stop behaviour with propellers removed. A software disarm command, radio kill function and electrical power isolation can behave differently. PX4's safety documentation explains its emergency-switch behaviour; verify the exact behaviour of your installed firmware rather than assuming that every switch is equivalent.

Establish a baseline and collect useful logs

Save a recoverable copy of the original configuration. Record firmware version, controller settings, motor and propeller configuration, battery condition, fixture settings and any added payload.

Where supported, record the commanded response, measured attitude or angular rate, actuator outputs and available vibration or controller diagnostics. Check the timestamps and units before comparing plots. A screenshot without the associated configuration makes later interpretation difficult.

Use simulation for software and control-logic experiments that do not require physical hardware. PX4 documents software-in-the-loop and hardware-in-the-loop simulation. Simulation results still depend on the model, but they can expose basic logic problems before a powered bench test.

Compare small, controlled changes

Powered testing should begin only after the reviewed setup is ready, with appropriate guards and the manufacturer's operating limits in force. Never approach or adjust a live rotating assembly.

Use the tuning method specified for the installed controller. Many flight stacks contain cascaded loops, so follow their documented order rather than treating all PID parameters as interchangeable. Change one documented factor at a time and repeat the same approved test.

For each comparison, ask:

  • Does the response approach its target consistently?
  • Is there overshoot, sustained oscillation or unexplained drift?
  • Are outputs saturating or equipment limits being approached?
  • Does the same configuration give a repeatable result?

Stop at the pre-agreed limits or whenever behaviour is abnormal. De-energise before inspection. Do not keep increasing gains simply because a plot appears sluggish; friction, sensor noise, filtering or actuator limits may be the real cause.

Separate a successful lab result from flight readiness

A useful report states what was demonstrated, the fixture's limitations and the conditions still untested. Include the original and final configurations, representative logs, repeat trials and reasons for accepting or rejecting each change.

Any later flight validation needs its own approved procedure, suitable location and competent personnel. Do not describe a rig-tested tune as flight-certified.

For a university setup, discuss your engineering requirements with Techlania. Share your aircraft configuration, learning objectives, required measurements and the procedures your lab needs to support. You can also explore lab trainers and browse components while preparing the specification.

Visual guide

Techlania gyroscope/gimbal trainer design animation. Illustrative kinematics only; not recorded testing or a calibrated dynamics model.

The animation illustrates mechanical motion of a gyroscope trainer. It is not a demonstration of the drone-rig tuning procedure above.