Go to Post The problem was too many penalties with too much room for judgment. - dbSparx [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
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
  #13   Spotlight this post!  
Unread 04-02-2016, 16:23
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
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: Finding RPMs with encoder

Quote:
Originally Posted by Sparx030 View Post
20ms

OK, doing the calculations for 1X decoding:

rpm=3000; CPR=250; X=1; secondsPerControlLoop=0.020;

edgesPerControlLoop: rpm * (1/60) * (X*CPR) * secondsPerControlLoop = 250


So 250 edges fly by every 20ms, which should be plenty enough to get a nice accurate and clean speed signal at 1X decoding. I recommend setting the FPGA sample size to something greater than the default value of "1"... say maybe 64.

If you like your code to be super efficient you can compute the edge period time once outside your control loop:

secondsPerEdge: float((1/rpm) * 60 * 1/(X*CPR)) = 80e-6


... and use that as the setpoint in your PID to compare to the getPeriod() process variable which returns the edge period in seconds.


When using PID to control shooter wheel speed there are some additional considerations to be aware of in order to be successful. Things like do you want to apply dynamic braking or reverse motor commands when wheel speed exceeds setpoint. I will leave it to shooter-wheel-PID gurus to fill in the details and recommendations.

You may be able to get better speed regulation at 10ms.



Last edited by Ether : 04-02-2016 at 21:45. Reason: typo
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 17:40.

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