Problems using DifferentialPilot.rotate(), bug?

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

Moderators: roger, 99jonathan, imaqine

Problems using DifferentialPilot.rotate(), bug?

Postby imk82 » Mon Jul 23, 2012 9:34 pm

Hello together,

I have a little but annoying problem using the DifferentialPilot Class with my NXT Robot. From the "hardware side" the robot is a simple construction with two motors, each one is powering one track (-> tracked vehicle).

I create a new object with the constructor parameters wheeldiameter, trackwidth, left motor, right motor. Everything fine so far. But if I try to rotate the robot around, lets say 90 degrees, it doesn't! It rotates jus around approximately 45 degrees.

Wheeldiameter and trackwidth are in the same unit (mm) and correct as far as I can say (following the API documentation).

Has anyone the same issues? I didn't know what to do.

Best regards
Imk82
imk82
New User
 
Posts: 2
Joined: Mon Jul 23, 2012 9:22 pm

Re: Problems using DifferentialPilot.rotate(), bug?

Postby skoehler » Mon Jul 23, 2012 10:27 pm

The robot drives 10cm if you tell it to travel 100mm, right? But it doesn't rotate properly?
May I suggest that you double your trackwidth?
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: Problems using DifferentialPilot.rotate(), bug?

Postby gloomyandy » Tue Jul 24, 2012 11:25 am

Track width for tacked vehicles is a tricky thing to come up with. I would suggest that as a starting point you use the diagonal distance between the two extreme contact points with the ground (so front point on left track to back point on right track). The simply tune this until the turns work correctly.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Problems using DifferentialPilot.rotate(), bug?

Postby imk82 » Tue Jul 24, 2012 10:11 pm

Hello,

thanks for your comments.

skoehler wrote:The robot drives 10cm if you tell it to travel 100mm, right? But it doesn't rotate properly?
May I suggest that you double your trackwidth?


Yes, if I tell him to travel 100mm, he drives them. But the rotation angle is not correct. And no, my trackwidth is not doubled, should I? If i do so, he rotates to much (around 130 degrees instead of 90).

gloomyandy wrote:Track width for tacked vehicles is a tricky thing to come up with. I would suggest that as a starting point you use the diagonal distance between the two extreme contact points with the ground (so front point on left track to back point on right track). The simply tune this until the turns work correctly.


Thanks for this hint. It is much nearer on 90 degrees now and I think I can optimize it. But: I don't understand why it is so? I thought that this class was designed for robots/vehicles like this? Why is it not working? Or asked in the opposite: how did I have to build my robot, that it would work properly?

Best regards
Imk82
imk82
New User
 
Posts: 2
Joined: Mon Jul 23, 2012 9:22 pm

Re: Problems using DifferentialPilot.rotate(), bug?

Postby gloomyandy » Tue Jul 24, 2012 10:30 pm

The class is designed for robots that have two wheels (plus a castor), not two tracks.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Problems using DifferentialPilot.rotate(), bug?

Postby Aegean » Tue Oct 09, 2012 9:57 pm

I have got same kind of problem as imk82 has.

Real track width of my robot is 185mm. It is not going to turn full 90 degree rotations.

*****

I tried to optimise DifferentialPilot by using some track width values from 160 to 220mm - but without success!

I succeed to optimise 90-degree rotation. But when I change the rotation angle from 90 to 180, I took very poor results, again... :(

This makes optimization may quite useless.. You can not reach good results by using "wrong" track width -arguments!

*****

It's very sad, that DifferentialPilot does not work very well with two tracks.

I don't want to use castor wheel! I don't want my robot looks like a stupid Roomba-hoover!

I want that my robot moves & looks & feels as real martian Curiousity-rover... 8)

****

Has anybody tried to solve DifferentialPilot -problem by writing better java-class?
Aegean
New User
 
Posts: 3
Joined: Tue Oct 09, 2012 9:05 pm
Location: Finland

Re: Problems using DifferentialPilot.rotate(), bug?

Postby gloomyandy » Tue Oct 09, 2012 10:18 pm

Well curiosity does not use tracks it has a rocker bogie arrangement with steerable wheels:
http://en.wikipedia.org/wiki/Rocker-bogie
http://en.wikipedia.org/wiki/Mars_Scien ... tory#Rover

But anyway. It is possible to get good results with tracks, but this depends to some extent upon the surface you are running on and on the construction of the robot. It will also require careful calibration of the robot. Take a look at the following video:
http://www.youtube.com/watch?v=IMI63k5W ... ature=plcp
Ignore the localization stuff. As you can see the robot uses tracks and even without localization it does a reasonably good job of turning and running straight. This robot is controlled using the standard differential pilot. How are you trying to perform the turns? Are you doing on the spot turns or trying to turn in an arc? I suspect things do not work well with turning in an arc with a tracked robot. Other things you may need to try, slow down the speed, also try using a slower acceleration. Both of these can result in turns being less accurate.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Problems using DifferentialPilot.rotate(), bug?

Postby Aegean » Wed Oct 10, 2012 9:19 pm

Gloomyandy, your location-system is marvelous! Cool :shock:

*****

I noticed that surface really has big matter, if robot's has not got a caster-wheel.

I rip off the robot's non-motorized wheels. Then I tried to drive Tutorials SquareTracer again on plain & slippery floor; the robot managed very well!

So: My conclusion is, that with four-wheeled drives, the friction of non-motorized tyres somehow resists and disturbs cornering... So non-motorized wheels should be -at least- steered by one motor.

Of course it is much more simple to build construction with tracks. But I have only two couples of standard-tracks (parts of "ordinary" Mindstorm NXT Set). And I need framework large enough for payload. I dont know what is the final use of my robot, but it has to have some sort of functional features. That's the reason the I'm not going to replace the tyres by tracks as my first opinion.

There's now exciting challenge to build up streering mechanism with ordinary parts. And there's no too many couple of sprockets, nor small parts - but I'm going to try at least! :D
Aegean
New User
 
Posts: 3
Joined: Tue Oct 09, 2012 9:05 pm
Location: Finland


Return to NXJ Software

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron
more stuff