NXTMMX - No unregulated speed control?

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

NXTMMX - No unregulated speed control?

Post by ricardocrl »

Hi all,

I'm using an NXTMMX with PF motors L. With an Angle sensor from HiTechnic, I want to do my own PID control of the motor positioning.

I got surprised that the speed of the L motor seems to be "full", whatever value I ask for. It makes me believe that the NXTMMX is using speed regulation, making the speed always maximum due to no tachometer feedback.

Does anyone confirm that the NXTMMX doesn't work with unregulated speed/power?

Ricardo
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXTMMX - No unregulated speed control?

Post by mattallen37 »

I ran into the same situation with the new NXShield. I talked to Deepak about it, and he said to set the P parameter to 0. Therefore, write registers 0x7a, and 0x7b to 0. The NXShield motor control and NXTMMX are very much the same. I tested it to work with the NXShield, but I haven't tried it with my NXTMMX yet (I should see exactly the same results). I don't know that the "speed" written to the speed register translates into PWM percentage, but it is some sort of direct PWM control.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Re: NXTMMX - No unregulated speed control?

Post by ricardocrl »

I got a reply from mindsensors support some days ago with nice information:
Use the function:
void MMX_Init( byte port, byte addr, byte profile )
where profile is MMX_Profile_RCX_Motors

this initializes the NXTMMX for RCX motors (which don't have the encoder).
It's not reported in the API, but now we know! :-) I haven't tried it yet!
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Re: NXTMMX - No unregulated speed control?

Post by ricardocrl »

Oops, now I checked and, that macro is not defined. There is no new API in the mindsensors webpage, so I'll ask them again the value of MMX_Profile_RCX_Motors.

I'll drop it here as soon as I know.
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: NXTMMX - No unregulated speed control?

Post by mattallen37 »

Okay, cool.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Re: NXTMMX - No unregulated speed control?

Post by ricardocrl »

Here are the new features! ;)

Code: Select all

/*
 * Motor profile related constants
 */
#define MMX_Profile_NXT_Motors 0
#define MMX_Profile_RCX_Motors 1
#define MMX_Profile_LinearActuators 2


void MMX_Init( byte port, byte addr, byte profile )
{
  SetSensorLowspeed(port);

  switch (profile) {
  case MMX_Profile_NXT_Motors:
    // do nothing.
    break;
  case MMX_Profile_RCX_Motors:
    MMX_WriteByte(port, addr, 0x46, 0);  // set M1 speed to zero.
    MMX_WriteByte(port, addr, 0x4e, 0);  // set M2 speed to zero.
    MMX_WriteByte(port, addr, 0x7a, 0);  // set P lo-byte to zero.
    MMX_WriteByte(port, addr, 0x7b, 0);  // set P hi-byte to zero.
    break;
  case MMX_Profile_LinearActuators:
    // not implemented yet.
    break;
  default:
    TextOut(0, LCD_LINE5, "MMX: Incorrect ", false);
    TextOut(0, LCD_LINE6, "Motor Profile. ", false);
    TextOut(0, LCD_LINE7, "               ", false);
    TextOut(0, LCD_LINE8, "Press ORNG Btn ", false);
    PlayTone (440,200);
    Wait (500);
    PlayTone (440,200);
    until(ButtonPressed(BTNCENTER, true));
    StopAllTasks();
    break;
  }
}
Post Reply

Who is online

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