import { Subject, Subscription } from 'rxjs'; import { MotionMasterClient } from './motion-master-client'; import { ChirpSignalOptions } from './os-command'; import { DeviceRef } from './types'; /** * Options for executing the Limited Range System Identification procedure. * * Extends {@link ChirpSignalOptions} with additional parameters that bound the * allowed position excursion during the chirp excitation. These limits ensure the * joint remains within a safe ±position window while the controller dynamically * adjusts the position-loop gain. */ export interface LimitedRangeSystemIdentificationOptions extends ChirpSignalOptions { /** * The symmetric position excursion limit (±value), expressed in * position units. This defines the maximum allowable deviation from the * reference position during chirp excitation. As the position error approaches * this limit, the adaptive algorithm increases the position-loop Kp to keep the * joint within the bounded range. */ rangeLimit: number; /** * The minimum admissible excursion limit used as a lower bound in internal * scaling calculations. This value prevents division by very small ranges and * stabilizes gain computation during the identification sequence. */ rangeLimitMin: number; } /** * Performs a limited-range system identification procedure on a device. * * This class safely executes the system identification process while preserving * the device's original configuration (PID parameters, encoder settings, position * feedback filter). It emits notifications about progress and status updates, which * can be displayed in a UI or logged for debugging. */ export declare class LimitedRangeSystemIdentification { readonly client: MotionMasterClient; readonly deviceRef: DeviceRef; readonly options: LimitedRangeSystemIdentificationOptions; /** * Emits status and progress messages during the procedure. * Subscribers can display these messages in a UI or log them. */ readonly notifications$: Subject; /** * Indicates whether the system identification procedure is currently running. */ isRunning: boolean; /** * Subscription for data monitoring during the procedure. */ dataMonitoringSubscription?: Subscription; /** * Creates a new instance of the limited-range system identification routine. * * @param client - The Motion Master client used for communication with the device. * @param deviceRef - A reference to the target device. * @param options - Configuration options for the procedure. */ constructor(client: MotionMasterClient, deviceRef: DeviceRef, options?: LimitedRangeSystemIdentificationOptions); /** * Starts the limited-range system identification procedure. * * This method: * - Ensures the device is in a safe state. * - Computes and sets initial PID values. * - Starts data monitoring for position feedback. * - Runs the chirp signal on the device. * - Computes the plant model without the chirp signal. * - Restores all device settings to their original values. * * Emits notifications to `notifications$` for each major step and error. * * @throws Will throw an error if any of the device requests fail. */ start(): Promise; }