|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Control Shooter RPM with a Counter
I have a complete different Idea on how I would approach this type of thing, so I figure I will outline it for you briefly, and you can let me know if you would rather look into this.
I have in my code a similar thing, expect that we change our speed with joystick buttons. However, the only difference is (and it is a big one) is that I use the CAN Serial port option to send the RPM values and use an internal PID on my shooter Jaguar. CAN, until you get used to it, is very very hard to figure out on your own. I could do my best to give tips and tricks, but no matter what, it comes down to how badly you want it to work. It works wonderfully on our robot, and we were sinking 90% of our shots once we got our feeder to work, but the hardest part comes down to the pwm is a hardware setup (you just have to run cables) and the CAN is a hardware (you have to run cables) and a software (you have to preset your jaguars) setup. Another note on it, it only works with Jaguars, so if you have Victors, it wont help. Lastly, if you used this option, it would be entirely different and there would be no need for a counter. The code for it however is a lot more simpler than what I see you were doing. It all comes down to preference. If you want to make the switch to CAN, I will do everything I can to help, but it is a lot of troubleshooting until you figure out how it all works. I made the switch for just our shooter wheel this year, and I started on January 8th, and didnt have it all figured out until February. And still now, all the other people dont fully understand it yet, so at our first competition in Rochester for the Finger Lakes Regional, the Jaguars were not properly set up and I had to spend half an hour setting up the Jaguars. The switch to CAN from PWM is hard, but I have found it quite useful, especially for wiring, because if you have the right encoders, you can put them into your Jaguar, and the only cable going across your robot is your CAN bus line cable. |
|
#2
|
||||
|
||||
|
Re: Control Shooter RPM with a Counter
Quote:
The OP could have used an encoder, but he chose to use a simple counter instead, which is arguably a better choice for a unidirectional high-speed application like a shooter wheel. Last edited by Ether : 17-03-2013 at 22:51. Reason: edited for clarity |
|
#3
|
|||||
|
|||||
|
Re: Control Shooter RPM with a Counter
There's no way to have a Digital Sidecar do the same sort of offloaded closed-loop control that a Jaguar is capable of. The speed control would have to be done by the cRIO's program, based on feedback from the encoder. You can't read the encoder's value without opening a Counter (or an Encoder, which uses a Counter unless you ask for 4x decoding).
|
|
#4
|
||||
|
||||
|
Re: Control Shooter RPM with a Counter
Quote:
Quote:
Quote:
|
|
#5
|
|||
|
|||
|
Re: Control Shooter RPM with a Counter
Quote:
As I said earlier, it is a matter of if you want to go through the crio or through the Jaguar. We decided to use the Jaguar because even with the loops on the CRio, you must put in a delay of some sort, and less response time equals more consistent settling speed when using a shooter wheel. |
|
#6
|
||||
|
||||
|
Re: Control Shooter RPM with a Counter
Quote:
You've obviously been successful. Would you be willing to post some detail about how your team went about tuning the Jag's PID parameters to get robust and accurate speed control? |
|
#7
|
|||
|
|||
|
Re: Control Shooter RPM with a Counter
Quote:
I would think the major control difference would be that the Jag runs the PID at 1KHz and the PWM signal can change the motor speed no quicker than 5ms, or at 200Hz. The capability of doing control on the Jag is cool, but unless your flywheel is very light, I wouldn't think that the control rate needs to be 1KHz. So you should be successful doing it either way. Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|