0.9.0 resetTachoCount()

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

Moderators: 99jonathan, roger, imaqine

Re: 0.9.0 resetTachoCount()

Postby poohsen » Tue Jan 31, 2012 9:32 pm

well, I couldn't isolate the "jerking" behaviour, but there is definitely something wrong there.
when I connect two bricks via RS485 with one running the "NXTLCPRespond" program from the samples dir and the other running this:
Code: Select all
import java.io.IOException;

import lejos.nxt.LCD;
import lejos.nxt.TouchSensor;
import lejos.nxt.comm.RS485;
import lejos.nxt.remote.RemoteNXT;



public class ResetTachoCntBug {

   public static void main(String[] args) throws IOException{
      RemoteNXT rnxt = new RemoteNXT("NXT", RS485.getConnector());
      TouchSensor cwLimit = new TouchSensor(rnxt.S2);
      rnxt.B.forward();
      while(!cwLimit.isPressed()){
        try {Thread.sleep(50);} catch (InterruptedException e) {}   
      }
      rnxt.B.stop(false);
      try {Thread.sleep(3000);} catch (InterruptedException e) {}
      LCD.drawString("resetting count", 0, 1);
      rnxt.B.resetTachoCount(); // that's when it happens
      try {Thread.sleep(1000);} catch (InterruptedException e) {}
      LCD.drawString("done", 0, 2);
      try {Thread.sleep(10000);} catch (InterruptedException e) {}   
   }
}

then rnxt.B.resetTachoCount() will actually rotate the motor back to 0, instead of just resetting the count.
That's not what it is supposed to do, right?

c.
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: 0.9.0 resetTachoCount()

Postby gloomyandy » Tue Jan 31, 2012 11:23 pm

Hi,
so just to be clear if you simply run the above code on a single NXT do you see any problem?

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

Re: 0.9.0 resetTachoCount()

Postby poohsen » Wed Feb 01, 2012 7:47 pm

hi,
as with the "rotateTo(0)-Bug", running the above program with Motor.B gives me correct behaviour. This, too, is a bug when using RemoteMotor.
Let me know if there is anything else I can do/test to help.

br,
chris
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: 0.9.0 resetTachoCount()

Postby gloomyandy » Wed Feb 01, 2012 9:30 pm

Hi,
Thanks for trying this! Final question! When using it remotely does the problem happen if you do the following...
1. Turn off the NXT with the motor attached
2. Turn it on
3. Run the listening program (assuming you are using RS485
4. Run your test program on the other NXT

Basically what I want to check is if the fault still happens if you run the test with the listening NXT freshly powered on, so that the motor has not moved at all since power on (in which case the tacho should be at location 0)...

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

Re: 0.9.0 resetTachoCount()

Postby poohsen » Thu Feb 02, 2012 10:51 pm

hi andy,

same result when following your instructions.

br,
chris
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: 0.9.0 resetTachoCount()

Postby mato » Sat Feb 04, 2012 12:31 pm

Hi,

I have same problem with lejos 0.9.0 running on my NXT. Have you fixed it somehow?

Thanks,
Mato
mato
New User
 
Posts: 2
Joined: Sat Feb 04, 2012 12:26 pm

Re: 0.9.0 resetTachoCount()

Postby poohsen » Sun Feb 05, 2012 12:25 pm

no, I just save the tacho count instead of resetting it and then use the value as an offset for further calculations.
c.
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: 0.9.0 resetTachoCount()

Postby gloomyandy » Tue Feb 07, 2012 12:19 am

leJOS 0.9.1 should contain a fix for this please give it a try and let me know. Note that you must upgrade the NXT to 0.9.1 to get this fix...

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

Re: 0.9.0 resetTachoCount()

Postby poohsen » Wed Feb 08, 2012 8:58 pm

hi,

I've seen the fix for the rotate(0) problem but I can't find the checkin containing a fix for this one. Which classes did you have to edit?

br,
chris
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: 0.9.0 resetTachoCount()

Postby gloomyandy » Wed Feb 08, 2012 10:28 pm

The fix is in the LCP class:
http://lejos.svn.sourceforge.net/viewvc ... iew=markup
You will also need an updated motor class. However as I said above unless you are running your own LCP responder on the NXT then you will need an updated version of the firmware (actually the menu program) for this fix to work. By far the easiest way to get this is to update to 0.9.1 is there some reason why you don't want to do this?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4119
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: 0.9.0 resetTachoCount()

Postby poohsen » Wed Feb 08, 2012 10:33 pm

no, not at all. I just wanted to have a look at the fix, that's all. I saw that file earlier but misread the name for LCD.java and thus didn't think it was the one I was looking for.
thanks for clearing things up!

c.
poohsen
New User
 
Posts: 20
Joined: Sun Nov 20, 2011 1:47 pm

Re: 0.9.0 resetTachoCount()

Postby mato » Sun Feb 12, 2012 11:17 am

I will give it a try with leJOS 0.9.1 as soon as possible and let you know whether it works to me. Thanks so far.
mato
New User
 
Posts: 2
Joined: Sat Feb 04, 2012 12:26 pm

Previous

Return to NXJ Software

Who is online

Users browsing this forum: Exabot [Bot] and 2 guests

more stuff