Go to Post Mentors can't get tired, it says so in the manual. SENIOR mentors, therefore, must have a different manual! - KathieK [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #46   Spotlight this post!  
Unread 01-02-2013, 15:21
MisterG's Avatar
MisterG MisterG is offline
Think twice post once.
AKA: Alan Gilgenbach
FRC #2062 (C.O.R.E. - Community of Robotics Engineers)
Team Role: Team Spirit / Cheering
 
Join Date: Mar 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 120
MisterG is a name known to allMisterG is a name known to allMisterG is a name known to allMisterG is a name known to allMisterG is a name known to allMisterG is a name known to all
Re: Best way to measure period between pulses? Counters and FPGA

Quote:
Originally Posted by nightpool View Post
Doesn't that mean it wouldn't be able to tell if the wheel is actually stopped?
Oh, yeah. Basically it will continue returning some higher speed that represents the last valid transition even though the wheel may have stopped some time earlier.

So we probably need to decide some happy medium rotational velocity that we want to control and set the period accordingly.

-al g
__________________
Alan Gilgenbach
C.O.R.E 2062
  #47   Spotlight this post!  
Unread 01-02-2013, 15:44
MisterG's Avatar
MisterG MisterG is offline
Think twice post once.
AKA: Alan Gilgenbach
FRC #2062 (C.O.R.E. - Community of Robotics Engineers)
Team Role: Team Spirit / Cheering
 
Join Date: Mar 2011
Rookie Year: 2011
Location: Waukesha, WI
Posts: 120
MisterG is a name known to allMisterG is a name known to allMisterG is a name known to allMisterG is a name known to allMisterG is a name known to allMisterG is a name known to all
Re: Best way to measure period between pulses? Counters and FPGA

Quote:
Originally Posted by sst.thad View Post
If you look at the code the only reason it has that function is to not have a divide by 0 error. In the get period function, it uses that bool in order to not make it divide by 0.
Note: the problem that we are dealing with is primarily due to the one pulse per revolution setup.

Agree that the stall feature is solving the zero divide problem but probably more importantly its dealing with the issue of period growing dramatically as rotational velocity approaches zero.

Take the following scenario: you decelerate very rapidly and your last transition happens at a time that is equivalent to 200 RPM. The wheel is stopped but the code continues to report 200 RPM. If the timeout (max period/min rate) is set for 10 RPM this will continue for 6 seconds.

Another interesting C++ fact that I never realized before (or once I knew but forgot):
For IEEE floats, division of a finite nonzero float by 0 is well-defined and results in +infinity (if the value was >zero) or -infinity (if the value was less than zero). The result of 0/0 is NaN. If you use integers, the behaviour is undefined.
__________________
Alan Gilgenbach
C.O.R.E 2062
  #48   Spotlight this post!  
Unread 03-02-2013, 10:42
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,752
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: Best way to measure period between pulses? Counters and FPGA

The IEEE defined behavior is the same for LV, and I presume Java.

Greg McKaskle
  #49   Spotlight this post!  
Unread 07-02-2013, 23:29
matthewkennedy matthewkennedy is offline
Registered User
FRC #1294 (Top Gun)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2011
Location: Sammamish, WA
Posts: 10
matthewkennedy is an unknown quantity at this point
Re: Best way to measure period between pulses? Counters and FPGA

Quote:
Originally Posted by Greg McKaskle View Post
The IEEE defined behavior is the same for LV, and I presume Java.
It is pretty certain that is is going to be the same for C++/Java/LV as this behavior is typically determined by the FPU in the processor. I know that PPC conforms to the IEEE spec, and it properly handles x/0 for the three cases above.
__________________
-Matthew

"The future is already here—it's just not very evenly distributed"
-William Gibson
  #50   Spotlight this post!  
Unread 08-02-2013, 07:18
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,752
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: Best way to measure period between pulses? Counters and FPGA

I agree that PPC is IEEE 754 compliant, but some languages will have their own conventions, and since Java in interpreted, it would be pretty easy and efficient for them to have thrown an exception or taken some other action.

Greg McKaskle
Closed Thread


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 13: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