11-26-2013 09:31 AM
this problem happens in the teleop part of our program. we use the omni wheels and are controling those wheels through a analog stick.
in the picture is our wheels controlling part.
when we try this program in high speed mode, the data will go out of range. normally, the data will be change to the max or min limit, but the real action of the robot shows that the program is actrully revert the speed value of the wheels when the analog stick is in the four corner.
why? i really think this is impossible, though.....
11-26-2013 10:07 AM
Jerry:
Math 'overflow' errors can cause a sign bit to switch. Things like that can happen depending on how numbers are stored and the math operations performed. I don't know what kind of safegauards LV has against this.
Data Representation is indicated by the colored wires.
I8 and I16 are both blue wires so I don't know which you have in use here. You will need them to be i16....here's why:
If 'speed' is set to 100, and you think of joystick output as a percentage modifier on that, you are adding and subtracting values that can be [-100..+100] before co-ercing. The resulting number might go out of the I8 range of [-128 to +127]; thereby flipping the sign bit.
Something to try before you make code changes:
When it flips to 'reverse' is the power about the same? or is it quite a bit slower, just in reverse?
You can use the 'Funtions - NXT Programming - numeric - conversion' operators to enforce the data representations.
Another thing you might consider:
NOTE: I'm sharing this as a possibility based on my knowledge of computer science, in genreal. I dont know a lot about the specifics of LabVIEW in this regard. Perhaps a LabVIEW expert can chime in.
I look forward to hearing from you if my theory holds true
11-29-2013 10:02 AM
Thanks, it works. I found that the data type in analog stick is all I8, so I change them all to I32, and the program works well.