|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Position control without CAN?
Hello,
I'm curious to know if it's possible to keep something in a position even if force is applied (such as gravity) with only a Victor SP and encoder. Any help with the code is also welcome. Thanks! |
|
#2
|
||||
|
||||
|
Re: Position control without CAN?
Yeah you can, use a PID control loop. https://wpilib.screenstepslive.com/s...rs-pid-control
|
|
#3
|
||||
|
||||
|
Re: Position control without CAN?
Jacob's answer is good. You could also use a standalone PID controller (rather than wpilib's subsystem). Lots of teams have written PID controllers, but I'm going to stick in a plug for mine.
|
|
#4
|
|||||
|
|||||
|
Re: Position control without CAN?
You only need PI control for keeping an arm in place. D isn't likely to help, so you can ignore it and keep its calibration constant at zero.
If you need to hold position against gravity, you might run into problems with overheating a stalled motor. A more sustainable solution is to use a counterweight or spring to oppose the force of gravity, so the motor doesn't have to be providing continuous torque at zero speed. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|