02-07-2011 01:34 PM
My code is a simple "forward until closer than X centimeters" then turn until... The turn occurs fine when I run the code attached by USB. Once I deploy it, the left wheel stops and goes very quickly, as if the whole loop is running once a second or so. Computer is windows XP.
code is attached...
Thanks!
M
02-08-2011 10:52 PM
Hi M,
Were you able to determine why the Wait_Num.vi wasn't waiting for the requisite number of seconds before the motors stopped in your previous post?
If you changed the last Wait for Away.vi such that it waited until the sensor read farther than 15, do you get a better result? I'm not sure how stable the distance sensors' measurements are, but at 10 from an obstacle, the loop would iterate rapidly and the left motor would pulse as the robot receives measurements; 9.9, 10.1, 9.9, 10.1 …
I hope this helps,
02-10-2011 11:56 AM
Fred,
Regarding your first question: I have no Wait_num.vi in the code. I only have a Wait_Closer.vi and a Wait_Further.vi. Should I have a Wait_num.vi ? Or some other kind of Wait vi to help steady the code?
Changing the last Wait_Further.vi to greater numbers yeilds the same result. We have changed numbers in both distance sensors numerous carefully.
The code runs fine when attached to laptop computer by USB. Once downloaded to the NXT block, the left wheel stops and starts once a second or so.
02-11-2011 11:49 AM
Hi Mark,
I realise that you don't have a Wait_num.vi in this code, but I was curious whether you had resolved other clearly incorrect behavior with your hardware. Have you resolved that issue?
You shouldn't need that VI in your current code, but given that the hardware behaves differently when attached via USB versus when disconnected, I'm concerned that something more significant is at play.
Can you describe your hardware setup, so I might be able to try and reproduce the behavior that you're seeing?
02-12-2011 05:35 PM
Hey Fred - actually, after increasing detection distances as well as the difference between Distance closer than.vi and Distance farther than.vi distances, the problem has resolved. We have not performed repeated testing to insure that was the issue - we're tight for time. We'll let you know if we need any more help.
Regarding the hardware setup: Xp lap top connectted via USB to NXT block on tetrix kit robot powered by two motors.
Thanks!
-Mark