Tetrix DC-motor setPower

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

Moderators: 99jonathan, roger, imaqine

Tetrix DC-motor setPower

Postby wiscu » Thu Jul 25, 2013 10:05 am

Hello

We have just got our hands on some Tetrix. Overall the Tetrix implementations works well (Lejos 0.9.1), though we have a problem with 'setPower(power) when using a DC-motor WITHOUT shaft encoders. The setPower more acts like some kind of acceleration and doesn't change the power at all.

We have read on another webpage http://www.robotc.net/forums/viewtopic.php?f=33&t=1020 that the TetrixMotorController box have a build in PID-controller which might be turn on as default. From robots.net forum:
Do you have the shaft encoders installed? If not, turn off PID control. What is probably happening is:

- You are asking for a particular speed
- The controller applies power to the motor
- There is no data coming from the shaft encoder which it interprets as the motor being stopped
- The controller applies more power to the motor to try to get it moving
- Round and round until (more or less) full power is being applied.


We havn't found any way to turn off the PID-regulation. Does any of you know how this could be possible or if the problem is something completely different?

Thank you.
wiscu
New User
 
Posts: 9
Joined: Mon Nov 12, 2012 4:09 pm

Re: Tetrix DC-motor setPower

Postby kirkpthompson » Thu Jul 25, 2013 2:28 pm

Hi wiscu.

This thread may be relevant: http://lejos.sourceforge.net/forum/viewtopic.php?f=7&t=3332.

What motor class are you using? If no encoder, you need to use TextrixMotor. Also, the 0.9.1 release may not have the fixed classes. I'll have to dig around SVN commit logs a bit to to figure out if the fixes were ever "officially" released. In any case, you could get the classes from SVN to compile and use them.

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Re: Tetrix DC-motor setPower

Postby wiscu » Thu Jul 25, 2013 3:40 pm

Hi Kirk

We are using "TetrixMotor", since we only have "clean" DC-motors without any encoders.

We have read the thread you refer to, and found this (wrote by you - Kirk):
The Problem: I used a class hierarchy: TextrixMotor => TetrixEncoderMotor => TetrixRegulatedMotor, and I return a TetrixRegulatedMotor instance from the TetrixMotorController.getBasicMotor() method which the return type is TextrixMotor.


We have just looked into the code to find out what happens when you call:
Code: Select all
private TetrixMotor left = mc.getBasicMotor(TetrixMotorController.MOTOR_1);


After some searching, we still don't have the full overview of how you code really works, but we made a small discovery. If you change >>super.setRegulate(true)<< to false (in the constructor, Class = TetrixRegulatedMotor), the PID-controller will obviously not be on and we can now control the motorPower and all other functions. But we are pretty sure that TetrixEncoderMotor and TetrixRegulatedMotor won't work any more, we don't have any so never mind for now. But a fix for the future would be very nice!

EDIT:
You could add an extra parameter to the constructor in "TetrixRegulatedMotor", so it would be:
Code: Select all
public TetrixRegulatedMotor(TetrixMotorController mc, int channel, boolean regulate) {
       super(mc, channel);
       super.setRegulate(regulate);
 }


You will also have to do some minor change in TetrixMotorController class, but then we think it might work. It can of course affect some other parts of the code we havn't looked into, but we guess you will know that :)
wiscu
New User
 
Posts: 9
Joined: Mon Nov 12, 2012 4:09 pm

Re: Tetrix DC-motor setPower

Postby kirkpthompson » Fri Jul 26, 2013 1:51 pm

If I understood your reply correctly, I'm pretty sure this is all fixed in the latest SVN revision. Like I asserted, the 0.9.1 release had the bug.

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA

Re: Tetrix DC-motor setPower

Postby ryanw » Thu Jan 30, 2014 7:50 pm

I just downloaded the "latest version" from http://sourceforge.net/projects/lejos/files/lejos-NXJ/
File name: leJOS_NXJ_0.9.1beta-3_win32_setup.exe (21.9 MB)
The problem still seems to be there.
So if the problem is fixed then it is not on sourceforge.
The SVN download and install does not seem to be linked or described on the www.lejos.org website.
So where do I get, and how do I install the fixed version?
ryanw
New User
 
Posts: 2
Joined: Thu Jan 30, 2014 3:17 pm

Re: Tetrix DC-motor setPower

Postby kirkpthompson » Thu Jan 30, 2014 8:38 pm

Hi.

It is in the SVN repository i,e. the snapshot. What you downloaded was a release installer. You have to use the snapshot. The forum has posts on how to use the snapshot so you will need to search a little. The repos is at: http://sourceforge.net/p/lejos/code/HEAD/tree/trunk/

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 304
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff