How does Bob's solution stand up to the "golden" VI?
Here (bottom) is alternative code that gives the same (probably incorrect!!!) result as the code by constructionworker (top).
Arguably slightly simpler 😄
날짜: 09-23-2022 10:10 AM
wiebe@CARYA wrote:
This seems to give the same results as the presumably working example.
At least for the 5 values I've tested:
Thanks for your answer.
This seems to work. 🙂
I almost started banging my head against the walls.
At least according to the chart here it looks error free.
I waited for a while and was able to better describe the problem once I understood what was required. I think the bird's nest helped explain the situation better 🙂
wiebe@CARYA wrote:
@altenbach wrote:
wiebe@CARYA wrote:
At least for the 5 values I've tested:
Well, In this case it is simple to do an exhaustive analysis of all 360x360 possible inputs. For at least 1/8th of the samples, there is a difference in the "send to motor" command. I doubt any version is actually correct. 😄
Not that it helps, but I think the Current input isn't limited to 0 or 360, it can be anything...
Yes, but it can always be Q&R'd into 0..259. It is safe to say that if your version (I am not going to use the word "solution" for anything posted here! 😄 ) differs in the shown range, it is not the same.
We can easily expand the exhaustive 2D test for a much wider range of one of the inputs.
날짜: 09-23-2022 11:14 AM
Me trying to follow this thread-
09-23-2022 11:25 AM - 편집 09-23-2022 11:26 AM
Thanks everyone for your effort. Problem solved.
The exact desired algorithm is as follows.
@constructionworker wrote:
Thanks everyone for your effort. Problem solved.
The exact desired algorithm is as follows.
A greedy loop is never the solution.
Make sure you wear safety goggles and keep your fingers out of the device when testing with actual hardware. 😄