This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
machines-backup/components/hal/firmware/zoe/common/ppmath_motor.cpp
2024-10-01 17:06:14 +02:00

17 lines
475 B
C++

#include "ppmath_motor.h"
int vfd_calc_vsi(int rpm)
{
return ((rpm * VFD_VSI_MAX_V_SPEED) / MOTOR_FREQ_CMAX);
}
int vfd_calc_vsi_grinder(int rpm){
return VFD_VSI_SCALE *
vfd_calc_vsi(
clamp<int>(rpm * RPM_GRINDER_SHREDDER_SCALE, RPM_GRINDING_MIN, RPM_GRINDING_MAX)
);
}
int vfd_calc_vsi_shredder(int rpm){
return VFD_VSI_SCALE *
vfd_calc_vsi(
clamp<int>(rpm, RPM_SHREDDERING_MIN, RPM_SHREDDERING_MAX)
);
}