Skip to content

Commit

Permalink
Re-tune for battery power
Browse files Browse the repository at this point in the history
  • Loading branch information
dkt01 committed Sep 28, 2024
1 parent 6eefb14 commit 1a0c0fa
Showing 1 changed file with 38 additions and 37 deletions.
75 changes: 38 additions & 37 deletions src/PlatformApp/PlatformApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@ namespace controlLoop {
constexpr double kI = 0.0;
constexpr double kD = 0.0;
constexpr double kF = 0.05;
constexpr double iZone = 100.0;
constexpr double iZone = 500.0;
constexpr double allowableError = 0.0;
} // namespace drive
namespace rotate {
constexpr double kP = 0.005;
constexpr double kI = 0.00001;
constexpr double kP = 1.4;
constexpr double kI = 0.0005;
constexpr double kD = 0.0;
constexpr double kF = 0.0;
constexpr double iZone = 100.0;
constexpr double allowableError = 0.0;
constexpr double iZone = 500.0;
constexpr double allowableError = 10.0;
} // namespace rotate
} // namespace drive
constexpr static auto rampRate = 0_ms;
} // namespace controlLoop

namespace joystickAxisMaps {
Expand Down Expand Up @@ -113,10 +114,10 @@ namespace motorConfig {
constexpr static auto voltCompSat = 11.0_V;
constexpr static auto nominalOutputForward = 0.0;
constexpr static auto nominalOutputReverse = 0.0;
constexpr static auto peakOutputForward = 0.2;
constexpr static auto peakOutputReverse = -0.2;
constexpr static auto openLoopRamp = 3000_ms;
constexpr static auto closedLoopRamp = 3000_ms;
// constexpr static auto peakOutputForward = 0.2;
// constexpr static auto peakOutputReverse = -0.2;
// constexpr static auto openLoopRamp = controlLoop::rampRate;
// constexpr static auto closedLoopRamp = controlLoop::rampRate;
constexpr static auto pid0_selectedSensor = ctre::phoenix::motorcontrol::FeedbackDevice::IntegratedSensor;
constexpr static auto pid0_kP = controlLoop::drive::drive::kP;
constexpr static auto pid0_kI = controlLoop::drive::drive::kI;
Expand All @@ -143,10 +144,10 @@ namespace motorConfig {
constexpr static auto voltCompSat = 11.0_V;
constexpr static auto nominalOutputForward = 0.0;
constexpr static auto nominalOutputReverse = 0.0;
constexpr static auto peakOutputForward = 0.2;
constexpr static auto peakOutputReverse = -0.2;
constexpr static auto openLoopRamp = 3000_ms;
constexpr static auto closedLoopRamp = 3000_ms;
// constexpr static auto peakOutputForward = 0.2;
// constexpr static auto peakOutputReverse = -0.2;
// constexpr static auto openLoopRamp = controlLoop::rampRate;
// constexpr static auto closedLoopRamp = controlLoop::rampRate;
constexpr static auto pid0_selectedSensor = ctre::phoenix::motorcontrol::FeedbackDevice::IntegratedSensor;
constexpr static auto pid0_kP = controlLoop::drive::drive::kP;
constexpr static auto pid0_kI = controlLoop::drive::drive::kI;
Expand All @@ -173,10 +174,10 @@ namespace motorConfig {
constexpr static auto voltCompSat = 11.0_V;
constexpr static auto nominalOutputForward = 0.0;
constexpr static auto nominalOutputReverse = 0.0;
constexpr static auto peakOutputForward = 0.2;
constexpr static auto peakOutputReverse = -0.2;
constexpr static auto openLoopRamp = 3000_ms;
constexpr static auto closedLoopRamp = 3000_ms;
// constexpr static auto peakOutputForward = 0.2;
// constexpr static auto peakOutputReverse = -0.2;
// constexpr static auto openLoopRamp = controlLoop::rampRate;
// constexpr static auto closedLoopRamp = controlLoop::rampRate;
constexpr static auto pid0_selectedSensor = ctre::phoenix::motorcontrol::FeedbackDevice::IntegratedSensor;
constexpr static auto pid0_kP = controlLoop::drive::drive::kP;
constexpr static auto pid0_kI = controlLoop::drive::drive::kI;
Expand All @@ -203,10 +204,10 @@ namespace motorConfig {
constexpr static auto voltCompSat = 11.0_V;
constexpr static auto nominalOutputForward = 0.0;
constexpr static auto nominalOutputReverse = 0.0;
constexpr static auto peakOutputForward = 0.2;
constexpr static auto peakOutputReverse = -0.2;
constexpr static auto openLoopRamp = 3000_ms;
constexpr static auto closedLoopRamp = 3000_ms;
// constexpr static auto peakOutputForward = 0.2;
// constexpr static auto peakOutputReverse = -0.2;
// constexpr static auto openLoopRamp = controlLoop::rampRate;
// constexpr static auto closedLoopRamp = controlLoop::rampRate;
constexpr static auto pid0_selectedSensor = ctre::phoenix::motorcontrol::FeedbackDevice::IntegratedSensor;
constexpr static auto pid0_kP = controlLoop::drive::drive::kP;
constexpr static auto pid0_kI = controlLoop::drive::drive::kI;
Expand All @@ -229,10 +230,10 @@ namespace motorConfig {
constexpr static auto neutralDeadband = 0.001;
constexpr static auto neutralMode = ctre::phoenix::motorcontrol::NeutralMode::Brake;
constexpr static auto voltCompSat = 11.0_V;
constexpr static auto nominalOutputForward = 0.1;
constexpr static auto nominalOutputReverse = -0.1;
constexpr static auto openLoopRamp = 750_ms;
constexpr static auto closedLoopRamp = 750_ms;
// constexpr static auto nominalOutputForward = 0.1;
// constexpr static auto nominalOutputReverse = -0.1;
// constexpr static auto openLoopRamp = closedLoop::rampRate;
// constexpr static auto closedLoopRamp = closedLoop::rampRate;
constexpr static auto remoteFilter0_addr = sensorConfig::drive::frontLeftTurn::address;
constexpr static auto remoteFilter0_type =
ctre::phoenix::motorcontrol::RemoteSensorSource::RemoteSensorSource_CANCoder;
Expand Down Expand Up @@ -260,10 +261,10 @@ namespace motorConfig {
constexpr static auto neutralDeadband = 0.001;
constexpr static auto neutralMode = ctre::phoenix::motorcontrol::NeutralMode::Brake;
constexpr static auto voltCompSat = 11.0_V;
constexpr static auto nominalOutputForward = 0.1;
constexpr static auto nominalOutputReverse = -0.1;
constexpr static auto openLoopRamp = 750_ms;
constexpr static auto closedLoopRamp = 750_ms;
// constexpr static auto nominalOutputForward = 0.1;
// constexpr static auto nominalOutputReverse = -0.1;
// constexpr static auto openLoopRamp = closedLoop::rampRate;
// constexpr static auto closedLoopRamp = closedLoop::rampRate;
constexpr static auto remoteFilter0_addr = sensorConfig::drive::frontRightTurn::address;
constexpr static auto remoteFilter0_type =
ctre::phoenix::motorcontrol::RemoteSensorSource::RemoteSensorSource_CANCoder;
Expand Down Expand Up @@ -291,10 +292,10 @@ namespace motorConfig {
constexpr static auto neutralDeadband = 0.001;
constexpr static auto neutralMode = ctre::phoenix::motorcontrol::NeutralMode::Brake;
constexpr static auto voltCompSat = 11.0_V;
constexpr static auto nominalOutputForward = 0.1;
constexpr static auto nominalOutputReverse = -0.1;
constexpr static auto openLoopRamp = 750_ms;
constexpr static auto closedLoopRamp = 750_ms;
// constexpr static auto nominalOutputForward = 0.1;
// constexpr static auto nominalOutputReverse = -0.1;
// constexpr static auto openLoopRamp = closedLoop::rampRate;
// constexpr static auto closedLoopRamp = closedLoop::rampRate;
constexpr static auto remoteFilter0_addr = sensorConfig::drive::rearRightTurn::address;
constexpr static auto remoteFilter0_type =
ctre::phoenix::motorcontrol::RemoteSensorSource::RemoteSensorSource_CANCoder;
Expand Down Expand Up @@ -322,10 +323,10 @@ namespace motorConfig {
constexpr static auto neutralDeadband = 0.001;
constexpr static auto neutralMode = ctre::phoenix::motorcontrol::NeutralMode::Brake;
constexpr static auto voltCompSat = 11.0_V;
constexpr static auto nominalOutputForward = 0.1;
constexpr static auto nominalOutputReverse = -0.1;
constexpr static auto openLoopRamp = 750_ms;
constexpr static auto closedLoopRamp = 750_ms;
// constexpr static auto nominalOutputForward = 0.1;
// constexpr static auto nominalOutputReverse = -0.1;
// constexpr static auto openLoopRamp = closedLoop::rampRate;
// constexpr static auto closedLoopRamp = closedLoop::rampRate;
constexpr static auto remoteFilter0_addr = sensorConfig::drive::rearLeftTurn::address;
constexpr static auto remoteFilter0_type =
ctre::phoenix::motorcontrol::RemoteSensorSource::RemoteSensorSource_CANCoder;
Expand Down

0 comments on commit 1a0c0fa

Please sign in to comment.