keverjeroen

Just some 9v train automation with Mindstroms NXT 2.0

Recommended Posts

Hi all,

In January 2014 I build a small 9v LEGO train layout. I use Mindstorms nxt 2.0 to control the trains and switches. Now I’ve found this video, I’ve uploaded to my YouTube Channel.

The layout works like this:

1. Both trains are running on the outer track. The nxt motor controls the big yellow button on the Speed Regulator.
2. Due to small differences in the train motor and the weight of the trains, the come closer to each other.
3. If the distance between the two trains is to small (less than 3 seconds, seen by the ultrasonic sensor), the last train drives to the inner track and stops over there for 10 seconds. A nxt motor switches the switch.
4. The train on the outer track keeps driving.
5. After 10 seconds the train on the inner track moves to the color sensor, just before the switch and stops.
6. If the train on the outer track passes the other switch (ultrasonic switch), the train on the inner track starts moving to the outer track.
7. Then it all starts over again.

Let me know what you think about this layout! I’m also curious how you guys control your trains and switches. Any automation with Mindstorms?? 1f682.png

?

 

Share this post


Link to post
Share on other sites

Looks nice, although I see imminent disasters lurking ;). I control trains with Arduino / Pi, I have some Mindstorms RCX and NXT's lying around for this (the EV3 is busy with other things), but they are quite bulky for train control, although it is a more 'pure' solution, often I just want the job done.

Share this post


Link to post
Share on other sites

I like the way you use the mindstorms to control the blocks but do not power them directly from the mindstorms brick. Another way to do this using a single 9v controller is to use polarity switches to turn on or off different sections of track.

Share this post


Link to post
Share on other sites

Nice.  I use Arduino to control my PF trains.  It is much cheaper than a NXT or EV3 solution.  Too be purist at public events, I borrowed a EV3 to start/stop a GBC machine.  I am thinking of using it to control PF trains on our LUG layout.  With Mindstorm 3 servos, I can turn the PF IR Speed Controler knobs and press the Stop buttons.  We run outside under our large white tent.  Bouncing IR signals off the tent seems to work when I tested my Arduino with an IR LED from a DVD remote. I wonder if PF IR controller is as strong. 

 

 

Share this post


Link to post
Share on other sites

Yeah Arduino is much cheaper and you can do so much more with that. But I had already a Mindstorms NXT 2.0 laying around.. :) Maybe If I get this working on my bigger lauyout, I'll convert it later to Arduino..

Share this post


Link to post
Share on other sites
23 hours ago, keverjeroen said:

I've bought some cables to connect the Mindstorms controller directly to the track. That's something I'm going to try with my current train layout!

Just be careful, I believe that Midstorms uses PWM to vary the voltage while the 9v train motors prefer pure DC. I did an RCX controlled layout long ago and afterwards the 9v motors did not seem too happy.

Share this post


Link to post
Share on other sites
On 26-9-2017 at 12:54 PM, zephyr1934 said:

Just be careful, I believe that Midstorms uses PWM to vary the voltage while the 9v train motors prefer pure DC. I did an RCX controlled layout long ago and afterwards the 9v motors did not seem too happy.

Ow I didn't know that. Good to know!

Share this post


Link to post
Share on other sites
On 26/9/2017 at 12:54 PM, zephyr1934 said:

Just be careful, I believe that Midstorms uses PWM to vary the voltage while the 9v train motors prefer pure DC. I did an RCX controlled layout long ago and afterwards the 9v motors did not seem too happy.

I was thinking og controlling a 12V trainmotor from a PF IR sensor (and only giving the motor max 9V). But does anybody know if the PF IR v2 smooth out the PWM, and/or if the 12V train motors can handle PWM. Else I should put a low pass filter between the two.

Share this post


Link to post
Share on other sites

I THINK the IR receivers are friendly to the 9v train motors since one of the repairs to a burned out 9v motor is to take a motor out of a PF train motor (search the form for details, a couple of people have posted good tutorials). I don't know about 12v though. The v2 IR receiver should be similar to the normal IR receiver. I THINK the primary difference is just that the v2 can deliver higher current per channel. Far more details than you can imagine about the IR receiver can be found here.

Share this post


Link to post
Share on other sites
On ‎26‎.‎09‎.‎2017 at 12:54 PM, zephyr1934 said:

Just be careful, I believe that Midstorms uses PWM to vary the voltage while the 9v train motors prefer pure DC. I did an RCX controlled layout long ago and afterwards the 9v motors did not seem too happy.

 

24 minutes ago, zephyr1934 said:

I THINK the IR receivers are friendly to the 9v train motors since one of the repairs to a burned out 9v motor is to take a motor out of a PF train motor (search the form for details, a couple of people have posted good tutorials). I don't know about 12v though. The v2 IR receiver should be similar to the normal IR receiver. I THINK the primary difference is just that the v2 can deliver higher current per channel. Far more details than you can imagine about the IR receiver can be found here.

Dear All,

I don't think that PWM does any harm to the 9V train motors. All LEGO PF, RCX, NXT, EV3 devices use PWM for motor torque/power control. For all motors. The #4548 power regulator does not; this one provides constant DC voltages on the individual dial settings. However, I did not experience any problems even when using PID control using PWM as the power source.

@zephyr1934 : Could it be that there were other issues you experienced, when you used the RCX? RCX PWM is tailored towards Technic mini motors (as they were available at that time) rather than 9V train motors. I am curious, as my trains partly run under RCX PWM control - so far - without problems.

Thanks a lot!

Thorsten 

Share this post


Link to post
Share on other sites

I am not sure why I thought the PF IR receiver is not PWM, but a quick search shows that it IS PWM. To which I must say "Duh!" at myself. Since the IR receivers are fine for the PF motors, then they should be fine for the 9v motors too. Aside from changing how the power gets to the motor there is not much different in the 9v and PF motors.

It has been a long time since I beat on the 9v train motors with the RCX, but perhaps my problem wasn't PWM per se. I may have stressed the motors by going from full-off to full-on instantaneously while pulling a heavy load too many times. With the tiny memory of the RCX there is not much room to step up power if you are doing a complicated movement... guess I should have used a subroutine (grin).

Share this post


Link to post
Share on other sites
11 hours ago, zephyr1934 said:

It has been a long time since I beat on the 9v train motors with the RCX, but perhaps my problem wasn't PWM per se. I may have stressed the motors by going from full-off to full-on instantaneously while pulling a heavy load too many times. With the tiny memory of the RCX there is not much room to step up power if you are doing a complicated movement... guess I should have used a subroutine (grin).

Hehe, yeap that could have fried them. 

But ... TINY MEMORY? On the RCX? That one is a memory monster:tongue: as compared to the Scout, which has space for 396 LEGO "freely programmable" byte codes. And still can accomplish some serious tasks.

And RobotC for the RCX - comes for free nowadays - has 100 power steps instead of 7. It is incredible, what an RCX (still) can do with RobotC. And with NQC. Will try to show that shortly.

OK, point really is: I love RCX', Scouts, Spybots and MicroScouts as much as other folks love the wonderful 12V train line. Both are gone, but both are still incredibly fascinating. I am just frustrated, when the programmable LEGO bricks just come and go.

Guess I am going off-topic here.

All the best,
Thorsten  

 

Share this post


Link to post
Share on other sites

You can probably put a capacitor between the two power lanes if you are worried by PWM. That should smooth the signal.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.