![]() |
Re: NavX MXP Continuous Angle to Calculate Derivative
Quote:
Quote:
What I wanted to know was whether LabVIEW has IEEERemainder as a programming function (call it Rem). There is a Mod (%) function (known in LV as Quotient & Remainder), but of course Rem and Mod differ in how they internally round, which is what makes Rem useful here. Same question as you asked here, only for the LabVIEW language. Equivalent to asking: Can it be done in LabVIEW "... with one line of code". Any LabVIEW experts know? If not, might this be in the development pipeline? |
Re: NavX MXP Continuous Angle to Calculate Derivative
Quote:
Quote:
Quote:
Quote:
Quote:
Code:
shortest_angle = (present-previous) - 360*floor(0.5+(present-previous)/360)Code:
Iteration Previous Present Pres-Prev Function AccumI'm interpreting the OPs desire for a function that converts his range-constrained sensor output to a non-range-constrained one. Your IEEERemainder function, with an accumulator, accomplishes this. |
Re: NavX MXP Continuous Angle to Calculate Derivative
Quote:
I am discussing the solution to this aspect of the OP's original framing of the problem (see bolded portion): Quote:
The IEEERemainder gives you that answer: Quote:
Quote:
|
Re: NavX MXP Continuous Angle to Calculate Derivative
Thanks for taking time to walk through this! The distinction you reference clears up the differing perspectives / solution space.
|
Re: NavX MXP Continuous Angle to Calculate Derivative
Quote:
|
Re: NavX MXP Continuous Angle to Calculate Derivative
2 Attachment(s)
Labview Subvi implementation of this attached.
Tested with the data set published, and checked results. Sorry, not a LV guru, so did not take the time create input matrix and results. (started too, but I knew there was a much simpler way than the way I was doing it.) Thanks, we struggled with the gyro rollover in the past and this implementation seems to solve all of the issues we have tried to conditionally fix in the past. Thanks Ether. |
| All times are GMT -5. The time now is 00:46. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi