Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly configure motors on program init #23

Open
vchen04 opened this issue Mar 20, 2022 · 0 comments
Open

Explicitly configure motors on program init #23

vchen04 opened this issue Mar 20, 2022 · 0 comments

Comments

@vchen04
Copy link
Member

vchen04 commented Mar 20, 2022

Speed controllers have a bit of NVRAM to persist config including invert
and brake/coast. They don't write the NVRAM unless you explicitly ask them
to though.

Anything you send at runtime overrides whatever is in NVRAM.
I highly recommend explicitly initializing the invert and brake/coast
settings so that we're never surprised when we have to swap a speed
controller on the fly.

Ask King whether we want brake or coast for the drivetrain. Arm, climbers,
and indexers should probably be on brake, and the shooter flywheel on
coast. Flywheel could go either way, but I figure actively stopping it is
just extra mechanical stress and wasted power. Particularly if we decide to
spin it back up again quickly.

Worth noting, because you can set the state a runtime, we've been known to
toggle it strategically. For example drivetrain on coast mode for smoother
driving, but switching to brake mode for "anchor" behavior.

On Fri, Mar 18, 2022, 15:37 Victor Chen @.***> wrote:

While driving the robot today (running code off of master), the wheels
turned as if the robot was trying to turn right with forward joystick
input, and the wheels turned as if the robot was trying to turn left with
backwards input.

A potential culprit is the system identification routine that I ran on the
drive train yesterday, where the right motors were inverted but the left
were not. I suspect that the the inversion setting in the Spark MAXes is
sticky across reboots. @BowlesCR https://github.com/BowlesCR—does this
sound right? Since the inversion of the right motors is not explicitly set
every time the robot program starts, but the left motors are set to be
inverted every time the robot program starts, this would explain why it
appears that both sets of motors are inverted.

A potential fix is to add the following line to the DriveTrainSubsystem
constructor:

m_rightA.setInverted(false);


Reply to this email directly, view it on GitHub
#22, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA4HCZJT4IXYP33GV22NQ5TVATLN7ANCNFSM5RCXPVBA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID:
@.***>

Originally posted by @BowlesCR in #22 (comment)

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

No branches or pull requests

1 participant