|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Setting RPMs on motors
To get an accurate trajectory on the ball, I wanna preset the RPMs on the shooting motor. I know you can just put in integer values like 1 for the motor speed, but what do these numbers mean? 1 meaning 1000 RPM?
|
|
#2
|
||||
|
||||
|
Re: Setting RPMs on motors
The output 0-1 is just a power value, 0 being stopped 1 being full power. To do RPM control you need some type of feedback, like an encoder.
|
|
#3
|
|||||
|
|||||
|
Re: Setting RPMs on motors
The numbers -1 to 1 only refer to the battery voltage as it is at the moment.
It won't give you a specific RPM and will vary as you syphon power off to other motors (like your drivetrain), and as your battery gradually depletes itself during a match. To get a consistent RPM you will need a feedback sensor and what's called a PID software loop to maintain a set RPM. For feedback you can use an encoder (some come in the Kit of Parts), or a light sensor that counts the passing of a marker on your spinning shooter wheel, or various other types of measuring sensors/devices. |
|
#4
|
||||
|
||||
|
Re: Setting RPMs on motors
If you are using CAN with Jaguars, then you can easily set speeds using their built-in control feedback loop system and plugging your encoder into your Jaguar. For Java, see the CANJaguar javadocs, and note the "control mode" variable, which you can set to kSpeed, setPID(), and set() method. You will have to tell it how many encoder codes your encoder will report per revolution as well.
If you want to see an example of making your own feedback loops for Victors, you can check out a (Java) class we wrote last year to do this here. |
|
#5
|
||||
|
||||
|
Re: Setting RPMs on motors
Quote:
|
|
#6
|
||||
|
||||
|
Re: Setting RPMs on motors
Here is a picture of periodic task that we have run on our test platform. It seems to perform quite well for maintaining desired RPM. YMMV.
The simple explanation is that we are using this like the "I" function in PID. This runs 100 times per second. The 250 multiplier/divisor is found by reading your maximum rate count without feedback at full speed. |
|
#7
|
||||
|
||||
|
Re: Setting RPMs on motors
Quote:
|
|
#8
|
|||
|
|||
|
Re: Setting RPMs on motors
Okay I have never programmed an encoder before and I'm confused by the begin vi. Can someone please post a sample code for an encoder to set the desired RPMs? Thanks
|
|
#9
|
||||
|
||||
|
Re: Setting RPMs on motors
|
|
#10
|
||||
|
||||
|
Re: Setting RPMs on motors
With a drivetrain too? Or just a free-spinning wheel?
|
|
#11
|
||||
|
||||
|
Re: Setting RPMs on motors
Our plan is to use the kit encoders direct-mounted to our flywheel shafts. Does anyone know if the manufacturer claim of up to 10,000 rpm is accurate? We'd rather not add the weight, complexity, and inefficiency of having to gear down an idler for the encoder to take rates.
|
|
#12
|
|||
|
|||
|
Re: Setting RPMs on motors
Just the wheel
|
|
#13
|
||||
|
||||
|
Re: Setting RPMs on motors
Define "success." We did it on our drivetrain last year, with each wheel being controlled separately, and tuned the values using BDC-COMM. Were we able to control the speed of the wheels comfortably? Yes. But we faced typical Jaguar reliability issues that led us to replace them with Victors + homebrewed speed control code.
|
|
#14
|
||||
|
||||
|
Re: Setting RPMs on motors
In this context, I guess I meant:
- did you measure the actual steady-state output speed and confirm that it was indeed equal to the speed you were commanding? - was it stable? - was the dynamic response "good"? (I know, define "good". How about a rough estimate of step response compared to voltage mode or %Vbus mode) - for a given speed command, did the controller hold the same output speed under different loads? The reason I ask is that if you were successful, the folks at this thread would like to hear about it: http://www.chiefdelphi.com/forums/sh...d.php?t=100135 |
|
#15
|
|||
|
|||
|
Re: Setting RPMs on motors
You can use a PID Controller and use RPM as the unit.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|