FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Speed Control for Motor?

Solved!
Go to solution

Is is possible to be able to set a maximum speed for a motor if you are using a button the the ATTACK3 controller to turn a motor on and off?

0 Kudos
Message 1 of 2
(4,630 Views)
Solution
Accepted by topic author Team 4376

Hey Team4376,

If you are interested in setting an accurate maximum speed for a motor I would recommend looking at this PID Tutorial:https://decibel.ni.com/content/docs/DOC-14709. You will need to have an encoder on the motor so that you can get feedback to your control system.

Alternatively if you are just looking for some loose limit I would make some logic in your code where if a certain button is pressed instead of scaling your joystick values from -1 to 1 (max and min for the motor VIs) you scale it from -.5 to .5 (or whatever the maximum power you want).  Post back if you have questions.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 2
(2,840 Views)