![]() |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
So we probably need to decide some happy medium rotational velocity that we want to control and set the period accordingly. -al g |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
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. |
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 |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
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 |
| All times are GMT -5. The time now is 21:45. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi