![]() |
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?
|
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.
|
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. |
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. |
Re: Setting RPMs on motors
Quote:
|
Re: Setting RPMs on motors
1 Attachment(s)
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. |
Re: Setting RPMs on motors
Quote:
|
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
|
Re: Setting RPMs on motors
Quote:
|
Re: Setting RPMs on motors
Quote:
|
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.
|
Re: Setting RPMs on motors
Just the wheel
|
Re: Setting RPMs on motors
Quote:
|
Re: Setting RPMs on motors
Quote:
- 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 |
Re: Setting RPMs on motors
You can use a PID Controller and use RPM as the unit.
|
| All times are GMT -5. The time now is 01:04. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi