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

rotate a wheel forward and backward immediately to 360 degrees #8

Open
jesseyyy opened this issue Apr 22, 2014 · 1 comment
Open

rotate a wheel forward and backward immediately to 360 degrees #8

jesseyyy opened this issue Apr 22, 2014 · 1 comment

Comments

@jesseyyy
Copy link

I am try to rotate a wheel forward and backward immediately to
360 degrees. So I send two commands to NXT 2.0 from my android phone as I clicked
buttons.

forward : byte[] data = { 0x0c, 0x00, (byte) 0x80, 0x04, 0x00,
0x32, 0x07, 0x00, 0x00, 0x20, 0x68, 0x01, 0x00, 0x00 };
backward: byte[] data = { 0x0c, 0x00, (byte) 0x80, 0x04, 0x00,
(byte) 0xCE, 0x07, 0x01, 0x00, 0x20, 0x68, 0x01, 0x00, 0x00 };

the issue is that I failed to let the wheel turn accurate 360
degrees(0x68, 0x01) if I pushed the button and rotated the wheel forward and then
rotate it backward immediately. ( the wheel only turned accurate 360 if
it rotated forward continually or rotated backward
continually)

Will you help to give me some suggestion?

Jesse

@barbolani
Copy link
Collaborator

jesseyyy, I built a NXT car with a steering wheel, with the intention of controlling it from a modified version of the Android app (see my repo) I went as far as refactoring and fixing all the Eclipse warnings and, add my car to the list of models and implement basic controls for the power train in the back wheels and the steering wheel at the front.

Then I ran into exactly the same problem as you: in summary, there is no way of controlling precisely over bluetooth the rotation of the motors. The best that you can do is what the app already does, which is limited to turning the motors on and assign a speed to them. But my attempts to tell the motors to turn X degrees all failed.

I logged into a NXT LejOS forum where the people there confirmed me these limitations with the default NXT. Other than flashing the brick with a custom OS that fixes this -by using a variety of strategies to track how much the motor has moved- apparently there is no workaround for the problem. This is a bug in the NXT brick software that has not been fixed by Lego.
Wonder if it is the same with v3, however.

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