Go to Post Just remember to be as transparent and inclusive as you can. - DonRotolo [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Spotlight this post!  
Unread 09-02-2013, 00:50
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,385
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Photosensor as encoder for bang bang.

Quote:
Originally Posted by Mark McLeod View Post
So you're taking the total revs since the last time you checked the counter.
Dividing by a time constant, filtering the result, and applying a slew rate limiter?
I'm not a fan of the Counter reset applied that way. There's a window to drop counts.

Seems a bit much for flywheel.
Is the slew rate limiter to avoid extended stall time at full power for the flywheel?
P.S. I overlooked that the slew rate is probably bypassed with the False Case.

Is that really 360 counts per revolution?
I thought you only had 1?
I don't think you want that 60 or 360 applied there, but maybe I haven't grasped what you are calculating.
When I first saw the code I was surprised at how familiar it looked, then I realized, I posted it last year.

Mark, would replacing the "Reset Counter" with a feedback loop and subtracting the previous count from the current count be a more stable option?

Both the IIR filter and the slew rate limiter were placed in this code as ways to compensate for other issues.

The slew rate limiter really is only needed when using a Jaguar. The current limiting circuit in the Jag can trip if the start up current is too high. If using a Talon or Victor, this entire block of code can be bypassed or completely removed.

Honestly, the IIR filter shouldn't be used. It introduces lag into the control. I put it in there as a way to smooth out the RPM signal. I believe the main reason the signal was noisy was due to the use of a "wait" loop instead of a timed loop in the original version. In addition, we were using "Get Rate" in the original version. "Get Rate" is an instantaneous measurement that is inherently noisy. This version uses a count divided by time to determine RPM, which is a much cleaner approach. This filter can be bypassed by setting the filter strength to "0", or just deleting that section of code.

The "360" is the number of ticks per revolution of the encoder it was designed to be used with. If the encoder is just a couple of lines on a wheel and an optical sensor, the this value needs to reflect the number of lines.

Bang-Bang is a simple control system. A comparison of the current RPM to the desired RPM. If the current is at or above the desired value, then turn off the motor. If it is below, turn the motor on at full power. Anything else in the loop just clutters the process.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
 


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 11:02.

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