Domo arigato Mrs. Roboto
Home
Go Back   Chief Delphi > Technical > Control System
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread Yesterday, 11:46
Bendito's Avatar
Bendito Bendito is offline
Registered User
AKA: Benjamin LaRoche
FTC #7837 (The Thunder Colts)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Dorr, MI
Posts: 17
Bendito is an unknown quantity at this point
Re: high speed tracking

I hadn't realized that the 5 for averaging correlated to how many ticks there were per RPM, thought it was just a sort of buffer. The setting used for 1 'tick' is the "CountsPerRev" division after each counter get period (see attachment). We are running a shooter wheel off of a CIM motor between 3800 RPM and 5000 depending on our setpoints (still tweaking what works best). At full throttle, it reads around 5000, which matches up with what I would expect from a CIM motor.
It is currently a photoeye looking at 50% reflective tape, and 50% not, contiguously around the wheel. We are considering getting better resolution by breaking it up into 4 or 8 equally dispersed chunks, in which case "CountsPerRev" would be increased to this number when we read "Period(sec)" from the CounterGet VI.

The other cases shown are just overrides in case of shooter sensor failure to simply pipe a percentage value to the motor (detects a small setpoint, which means a throttle value is desired instead of RPM).
Attached Thumbnails
Click image for larger version

Name:	2017-02-13 11_37_26-Begin.vi Block Diagram on 2017SwerveDrive5162.lvproj_Target _.png
Views:	3
Size:	4.1 KB
ID:	21790  Click image for larger version

Name:	2017-02-13 11_36_11-Periodic Tasks.vi Block Diagram on 2017SwerveDrive5162.lvproj_Target _.png
Views:	4
Size:	24.1 KB
ID:	21791  
Reply With Quote
  #17   Spotlight this post!  
Unread Yesterday, 12:29
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,154
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: high speed tracking

Quote:
Originally Posted by Bendito View Post
We are considering getting better resolution by breaking it up into 4 or 8 equally dispersed chunks, in which case "CountsPerRev" would be increased to this number when we read "Period(sec)" from the CounterGet VI.
3800 rpm = 63.33 revs/sec = 15.8 ms/ rev.

If you are running your speed control loop at 20ms, you'll get a fresh reading every iteration.

And, there's an advantage of using only one piece of tape: there is no noise due to tape positioning tolerance since you are always reading the same edge.


Reply With Quote
  #18   Spotlight this post!  
Unread Yesterday, 12:33
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,154
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: high speed tracking

Quote:
Originally Posted by Bendito View Post
We are running a shooter wheel off of a CIM motor between 3800 RPM and 5000 depending on our setpoints (still tweaking what works best). At full throttle, it reads around 5000, which matches up with what I would expect from a CIM motor.
If your CIM is geared 1:1 to the flywheel, you will not not able to control the flywheel speed at 5000 rpm. There is no voltage headroom for your control algorithm to work.


Reply With Quote
  #19   Spotlight this post!  
Unread Yesterday, 12:43
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,964
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: high speed tracking

I use the Number of Samples to Average to account for placement error of the reflective strips. One full average always equals the same start/stop rising edge.

# of strips (thought about it some more)

By the way, in the last code example the In Range and Coerce function has it's upper limit disabled (by default).
That's why it's a clear box, rather than a filled box like the lower limit has.
Right-click on the function and choose Include upper limit
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : Yesterday at 16:42.
Reply With Quote
  #20   Spotlight this post!  
Unread Yesterday, 23:35
Bendito's Avatar
Bendito Bendito is offline
Registered User
AKA: Benjamin LaRoche
FTC #7837 (The Thunder Colts)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Dorr, MI
Posts: 17
Bendito is an unknown quantity at this point
Re: high speed tracking

Good advice, we were not planning on running at 5000, closer to 4000 at realistic max. We have had around 30%-40% headroom roughly. I was just testing how fast it would go. It does seem to work with 1 tape segment, I just overheard someone in another thread suggesting more resolution for a similar application.

The averaging of samples to number of ticks in one revolution makes sense now, thanks! Of course, with 1 tick, having a few averages shouldn't hurt, but really shouldn't be necessary now that I think about it.

Now just to properly tune the PID so that it gets to the correct speed quickly without oscillation (hint to anyone with this problem, an additional offset added to the output can help get up to the proper speed range without cranking P too hard into oscillation territory) That's tomorrow's project.

Thanks for the advice.
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 15:10.

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