Skip to content

Commit

Permalink
Docs for DrivetrainCommand_s
Browse files Browse the repository at this point in the history
  • Loading branch information
mileskent committed Sep 21, 2024
1 parent 25f12f0 commit 487d15d
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/systems/include/TorqueControllerMux.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,24 @@ class TorqueControllerMux
DrivetrainCommand_s previous_controller_command,
DrivetrainCommand_s desired_controller_out);

/// @brief Clamps negative rpms to 0f
/// @param const DrivetrainCommand_s &command provides the rpm info as a DrivetrainCommand_s
DrivetrainCommand_s apply_positive_speed_limit_(const DrivetrainCommand_s &command);

/// @brief Ensure torque is at most at the specified limit. If exceeding, then limit it in the returned DrivetrainCommand_s
/// @param const DrivetrainCommand_s &command is a DrivetrainCommand_s, which provides torque info
/// @param float max_torque is the maximum average torque the wheels are allowed to experience before it is limited.
DrivetrainCommand_s apply_torque_limit_(const DrivetrainCommand_s &command, float max_torque);

/// @brief Apply power limit such that the mechanical power of all wheels never exceeds the preset mechanical power limit. Scales all wheels down to preserve functionality of torque controllers
/// @param const DrivetrainCommand_s &command provides torque info, which is used to calculate mechanical power
/// @param const DrivetrainDynamicReport_s &drivetrain provides RPMS, which are used to calculate radians / s
/// @param float max_torque is used to indirectly specifiy the max power
DrivetrainCommand_s apply_power_limit_(const DrivetrainCommand_s &command, const DrivetrainDynamicReport_s &drivetrain, float power_limit, float max_torque);

/// @brief begin limiting regen at noRegenLimitKPH (hardcoded in func) and completely limit regen at fullRegenLimitKPH (hardcoded in func)
/// @param const DrivetrainCommand_s &command
/// @param const DrivetrainDynamicReport_s &drivetrain_data provides RPMs
DrivetrainCommand_s apply_regen_limit_(const DrivetrainCommand_s &command, const DrivetrainDynamicReport_s &drivetrain_data);

public:
Expand Down Expand Up @@ -123,4 +138,4 @@ const int number_of_controllers = 5;
using TCMuxType = TorqueControllerMux<number_of_controllers>;

#include "TorqueControllerMux.tpp"
#endif // __TorqueControllerMux_H__
#endif // __TorqueControllerMux_H__

0 comments on commit 487d15d

Please sign in to comment.