Prototyp V2
Dependencies: PM2_Libary
Diff: main.cpp
- Branch:
- michi
- Revision:
- 59:f6c3e42f16c7
- Parent:
- 58:3cd93949a7d7
- Child:
- 60:b2e9958f2298
diff -r 3cd93949a7d7 -r f6c3e42f16c7 main.cpp --- a/main.cpp Wed Apr 20 11:00:55 2022 +0200 +++ b/main.cpp Wed Apr 20 11:02:17 2022 +0200 @@ -48,7 +48,7 @@ // create SpeedController and PositionController objects, default parametrization is for 78.125:1 gear box const float max_voltage = 12.0f; // define maximum voltage of battery packs, adjust this to 6.0f V if you only use one batterypack const float counts_per_turn_wheels = 20.0f * 78.125f; // define counts per turn at gearbox end (counts/turn * gearratio) for wheels -const float counts_per_turn_arm = 20.0f * 78.125f * 10.0f; // define counts per turn at gearbox end (counts/turn * gearratio) for arm +const float counts_per_turn_arm = 20.0f * 78.125f * 20.0f; // define counts per turn at gearbox end (counts/turn * gearratio) for arm const float kn = 180.0f / 12.0f; // define motor constant in rpm per V const float k_gear = 100.0f / 78.125f; // define additional ratio in case you are using a dc motor with a different gear box, e.g. 100:1 (DC with 100:1 has 2'000 turns for 360°) const float kp = 0.1f; // define custom kp, this is the default speed controller gain for gear box 78.125:1