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 Rickz2020 » Thu Aug 18, 2011 4:10 pm

Well,

I've got myself a new power supply and I still have the same issue. I've tried everything and the problem won't go away.
I have also noticed that if I exit the NXT app, the motors continue "twitch" in the same way they were "twitching/hiccuping" prior to exiting the NXT app. This makes me think it has to be the NXTMMX.

It's as if it is getting little interrupted power points... Like it's motor on(1..2..3), motor off(1..2..3).

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

Re: NXTMMX is causing a crash?

Postby kirkpthompson » Thu Aug 18, 2011 6:01 pm

I wonder if your unit got buggered up somehow with the low voltage and ([relatively] high current draw(?) of the motors). Have you asked Mindsensors tech support what the behavior your unit is experiencing may be?

I am not excluding the possibility of the MMX classes being buggy. Can you provide the error messages that are appearing on the LCD?

Can you write a simple test case (or use the NXTMMXSample in \Samples) that sets up the motors and turns them on (no threads, control schemes etc.) for a period of time to see if the unit itself is working without glitch in a very code-minimal usage scenario?

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 » Fri Aug 19, 2011 11:43 am

kirkpthompson wrote:I wonder if your unit got buggered up somehow with the low voltage and ([relatively] high current draw(?) of the motors). Have you asked Mindsensors tech support what the behavior your unit is experiencing may be?

I am not excluding the possibility of the MMX classes being buggy. Can you provide the error messages that are appearing on the LCD?

Can you write a simple test case (or use the NXTMMXSample in \Samples) that sets up the motors and turns them on (no threads, control schemes etc.) for a period of time to see if the unit itself is working without glitch in a very code-minimal usage scenario?

Best,
-K


Hi kirkpthompson,

I'm going to try and test it with normal NXT motors and see if I have the same problem, although I think I have already done this a while back. Also, I'll set up a simple test as you requested and let you know how I get on.

One last thing, the NXT is no longer crashing... I took the batteries out, recharged them, re-installed the app on both the NXT brick and the Android and it seems to have fixed the crash. I just wish it would fix this problem :)

I have to go hand over a website today so I'll try do the tests tomorrow and get back ASAP.

Thanks for your help,

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 » Fri Aug 19, 2011 12:55 pm

I'm going to try and test it with normal NXT motors...


What type of motors are you currently using? I tried to use the NXTMMX to drive a Firgelli linear actuator but they would only respond when the power/speed was set to high level. If you are using non-LEGO NXT motors, and you ramp speed up/down depending on position of your tilt sensor, maybe they have the same problem and they are only responding when the output of the NXTMMX reaches a certain level and then the motors suddenly "lurch" on (at that high output level). That could explain the "hickuping".

I suspect that the NXTMMX PWM output does not match what the LeJOS firmware provides but am not competent with a scope (and don't have one!) so I can not validate this theory. I queried Mindsensors back in May on this and never did get a reply.

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 » Sat Aug 20, 2011 7:00 pm

kirkpthompson wrote:
I'm going to try and test it with normal NXT motors...


What type of motors are you currently using? I tried to use the NXTMMX to drive a Firgelli linear actuator but they would only respond when the power/speed was set to high level. If you are using non-LEGO NXT motors, and you ramp speed up/down depending on position of your tilt sensor, maybe they have the same problem and they are only responding when the output of the NXTMMX reaches a certain level and then the motors suddenly "lurch" on (at that high output level). That could explain the "hickuping".

I suspect that the NXTMMX PWM output does not match what the LeJOS firmware provides but am not competent with a scope (and don't have one!) so I can not validate this theory. I queried Mindsensors back in May on this and never did get a reply.

Best,
-K


I think you may be right!

I have just tried this (my Android app and NXT app) using standard NXT motors and I have no problems! At least now I know I'm not going crazy and my code is most likely correct.

I have no idea what the specs are for the motors. I've opened it up and they are just those cheap "squarish" motors with grey housing; You know, the ones in most kid toys.
I've posted a couple of times and am hoping someone can tell me the specs - but I have no idea if anyone will get back to me.

At least this is progress, thanks!

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

Re: NXTMMX is causing a crash?

Postby skoehler » Sat Aug 20, 2011 9:29 pm

Rickz2020 wrote:I have no idea what the specs are for the motors. I've opened it up and they are just those cheap "squarish" motors with grey housing; You know, the ones in most kid toys.
What did you open up? Which Motors are inside? Can you post pictures, product names, or anything else that would give us an idea what you're talking about?

If you don't know anything about the motors, how do you know that they actually provide the feedback (tacho count), that is required for successfull speed regulation? I guess, the motors don't provide that, which means they will not work with speed regulation. Not sure, whether the speed regulation of the NXTMMX can be turned off.

Rickz2020 wrote:At least this is progress


Kind of ...
skoehler
leJOS Team Member
 
Posts: 1112
Joined: Thu Oct 30, 2008 4:54 pm

Re: NXTMMX is causing a crash?

Postby Rickz2020 » Sun Aug 21, 2011 1:21 am

skoehler wrote:What did you open up? Which Motors are inside? Can you post pictures, product names, or anything else that would give us an idea what you're talking about?


Here is the RC car I'm using: http://www.amazon.co.uk/gp/product/B004 ... d_i=468294

Here is a picture showing the motor:
Image

There are 3 of these motors - 1 for the front, 1 for the back and 1 for steering. Each about 3.5cm long (just to give you an idea of how small they are).

skoehler wrote:If you don't know anything about the motors, how do you know that they actually provide the feedback (tacho count), that is required for successfull speed regulation? I guess, the motors don't provide that, which means they will not work with speed regulation. Not sure, whether the speed regulation of the NXTMMX can be turned off.


I opened up the RC car motor housing. I'm still waiting for a reply to a my post on amazon re: which type of motors are used.
I don't know if they provide tacho count - I think they do go faster depending on the setSpeed(int); but I'l double check in the morning - I can hardly see right now O.o

I'm so glad I didn't spend my childhood playing GI Joe or Batman and Robin... Had I, I'd never have put it back together!
Rickz2020
Active User
 
Posts: 121
Joined: Thu Feb 10, 2011 5:47 pm
Location: London, Earth.

Re: NXTMMX is causing a crash?

Postby kirkpthompson » Sun Aug 21, 2011 2:40 am

I don't know how you wired those motors in and did not know (until recently... I was assuming NXT motors) that you were not using the NXT motors (shows why making assumptions is bad!) but without feedback from a tacho, the NXTMMX unit has no way to regulate the speed and the behavior you were experiencing is more than likely due to it's PID control loop freaking out and resetting when it received no PV (feedback) data after a certain amount of time (all supposition on my part). All bets are off unless you stick with NXT motors.

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 Aug 21, 2011 5:12 pm

I've just opened up the motor housing again and this time I held the motor in place(preventing it from rotating) and applied power. Then, I connected the multi-meter across the motor terminals and watched to see what happened. I've noticed that the power seems to get "interrupted" when the motor is prevented from rotating(the same as when it's used to turn the axis so the car can turn left or right - it can only rotate a certain distance and then can't go any further). The power spikes from 0v to 3.X v like it's being switched on and off, on and off, on and off...

Is this what you guys are talking about regarding not receiving feedback from a tacho? Does this mean I need to get specific motors?

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 » Sun Aug 21, 2011 5:50 pm

I held the motor in place(preventing it from rotating) and applied power. Then, I connected the multi-meter across the motor terminals and watched to see what happened. I've noticed that the power seems to get "interrupted" when the motor is prevented from rotating

That is probably due to overload protection provided by the NXTMMX circuitry. (you really shouldn't overload motors like that)

Is this what you guys are talking about regarding not receiving feedback from a tacho?

No, sorry. The tachometer is physically implemented as an encoder (quadrature, etc.) which provides a way for the NXT to determine what direction the motor is rotating and at what speed (see http://en.wikipedia.org/wiki/Rotary_encoder). This data is the feedback provided to the motor regulation algorithm (normally some flavor of a PID control loop) so that it may regulate the speed of the motor. If you are adventurous, Wikipedia has a good article on PID control.

Does this mean I need to get specific motors?

Well, to avoid the sort of problems you are having, the answer is probably "Yes". You need motors that provide an encoder and are designed (or hacked) to work with the NXT and NXTMMX.

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 Aug 21, 2011 9:50 pm

Damn, I don't know what to do now.

I've spent so much money already on this. It's a project for uni and I've put too much work into it to turn back now.

I'm thinking of pulling the 3 NXT motors apart and removing the encoders, and then attach the encoders to the motors in my RC car. Does that sound feasible?

If not, my only other option would be to find a new ready-to-use RC car that I can control via the NXT or to build one from scratch.

Any recommendations?

Rich.

PS: Thanks for all the help so far!
Rickz2020
Active User
 
Posts: 121
Joined: Thu Feb 10, 2011 5:47 pm
Location: London, Earth.

Re: NXTMMX is causing a crash?

Postby kirkpthompson » Sun Aug 21, 2011 11:09 pm

Maybe characterize your motors with your design implementation and use time-based actions (i.e. on for 100 millisecs @ 100% power means x degrees rotation means steer all the way from one side to the other). The problem with this approach is when battery voltage drops, it changes how much the motors move in the same amount time as when there is a full charge.

Maybe put limit switches or sensors to detect when a steer action etc. hits a limit and stop the action?

I don't think you can pull the encoders out of a NXT motor and use them in something else without great difficulty. Philo has a good page on NXT motor guts: http://www.philohome.com/nxtmotor/nxtmotor.htm

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 » Mon Aug 22, 2011 9:06 pm

Thanks for the suggestions K but I think I'm going to try extract the encoders from the NXT motors and see if I can get them to work with my RC motors.

I am wondering if this problem I am facing is a physical hardware limitation or if I can edit the leJOS code, flash my NXT brick, re-install leJOS on my NXT and then see if it solves the problem. What do you think?

I guess the NXT motors are designed to rotate to a spot and lock if needed by calling .lock(); rather than have them physically stopped by an outside source. I know this would be overloading the motors, but this is the way the RC car appears to work - unless the encoder is built into the receiving circuit which controls the car.

If I can't get this to work then I don't know what motors I'm going to use. The problem is that in London there are not many hobby stores and very VERY few places that sell lego components.

I'll keep trying to fix this and if I still have not fixed it before I go back to uni I will make a new thread looking for suggestions on how to build a platform to control my robot.

kirkpthompson wrote:Philo has a good page on NXT motor guts: http://www.philohome.com/nxtmotor/nxtmotor.htm


I had already read this - it's where I got the idea to extract the encoders. But thanks anyway :)

Thanks,

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 » Mon Aug 22, 2011 9:29 pm

...edit the leJOS code, flash my NXT brick, re-install leJOS on my NXT and then see if it solves the problem. What do you think?

Well, I don't code at that level (gcc, make, toolchains, etc.) so I can't really answer that question but I don't readily see where you are going with this since the NXTMMX is its own unit and only communicates with the NXT via I2C (as a sensor basically) so I don't really understand why you need to change the NXT firmware. gloomyandy has a lot of experience with the firmware and may be the best to try to understand what you want in that regard if you can communicate your need succinctly.

You can modify/copy the source for the NXTMMX and not have to change any firmware though...

I guess the NXT motors are designed to rotate to a spot and lock if needed by calling .lock(); rather than have them physically stopped by an outside source.

Yes, all done in software in the motor classes.

The problem is that in London there are not many hobby stores and very VERY few places that sell lego components

And they might have all been looted. Craziness... In all seriousness, my heart goes out to all those adversely affected.

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 23, 2011 7:20 am

kirkpthompson wrote:
...edit the leJOS code, flash my NXT brick, re-install leJOS on my NXT and then see if it solves the problem. What do you think?

Well, I don't code at that level (gcc, make, toolchains, etc.) so I can't really answer that question but I don't readily see where you are going with this since the NXTMMX is its own unit and only communicates with the NXT via I2C (as a sensor basically) so I don't really understand why you need to change the NXT firmware. gloomyandy has a lot of experience with the firmware and may be the best to try to understand what you want in that regard if you can communicate your need succinctly.

Also, the code for regulating the motors is entirely in Java. No need to change the firmware.
skoehler
leJOS Team Member
 
Posts: 1112
Joined: Thu Oct 30, 2008 4:54 pm

PreviousNext

Return to NXJ Hardware

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff