pid_controller

Modules

pid_controller_system module

class PIDControllerSystem(kp=0.001, Ti=10, Td=0.0, isReverse=False, **kwargs)[source]

Bases: System, Module

PID Controller System.

This class implements a PID controller with a differentiable saturation function.

Parameters:
  • kp – Proportional gain

  • Ti – Integral time constant

  • Td – Derivative time constant

  • isReverse – Boolean flag to indicate if the controller is reverse

asymptotic_smooth_saturation(u, lower=0.0, upper=1.0, eps=0, curve_start=0.01, steepness=1)[source]
do_step(secondTime, dateTime, step_size, stepIndex)[source]

Do a single step of the system.

Parameters:
  • secondTime (float) – The current time in seconds.

  • dateTime (datetime.datetime) – The current date and time.

  • step_size (int) – The step size of the simulation in seconds.

  • stepIndex (int) – The current step index.

Return type:

None

initialize(start_time, end_time, step_size, simulator)[source]

Initialize the system.

Parameters:
  • start_time (datetime.datetime) – The start time of the simulation.

  • end_time (datetime.datetime) – The end time of the simulation.

  • step_size (int) – The step size of the simulation in seconds.

  • simulator (core.Simulator) – The simulator.

Return type:

None

property config
sp = [<twin4build.translator.translator.SignaturePattern object>]
get_signature_pattern()[source]