# LinearSystemId

class wpimath.system.plant.LinearSystemId

Bases: `pybind11_object`

Linear system ID utility functions.

static DCMotorSystem(*args, **kwargs)

1. DCMotorSystem(motor: wpimath._controls._controls.plant.DCMotor, J: wpimath.units.kilogram_square_meters, gearing: float) -> wpimath._controls._controls.system.LinearSystem_2_1_2

Create a state-space model of a DC motor system. The states of the system are [angular position, angular velocity], inputs are [voltage], and outputs are [angular position, angular velocity].

Parameters:
• motor – The motor (or gearbox) attached to the system.

• J – the moment of inertia J of the DC motor.

• gearing – Gear ratio from motor to output. @throws std::domain_error if J <= 0 or gearing <= 0. @see <a href=”https://github.com/wpilibsuite/sysid”>https://github.com/wpilibsuite/sysid</a>

1. DCMotorSystem(kV: wpimath.units.volt_seconds_per_meter, kA: wpimath.units.volt_seconds_squared_per_meter) -> wpimath._controls._controls.system.LinearSystem_2_1_2

Create a state-space model of a DC motor system from its kV (volts/(unit/sec)) and kA (volts/(unit/sec²)). These constants can be found using SysId. the states of the system are [position, velocity], inputs are [voltage], and outputs are [position].

You MUST use an SI unit (i.e. meters or radians) for the Distance template argument. You may still use non-SI units (such as feet or inches) for the actual method arguments; they will automatically be converted to SI internally.

The parameters provided by the user are from this feedforward model:

u = K_v v + K_a a

@throws std::domain_error if kV < 0 or kA <= 0.

Parameters:
• kV – The velocity gain, in volts/(unit/sec).

• kA – The acceleration gain, in volts/(unit/sec²).

static drivetrainVelocitySystem(motor: wpimath._controls._controls.plant.DCMotor, mass: wpimath.units.kilograms, r: wpimath.units.meters, rb: wpimath.units.meters, J: wpimath.units.kilogram_square_meters, gearing: float)

Create a state-space model of differential drive drivetrain. In this model, the states are [left velocity, right velocity], the inputs are [left voltage, right voltage], and the outputs are [left velocity, right velocity]

Parameters:
• motor – The motor (or gearbox) driving the drivetrain.

• mass – The mass of the robot in kilograms.

• r – The radius of the wheels in meters.

• rb – The radius of the base (half of the track width), in meters.

• J – The moment of inertia of the robot.

• gearing – Gear ratio from motor to wheel. @throws std::domain_error if mass <= 0, r <= 0, rb <= 0, J <= 0, or gearing <= 0.

static elevatorSystem(motor: wpimath._controls._controls.plant.DCMotor, mass: wpimath.units.kilograms, radius: wpimath.units.meters, gearing: float)

Create a state-space model of the elevator system. The states of the system are [position, velocity], inputs are [voltage], and outputs are [position].

Parameters:
• motor – The motor (or gearbox) attached to the carriage.

• mass – The mass of the elevator carriage, in kilograms.

• radius – The radius of the elevator’s driving drum, in meters.

• gearing – Gear ratio from motor to carriage. @throws std::domain_error if mass <= 0, radius <= 0, or gearing <= 0.

static flywheelSystem(motor: wpimath._controls._controls.plant.DCMotor, J: wpimath.units.kilogram_square_meters, gearing: float)

Create a state-space model of a flywheel system, the states of the system are [angular velocity], inputs are [voltage], and outputs are [angular velocity].

Parameters:
• motor – The motor (or gearbox) attached to the flywheel.

• J – The moment of inertia J of the flywheel.

• gearing – Gear ratio from motor to flywheel. @throws std::domain_error if J <= 0 or gearing <= 0.

static identifyDrivetrainSystem(*args, **kwargs)

1. identifyDrivetrainSystem(kVLinear: wpimath.units.volt_seconds_per_meter, kALinear: wpimath.units.volt_seconds_squared_per_meter, kVAngular: wpimath.units.volt_seconds_per_meter, kAAngular: wpimath.units.volt_seconds_squared_per_meter) -> wpimath._controls._controls.system.LinearSystem_2_2_2

Identify a differential drive drivetrain given the drivetrain’s kV and kA in both linear {(volts/(meter/sec), (volts/(meter/sec²))} and angular {(volts/(radian/sec), (volts/(radian/sec²))} cases. These constants can be found using SysId.

States: [[left velocity], [right velocity]] Inputs: [[left voltage], [right voltage]] Outputs: [[left velocity], [right velocity]]

Parameters:
• kVLinear – The linear velocity gain in volts per (meters per second).

• kALinear – The linear acceleration gain in volts per (meters per second squared).

• kVAngular – The angular velocity gain in volts per (meters per second).

• kAAngular – The angular acceleration gain in volts per (meters per second squared). @throws domain_error if kVLinear <= 0, kALinear <= 0, kVAngular <= 0, or kAAngular <= 0. @see <a href=”https://github.com/wpilibsuite/sysid”>https://github.com/wpilibsuite/sysid</a>

1. identifyDrivetrainSystem(kVLinear: wpimath.units.volt_seconds_per_meter, kALinear: wpimath.units.volt_seconds_squared_per_meter, kVAngular: wpimath.units.volt_seconds_per_radian, kAAngular: wpimath.units.volt_seconds_squared_per_radian, trackwidth: wpimath.units.meters) -> wpimath._controls._controls.system.LinearSystem_2_2_2

Identify a differential drive drivetrain given the drivetrain’s kV and kA in both linear {(volts/(meter/sec)), (volts/(meter/sec²))} and angular {(volts/(radian/sec)), (volts/(radian/sec²))} cases. This can be found using SysId.

States: [[left velocity], [right velocity]] Inputs: [[left voltage], [right voltage]] Outputs: [[left velocity], [right velocity]]

Parameters:
• kVLinear – The linear velocity gain in volts per (meters per second).

• kALinear – The linear acceleration gain in volts per (meters per second squared).

• kVAngular – The angular velocity gain in volts per (radians per second).

• kAAngular – The angular acceleration gain in volts per (radians per second squared).

• trackwidth – The distance between the differential drive’s left and right wheels, in meters. @throws domain_error if kVLinear <= 0, kALinear <= 0, kVAngular <= 0, kAAngular <= 0, or trackwidth <= 0. @see <a href=”https://github.com/wpilibsuite/sysid”>https://github.com/wpilibsuite/sysid</a>

static identifyPositionSystemMeters(kV: wpimath.units.volt_seconds_per_meter, kA: wpimath.units.volt_seconds_squared_per_meter)

Create a state-space model for a 1 DOF position system from its kV (volts/(unit/sec)) and kA (volts/(unit/sec²)). These constants can be found using SysId. the states of the system are [position, velocity], inputs are [voltage], and outputs are [position].

You MUST use an SI unit (i.e. meters or radians) for the Distance template argument. You may still use non-SI units (such as feet or inches) for the actual method arguments; they will automatically be converted to SI internally.

The parameters provided by the user are from this feedforward model:

u = K_v v + K_a a

@throws std::domain_error if kV < 0 or kA <= 0. @see <a href=”https://github.com/wpilibsuite/sysid”>https://github.com/wpilibsuite/sysid</a>

Parameters:
• kV – The velocity gain, in volts/(unit/sec).

• kA – The acceleration gain, in volts/(unit/sec²).

static identifyVelocitySystemMeters(kV: wpimath.units.volt_seconds_per_meter, kA: wpimath.units.volt_seconds_squared_per_meter)

Create a state-space model for a 1 DOF velocity system from its kV (volts/(unit/sec)) and kA (volts/(unit/sec²)). These constants can be found using SysId. The states of the system are [velocity], inputs are [voltage], and outputs are [velocity].

You MUST use an SI unit (i.e. meters or radians) for the Distance template argument. You may still use non-SI units (such as feet or inches) for the actual method arguments; they will automatically be converted to SI internally.

The parameters provided by the user are from this feedforward model:

u = K_v v + K_a a

Parameters:
• kV – The velocity gain, in volts/(unit/sec).

• kA – The acceleration gain, in volts/(unit/sec²). @throws std::domain_error if kV < 0 or kA <= 0. @see <a href=”https://github.com/wpilibsuite/sysid”>https://github.com/wpilibsuite/sysid</a>