|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||
|
|||
|
How do you make a PID move a motor in Java?
Hi we are trying to get a motor to move with a potentiometer to specific positions, and we are attempting to use a PID controller to do so. We have tried using .setSetpoint(), but we do not know what that value actually means and how to make the motor move, if that is the right way to do it. If someone could help us out it would be great. Thank you.
|
|
#2
|
||||
|
||||
|
Re: How do you make a PID move a motor in Java?
Did you enable the PIDController?
|
|
#3
|
|||
|
|||
|
Re: How do you make a PID move a motor in Java?
well we are not entirely sure how to set it up, can you maybe show us a sample or something?
|
|
#4
|
||||
|
||||
|
Re: How do you make a PID move a motor in Java?
Quote:
Code:
pidController.setSetpoint(setpoint); Code:
pidController.enable(); |
|
#5
|
||||
|
||||
|
Re: How do you make a PID move a motor in Java?
The PID controller needs an input (use the method returnPIDInput()). This comes from a sensor, such as a gyro or potentiometer. You then use the usePIDOutput() method to move one or multiple motors in order to make the input value reach the setpoint. You need to enable the pid with enable().
This video explains the PID subsystem really well: http://www.youtube.com/watch?v=j2Xz8bRRcF0 |
|
#6
|
|||
|
|||
|
Re: How do you make a PID move a motor in Java?
Thank you so much, i think that will help, I will update this when we figure out if it works
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|