ConstantPWM¶
- class ConstantPWM(timer: Timer, powertrain: Powertrain, target_pwm_value: float | int)¶
Bases:
RuleBaseConstantPWMobject.It can be used to make a gradual start of the
powertrain’s motion, in order to avoid a peak in thepowertrain’s DC motor absorbed electric current.It checks whether the
timeris active and, if so, it sets thepwmofpowertrainmotor to the constanttarget_pwm_value.Methods¶
apply()It checks if
timeris active and, if so, it returns thepwmto apply to thepowertrainmotor, equal totarget_pwm_value.
Raises
TypeErrorIf
timeris not an instance ofTimer,if
powertrainis not an instance ofPowertrain,
ValueErrorIf
target_pwm_valueis not within-1and1.
See Also