Go to Post We can relate anything back to water, and by anything, I literally mean ANYTHING. Surfing around on Chief Delphi has proven that to me. - karomata [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-03-2013, 17:25
TogetherSword8 TogetherSword8 is offline
Registered User
FRC #0888 (Robotiators)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Glenelg High School
Posts: 85
TogetherSword8 is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-03-2013, 20:40
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Control Shooter RPM with a Counter

Quote:
Originally Posted by TogetherSword8 View Post
Lastly, if you used this option, it would be entirely different and there would be no need for a counter.
A physical speed sensor of some sort is required to do closed-loop speed control, whether it's done by the Jaguar with an encoder plugged into it or in the cRIO with either an encoder or counter plugged into the DSC.

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
Reply With Quote
  #3   Spotlight this post!  
Unread 17-03-2013, 22:01
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Control Shooter RPM with a Counter

Quote:
Originally Posted by Ether View Post
If the OP had an encoder on his shooter, he wouldn't need a counter either. He could plug the encoder into the DSC and use that to control the wheel speed.
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).
Reply With Quote
  #4   Spotlight this post!  
Unread 17-03-2013, 22:44
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Control Shooter RPM with a Counter

Quote:
Originally Posted by Alan Anderson View Post
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 Jag executes its speed controller at 1000Hz, if that's what you mean.

Quote:
The speed control would have to be done by the cRIO's program, based on feedback from the encoder.
To do closed-loop control of speed, you need a speed sensor. The OP has installed a counter for that purpose.

Quote:
You can't read the encoder's value without opening a Counter
If that's what TogetherSword8 meant when he used the word "counter", then I can see how my post could be misunderstood. I will edit it for clarity.


Reply With Quote
  #5   Spotlight this post!  
Unread 17-03-2013, 22:58
TogetherSword8 TogetherSword8 is offline
Registered User
FRC #0888 (Robotiators)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Glenelg High School
Posts: 85
TogetherSword8 is an unknown quantity at this point
Re: Control Shooter RPM with a Counter

Quote:
Originally Posted by Ether View Post
If that's what TogetherSword8 meant when he used the word "counter", then I can see how my post could be misunderstood. I will edit it for clarity.
Sorry about that, I did mean the counting in the code. I don't know the exact model, but we use a magnetic tooth counter and feed that signal directly into the Jaguar.

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.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-03-2013, 23:06
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,065
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Control Shooter RPM with a Counter

Quote:
Originally Posted by TogetherSword8 View Post
Sorry about that, I did mean the counting in the code. I don't know the exact model, but we use a magnetic tooth counter and feed that signal directly into the Jaguar.
There was a thread a year or so ago about some teams struggling to get the built-in PID in the Jag working to control speed, and ultimately giving up.

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?


Reply With Quote
  #7   Spotlight this post!  
Unread 18-03-2013, 07:55
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Control Shooter RPM with a Counter

Quote:
We decided to use the Jaguar because even with the loops on the CRio, you must put in a delay of some sort ...
This implies there is no delay within the jag.

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
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:08.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi