Trouble using sylib for flywheel velocity control

I’m trying to use the sylib velocity controller for my flywheel, but when I go to tune it, the motor runs at full power even when I have this as my speed controller

sylib::Motor flyBack = sylib::Motor(flyBackPort, 600, false, flyController);
sylib::Motor flyFront =  sylib::Motor(flyFrontPort, 600, true, flyController);

sylib::SpeedControllerInfo flyController (
    [](double rpm){return 0;},
        0, // kP
        0, // kI
        0, // kD
        0, // kH
        false, // anti-windup enabled
        0, // anti-windup range
        false, // p controller bounds threshold enabled
        0, // p controller bounds cutoff enabled
        0, // kP2 for when over threshold
        0 // range to target to apply max voltage
);

and this to control my motors

flyFront.set_velocity_custom_controller(600);
flyBack.set_velocity_custom_controller(600);

When I run get_p_voltage,get_i_voltage,get_d_voltage,get_tbh_voltage, and get_estimator_voltage, they all return 0, but running get_applied_voltage always returns 12000. Am I using the speed controller wrong? I would assume 0 volts of power is sent to the motors when everything is set to 0.

1 Like