#include <power_limiter.hpp>
◆ RefSerial
◆ PowerLimiter()
| trap::control::chassis::PowerLimiter::PowerLimiter |
( |
const RefSerial & |
m_refereeSystem, |
|
|
const Config & |
config |
|
) |
| |
Constructs a power limiter helper object.
- Parameters
-
◆ getPowerLimitRatio()
| double trap::control::chassis::PowerLimiter::getPowerLimitRatio |
( |
| ) |
const |
|
override |
A function to be called repeatedly (in a subsystem's refresh function, for example). Checks the voltage through the referee system and the current using the current sensor to calculate current power consumption, which is used to update the energy buffer by integrating power. Once the energy buffer is known, it is used in conjunction with the constants passed in through the constructor to compute a fraction that can be used to perform power limiting.
- Note
- Must be called immediately after setpoints are configured. This function returns a value between [0, 1] that you should then multiply the desired output of your motor by. See class comment for more details.
-
Tested with a normal four-wheel mecanum chassis and a two-wheel sentry chassis.
◆ initialize()
| void trap::control::chassis::PowerLimiter::initialize |
( |
| ) |
|
|
override |
◆ update()
| void trap::control::chassis::PowerLimiter::update |
( |
| ) |
|
|
override |
The documentation for this class was generated from the following files: