robots don't drive straight

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

robots don't drive straight

Postby rhsteach » Wed Oct 12, 2011 11:09 pm

Hi,
Our robotics club just updated 2 robots to Lejos 0.9.0. We are finding that the robots do not drive in a straight line: sometimes they veer left; sometimes, right. It seems as if the motors are not synched, but I cannot find how to correct this. Is there something wrong with the way we set up the DifferentialPilot?
Thanks

Code: Select all
public class SetupTest
{
   static float wheelBase=15.00F; // sets width of robot from wheel to wheel
   static float wheelDiameter= 8.27F; //Sets wheel diameter
static DifferentialPilot pilot = new DifferentialPilot(wheelDiameter, wheelBase, Motor.A, Motor.B, true);
   

public static void main(String[] args)
   {     

     pilot.setTravelSpeed(25);
     pilot.setRotateSpeed(150);      
     Pilot.travel(100);
rhsteach
New User
 
Posts: 13
Joined: Tue Dec 14, 2010 4:03 am

Re: robots don't drive straight

Postby gloomyandy » Wed Oct 12, 2011 11:35 pm

Hi, so what software did you use to control your robot before you updated to leJOS 0.9? Did your robot run straight then? You may want to try running your robot at a slower speed. Try running it on diferent surfaces. Try setting a slower acceleration rate.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4085
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: robots don't drive straight

Postby rhsteach » Thu Oct 13, 2011 6:17 pm

We were using 0.85 (I think), and the robots started more quickly and ran straight. Lowering the acceleration did correct the problem.

Feature Request: as time permits, could default values for such things as Acceleration, RotateSpeed, TravelSpeed, etc., be added to the documentation?

Thanks
rhsteach
New User
 
Posts: 13
Joined: Tue Dec 14, 2010 4:03 am

Re: robots don't drive straight

Postby gloomyandy » Thu Oct 13, 2011 6:23 pm

Hi,
just to clarify. Are you saying that the previous version accelerated more quickly than the current version, and that reducing the acceleration of the current version, that is making it start even slower fixed the problem? If this is the case that does sound a little odd...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4085
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: robots don't drive straight

Postby rhsteach » Thu Oct 13, 2011 7:28 pm

Sorry - that was confusing. I meant, regarding:

Movement - under the old version, the robot started to move immediately after the "execute program" button was pushed. With the new version, there is a noticeable delay before the robot begins to move.
Acceleration - under the old version, acceleration was left at default values (I didn't even realize it could be adjusted). Today, with 0.9.0, I set acceleration to 100 and then to 300; in both cases the robot traveled in a fairly straight line.
rhsteach
New User
 
Posts: 13
Joined: Tue Dec 14, 2010 4:03 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff