Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

Incorrect setting in SmartMotion example. #5

Open
tekdemo opened this issue Mar 11, 2019 · 3 comments
Open

Incorrect setting in SmartMotion example. #5

tekdemo opened this issue Mar 11, 2019 · 3 comments

Comments

@tekdemo
Copy link

tekdemo commented Mar 11, 2019

The SmartMotion example incorrectly uses the kVelocity control option, instead of kSmartVelocity. This makes the example pretty confusing as selecting Velocity causes the PID control to disable smart motion entirely.

m_pidController.setReference(setPoint, ControlType.kVelocity);

@tekdemo tekdemo changed the title Incorrect setting in example Incorrect setting in SmartMotion example. Mar 11, 2019
@willtoth
Copy link
Contributor

Thanks for the feedback. The intent for that particular example is to allow you to switch between a velocity PID controller and the Smart Motion mode based on a control on the smart dashboard. This allows you to tune the velocity PID which is the underlying controller for the Smart Motion.

So one tuning method would be:

  1. Set the 'mode' control to true set velocity PID as the control mode
  2. Tune the mechanism using the velocity PID controller
  3. Configure the min output, max velocity, and max acceleration
  4. Switch to Smart Motion and control the position

@tekdemo
Copy link
Author

tekdemo commented Mar 11, 2019 via email

@willtoth
Copy link
Contributor

You can go ahead and change this PR to switch between the 3 modes, that would be helpful!

jfabellera pushed a commit to jfabellera/SPARK-MAX-Examples that referenced this issue Nov 15, 2024
* Update the project to use WPILib 2025 and REVLib 2025 beta

* Update the Read Encoder Values example code to use REVLib 2025 classes and methods

* Update to REVLib beta 2

* Update comments and spacing

* Correct configure method comment and code mistake
jfabellera pushed a commit to jfabellera/SPARK-MAX-Examples that referenced this issue Nov 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants