NXTMMX is causing a crash?

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc

Moderators: roger, 99jonathan, imaqine

Re: NXTMMX is causing a crash?

Postby gloomyandy » Wed Aug 24, 2011 10:43 am

Hi,
If you aretrying to drive these motors via an mmxmux then al of the low level motot control code is in the mux firmware not in the lejos nxt firmware or classes... THe source for that firmware is not available or as far as i know changable...

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

Re: NXTMMX is causing a crash?

Postby TechnoX » Sat Aug 27, 2011 6:01 pm

I think the easiest way is to just build your own DC Mux, without encoder-input. Just some H-bridges (and communication with NXT, for example I2C), use whichever microprocessor as a motor-slave ;)
TechnoX
Novice
 
Posts: 51
Joined: Tue May 03, 2011 5:57 pm
Location: Sweden

Re: NXTMMX is causing a crash?

Postby skoehler » Sat Aug 27, 2011 6:28 pm

Or how about a bunch of I2C PWM chips attached to the same sensor port?

But I think his problem is of different nature: he actually needs to encoder, but didn't realize that the RC car didn't have any.
skoehler
leJOS Team Member
 
Posts: 1107
Joined: Thu Oct 30, 2008 4:54 pm

Re: NXTMMX is causing a crash?

Postby Rickz2020 » Tue Aug 30, 2011 8:03 pm

I've been taking a bit of a rest from this for a bit as it was irritating the bananas out of me.

Damn, I really thought it would be straight forward and I could just connect any motors. I had no idea about the encoder to prevent overloading.

If anyone can suggest a chassis (cheap as possible and better if from a UK store to prevent import costs) or has any other suggestions, I would really appreciate it.

I've not yet tried harvesting the encoders from the NXT motors but I will soon.

Thanks to all of you who have tried to help and have managed to at least explain the basic reason for my problem. At least I now know what the problem is.

Regards,

Rich.
Rickz2020
Active User
 
Posts: 121
Joined: Thu Feb 10, 2011 5:47 pm
Location: London, Earth.

Re: NXTMMX is causing a crash?

Postby kirkpthompson » Tue Aug 30, 2011 8:21 pm

I had no idea about the encoder to prevent overloading.

Well, to be technically correct, that's not the main reason the encoder is there but it can be used for that... The encoder is a sensor that allows you (well, your code) to determine motor rotation direction and rotation speed (angular velocity). This information can be fed back into a speed control algorithm (i.e. PID control loop) that manages the power to the motor to regulate speed under changing conditions (load).

If you characterize your mechanics, you may be able to use time-based control of your motors. e.g.: 100 (i just picked an arbitrary number) milliseconds [more or less] under x power moves the steering all the way to one side. Stop applying power because we assume it has reached it's goal. Rinse, repeat.

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

Re: NXTMMX is causing a crash?

Postby skoehler » Tue Aug 30, 2011 8:27 pm

Questions is: does the NXTMMX support power regulation only (without any speed regulation)?
According to the user manual is does (timed control it is called) but I have no clue whether the leJOS classes support it.
skoehler
leJOS Team Member
 
Posts: 1107
Joined: Thu Oct 30, 2008 4:54 pm

Re: NXTMMX is causing a crash?

Postby kirkpthompson » Tue Aug 30, 2011 8:35 pm

I don't think I implemented the NXTMMX's timed control in the class (and there was probably a good reason for that). Let me review the code and re-post.

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

Re: NXTMMX is causing a crash?

Postby skoehler » Tue Aug 30, 2011 8:43 pm

kirkpthompson wrote:I don't think I implemented the NXTMMX's timed control in the class (and there was probably a good reason for that). Let me review the code and re-post.


The user guide doesn't really tell, what happens if you disable speed control of a motor. I don't know at which power the motor is running or how you can change the power that the motor is running at. Well, but actually I'm not reading the user manual from top to button. Hopefully, the information is hidden somewhere.
skoehler
leJOS Team Member
 
Posts: 1107
Joined: Thu Oct 30, 2008 4:54 pm

Re: NXTMMX is causing a crash?

Postby Rickz2020 » Tue Aug 30, 2011 11:58 pm

kirkpthompson wrote:If you characterize your mechanics, you may be able to use time-based control of your motors. e.g.: 100 (i just picked an arbitrary number) milliseconds [more or less] under x power moves the steering all the way to one side. Stop applying power because we assume it has reached it's goal. Rinse, repeat.


Yeah, I certainly will give that a try. It would be nice to have an override so that the motor is either always on or always off, though. Because I am building an autonomous GPS robot, I need to have the mechanics working properly before I can test other code properly like navigation, rout mapping and azimuth algorithms.

I'm still hopeful this can be fixed/worked around :)

Rich.
Rickz2020
Active User
 
Posts: 121
Joined: Thu Feb 10, 2011 5:47 pm
Location: London, Earth.

Re: NXTMMX is causing a crash?

Postby kirkpthompson » Wed Aug 31, 2011 1:17 am

re: turning off speed regulation: from original NXTMMXMotor class:
Code: Select all
   /**
    * turns speed regulation on and off for tacho and time methods. forwards
    *  and backwards are not affected because if its off they just wont work.
    *
    */
   public void regulateSpeed(boolean controlSpeed) {
      this.controlSpeed = controlSpeed;

   }


The MMXRegulatedMotor class doesn't offer any option to turn off speed control probably for the same reason. You can try the rotateTime() methods in NXTMMXMotor ...

If you are stalling the motor, the NXTMMX unit is probably shutting off current as a safety measure. Did you ask the Mindsensors folks about that?

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

Re: NXTMMX is causing a crash?

Postby Rickz2020 » Sun Sep 18, 2011 5:50 pm

Hi guys,

Thank you for everyone who has helped. I ended up getting really irritated with it and had a bit of a break, but I guess it's time to get back to work!

The problem remains and I have just done as kirkpthompson recommended and emailed mindsensors about it. Hopefully I'll hear from them soon - they are pretty good.

Have any of you guys had this problem before? I think if you attach any regular DC motor to the MMX and then grab hold of the bit and stop it rotating, you should see the same effect I am talking about. I have tried with regular NXT motors and they work great :)

Maybe it would just be easier to build a chassis using whatever, and then use the NXT motors to do what I need to do? Do any of you know of a good tutorial on how I can go about setting up a basic chassis using lego? - Just in case I don't manage to fix this problem. (It's good to have a back -up plan!)

Thanks again,

Rich.
Rickz2020
Active User
 
Posts: 121
Joined: Thu Feb 10, 2011 5:47 pm
Location: London, Earth.

Re: NXTMMX is causing a crash?

Postby mattallen37 » Wed Nov 02, 2011 1:45 am

Didn't get around to reading this until just now, but there is a way to control RCX motors (motors without encoders). All you have to do is set the P konstant to 0. I know it isn't documented (as of when I went looking), so I had to ask mindsensors for the solution. I haven't actually tried it with the NXTMMX yet, but it works on the NXShield (they say they both use essentially the same motor controller).
Matt
mattallen37
Novice
 
Posts: 28
Joined: Thu Mar 03, 2011 7:45 am

Re: NXTMMX is causing a crash?

Postby kirkpthompson » Wed Nov 02, 2011 1:24 pm

Good info Matt.

I am currently re-working the NXTMMX stuff to support the Firgelli linear actuators and can add a method disablePID(boolean) to set/clear the P constants (two; one for encoder position, one for speed control) but have no way to test this with a RCX (or non-encoder) motor since I don't have one. Any ideas?

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

Re: NXTMMX is causing a crash?

Postby mattallen37 » Wed Nov 02, 2011 3:39 pm

Use two converter cables block to block, with an NXT motor. They will only let through M0 and M1 lines (pins 1 and 2).

Edit: and if you don't have converter cables, use a standard cable and cut all but wires 1 and 2 (white and black).
Matt
mattallen37
Novice
 
Posts: 28
Joined: Thu Mar 03, 2011 7:45 am

Re: NXTMMX is causing a crash?

Postby kirkpthompson » Thu Nov 03, 2011 2:10 pm

Hi.

Just found a Technic motor and converter cable and tried with new MMXMotor class. The NXTMMX works with this without messing with the Kp constant(s). In fact, changing the Kp for speed control to 0 causes the motor to never work. One observation is the power setting doesn't appear very linear. Haven't done any stall tests yet..

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

PreviousNext

Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff