workshop 1
Dependencies: PM2_Libary Eigen
Fork of PM2_Example_Summer_School by
Diff: main.cpp
- Revision:
- 42:883d16a5d59e
- Parent:
- 41:8a63b01edd7e
- Child:
- 43:a889b6a30787
--- a/main.cpp Tue May 17 15:42:29 2022 +0200 +++ b/main.cpp Tue May 17 16:39:54 2022 +0200 @@ -56,12 +56,14 @@ SpeedController speedController_M1(counts_per_turn, kn, max_voltage, pwm_M1, encoder_M1); // default 78.125:1 gear box with default contoller parameters //SpeedController speedController_M1(counts_per_turn * k_gear, kn / k_gear, max_voltage, pwm_M1, encoder_M1); // parameters adjusted to 100:1 gear + speedController_M1.setMaxAccelerationRPS(999.0f); // disable internal trajectory planer PositionController positionController_M2(counts_per_turn, kn, max_voltage, pwm_M2, encoder_M2); // default 78.125:1 gear with default contoller parameters //PositionController positionController_M2(counts_per_turn * k_gear, kn / k_gear, max_voltage, pwm_M2, encoder_M2); // parameters adjusted to 100:1 gear, we need a different speed controller gain here //positionController_M2.setSpeedCntrlGain(kp * k_gear); + positionController_M2.setMaxAccelerationRPS(999.0f); // disable internal trajectory planer // define maximum speed that the position controller is changig the speed, has to be smaller or equal to kn * max_voltage - float max_speed_rps = 0.5f; + float max_speed_rps = 2.0f; positionController_M2.setMaxVelocityRPS(max_speed_rps); // attach button fall and rise functions to user button object @@ -89,8 +91,8 @@ if (do_execute_main_task) { - speedController_M1.setDesiredSpeedRPS(0.5f); - positionController_M2.setDesiredRotation(1.5f); + speedController_M1.setDesiredSpeedRPS(2.0f); + positionController_M2.setDesiredRotation(3.0f); } else {