Skip to main content

PID Gains

The PID gains subprotocols allow the GCS to read and update the PID gains for the various controllers used by the UAV.

PID Gains Read

The PID gains read subprotocol allows the GCS to read the PID gains used by the UAV in one of its controllers, either initiated by the Operator or when a connection is established.

Messages

  1. PID_GAINS_READ_REQUEST
  2. PID_GAINS

Sequence

sequenceDiagram
participant GCS
participant UAV

loop n
GCS->>UAV: PID_GAINS_READ_REQUEST
GCS->>GCS: Start timeout
alt success
UAV-->>GCS: PID_GAINS
else failure
GCS->>GCS: Timeout expires
end
end
  1. If the GCS wants to read the stored PID gains of a specific controller from the UAV (including when a connection is established), it sends a PID_GAINS_READ_REQUEST message to the UAV.
  2. The GCS starts a timeout of a fixed duration.
  3. If the UAV responds with a PID_GAINS message before the timeout expires, the operation is considered a successful.
  4. If the timeout expires before the UAV can respond, the GCS retries the operation upto n times before the operation is considered a failure, the error is reported and the UAV continues operations.

PID Gains Write

The PID gains write subprotocol allows the GCS to update the PID gains used by the UAV in one of its controllers.

Messages

  1. PID_GAINS_WRITE_REQUEST
  2. PID_GAINS_WRITE_REQUEST_ACK

Sequence

sequenceDiagram
participant GCS
participant UAV

loop n
GCS->>UAV: PID_GAINS_WRITE_REQUEST
GCS->>GCS: Start timeout
alt success

loop n
UAV-->>GCS: PID_GAINS_READ_REQUEST
UAV->>UAV: Start timeout

alt success

loop n
GCS->>UAV: PID_GAINS
GCS->>GCS: Start timeout

alt success
UAV-->>GCS: PID_GAINS_ACK
else cancelled
UAV-->GCS: PID_GAINS_NACK
else failure
GCS->>GCS: Timeout expired
end
end
else failure
end
end

else cancelled
UAV->>GCS: PID_GAINS_WRITE_REQUEST_NACK

else failure
GCS->>GCS: Timeout expires
end
end
  1. If the GCS wants to update the stored PID gains of a specific controller from the UAV, it sends a PID_GAINS_WRITE_REQUEST message to the UAV (includes the new PID gains).
  2. The GCS starts a timeout of a fixed duration.
  3. If the UAV responds with a PID_GAINS_WRITE_REQUEST_ACK message before the timeout expires, the operation is considered successful.
  4. If the timeout expires before the UAV can send a response, the GCS retries the operation upto n times before the operation is considered a failure, the error is reported and the UAV continues operations.