Tetrix Motors without encoders.

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

Moderators: 99jonathan, roger, imaqine

Tetrix Motors without encoders.

Postby ryanw » Thu Jan 30, 2014 4:33 pm

The setPower() method does not work as expected, motors always reach maximum speed regardless of power setting. The setPower() method only affects the amount of time the motor takes to achieve full speed.

I'd like to set the motor 1 and motor 2 to different speeds. I'm NOT concerned about controling the exact RPM or rotating to a paticular position, or keeping the speed constant under load (all of which would require encoders). I'm just interested in setting the voltage applied to the motor. The person driving the robot will see how fast the robot is moving, which way it is turning and make adjustments accordingly.

The current API only seems to support full forward, full reverse, or all stop. This results in jerky robot movement.

I've been digging through source code and noticed that the TetrixMotorController fills its "motor" array with TetrixRegulatedMotor objects, which setRegulate(true) in the constructor and override the setRegulate() method to return without doing anything. When creating a TetrixMotor from TetrixMotorController it returns one of the TetrixRegulatedMotor objects as a TextrixMotor.

So with this design it is impossible to have an unregulated motor. I'm not 100% sure this is the problem, but since RegulatedMotor extends EncoderMotor and I'm not using Encoders, this looks suspicious.

Any suggestions how I might get an unregulated motor that spins at a constant rate (assuming constant load) that is something less than full speed?
ryanw
New User
 
Posts: 2
Joined: Thu Jan 30, 2014 3:17 pm

Re: Tetrix Motors without encoders.

Postby kirkpthompson » Sat Feb 08, 2014 2:59 am

We'll, I'm not sure if the current release has some bug fixes for encoder motors but I think you should use public TetrixMotor getBasicMotor(int motorID) from TetrixMotorController to get an unregulated motor. The polymorphism you observed should not matter.

There were a few threads in the forum that resolved to a bug fix but I don't recall. Did you search for "Tetrix"?

If the source you studied was from an install, do a diff between that and the pertinent sources at https://sourceforge.net/p/lejos/code/HEAD/tree/trunk/classes/src/lejos/nxt/addon/tetrix/ to see if you have the current.

-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 Motors without encoders.

Postby kirkpthompson » Sat Feb 08, 2014 3:05 am

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 3 guests

more stuff