control.pid.classes package
Submodules
control.pid.classes.EnergyController module
- class control.pid.classes.EnergyController.EnergyController(upright_threshold=0.2, length=0.02)
Bases:
objectSpeed-Based Controller class for Furuta Pendulum
- calculate_bar_mass(radius, height)
Calculate the mass of a steel cylinder
- Parameters:
radius (float) – Radius of the cylinder
height (float) – Height of the cylinder
- Returns:
Mass of the cylinder
- Return type:
mass (float)
- calculate_polar_inertia(mass, length)
Calculate the polar moment of inertia of a thin rod about its pivot
- Parameters:
mass (float) – Mass of the rod
length (float) – Length of the rod
- Returns:
Polar moment of inertia of the rod about its pivot
- Return type:
polar_inertia (float)
- control(angle, angular_velocity)
Compute Speed-Based control signal
- Parameters:
angle (float) – Angle of the bar, in the range [-pi, pi]
angular_velocity (float) – Angular velocity of the bar, in the range [-10, 10]
- Returns:
Motor speed control input
- Return type:
control_input (float)
- reset()
Reset Speed-Based controller
- total_energy(angle, angular_velocity)
Calculate the total energy of the system
- Parameters:
angle (float) – Angle of the bar, in the range [-pi, pi]
angular_velocity (float) – Angular velocity of the bar, in the range [-10, 10]
- Returns:
Total energy of the system
- Return type:
total_energy (float)