Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible FW bug in GotoAbsolutePosition for virtual ports #28

Open
gyenesvi opened this issue Jul 8, 2020 · 2 comments
Open

Possible FW bug in GotoAbsolutePosition for virtual ports #28

gyenesvi opened this issue Jul 8, 2020 · 2 comments

Comments

@gyenesvi
Copy link

gyenesvi commented Jul 8, 2020

I believe I have found a FW bug in the implementation of the output subcommand 'GotoAbsolutePosition' for virtual ports (both commands 0x0D and 0x0E) when using immediate execution that happens to discard a previous command. The symptom is that the command starts executing and moves the motors past the desired position but never stops.
In line with that, when observing the output command feedbacks, starting from an 'idle' state, executing a first command moves the system into 'in-progress state'. Then a second immediate command discards the first, and leaves the system in 'in-progress' state, but afterwards a 'completed' feedback may never be received (neither a 'discarded', in fact, no feedback may be received afterwards). Another command sent in immediate mode can discard it, but then the next command never completes again. I was able to reproduce this behaviour by sending commands from my own custom bluetooth client and also via the Powered-Up app, which makes me believe that the error is not on my side.

The same command works well for non-virtual ports (single motor). The problem only seems to manifest itself when the command is sent in immediate mode and the previous command is still executing and is thus discarded. If I wait for the first command to finish and then send the next one, everything seems to be working fine (the second one also completes). Tested with Technic Hub with 4 ports, FW version 1.1, two technic XL motors (linear) on ports A+B.

The setup is as follows.

  • Create virtual port A+B (command 0x61)
  • For both ports A and B:
    • Set input format (command 0x41) to mode 3 (the same results with mode 2), delta=1, notify=true
    • Preset the port (via WriteDirectModeData, tried both mode 2 and 3)
  • Set up the input format for the virtual port A+B (command 0x61)
  • Preset the virtual port (command 0x14)
    Also tried setting up the virtual port after setting up the individual ports A and B.

Then a series of GotoAbsolutePosition commands are sent (0x0D or 0x0E) in response to moving a slider. Tried to use various speeds with the same result.

In the Powered Up app, I could reproduce it as follows:

  • Create a coding project with one motor command item in it: the one that moves a motor to a given angle using a given speed (green item with three slots).
  • Set the first slot to AB, the second to some speed, e.g. 50, and starting from 0 degrees, move the motors to 180 degrees for example by hitting the play button.
  • When it completes, set it back to 0 degrees, and hit play again.
  • If one waits for it to finish, it works fine; it stops at the desired angle.
  • However, if one hits the play button 2-3 times in rapid succession the motors may not stop (unless one hits the stop button).
  • The same problem does not appear when only one port (say A) is selected

Did anyone experience a similar problem? Could anyone make synced motors go to absolute position properly in such a scenario?

@LozCool
Copy link

LozCool commented Oct 13, 2024

Hello gyenesvi,

I know this is a later answer, but for everyone else...

I just found a similar problem with two synchronized port's acceleration profiles. I tried setting the profiles on both ports but the commands to the virtual port didn't respect them.

Don't Do It!!! Set profiles on the virtual port and ignore the underlying port's config. Its done once on the virtual port and It Works!!

Loz.

@gyenesvi
Copy link
Author

Hi Loz, thanks for confirming, though I doubt this would ever get fixed, nobody seems to be responding to feedback here..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants