Skip to content

Comments

Made tunnable pid numbers work + made shooter idle mode coast#76

Open
JAMthepersonj wants to merge 4 commits intomainfrom
JW-Fixed-PID-tunning
Open

Made tunnable pid numbers work + made shooter idle mode coast#76
JAMthepersonj wants to merge 4 commits intomainfrom
JW-Fixed-PID-tunning

Conversation

@JAMthepersonj
Copy link
Contributor

No description provided.

config
.smartCurrentLimit(pidConfig.getCurrentLimit())
.closedLoopRampRate(RAMP_RATE)
.idleMode(IdleMode.kBrake);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want to change this here because it will affect all the PID motors (turret, angler).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Contributor

@batchen1 batchen1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand your change. Now the leader is in Brake mode and the follower in coast. This is not what we need.

config
.smartCurrentLimit(pidConfig.getCurrentLimit())
.closedLoopRampRate(RAMP_RATE)
.idleMode(IdleMode.kBrake);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be simpler to add idleMode to the SparkMaxPidConfig and use it from there in all the existing code?
So in here it would be .idleMode(pidConfig.getIdleMode()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The shooter Subsystem does not pass in a SparkMaxPidConfig instead we are passing in a boolean value for using maxMotion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed solution would have the shooter subsystem create a SparkMaxPidConfig with kBrakeMode and pass this into the existing constructor of SparkMaxPidMotor. This would be following the same pattern as the other config parameters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here is what I propose:
In the shooter subsystem:

SparkMaxPidConfig config = new SparkMaxPidConfig(false).setIdleMode(kCoast);
SparkMaxPidMotor motor = new SparkMaxPidMotor(id, config);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix this when i get to robotics later i should be there at around 5-6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants