Sign in to follow this  
Hanso

[EV3]Train controlled by Mindstorms EV3 for large, fully automated train layout

Recommended Posts

The last years, we have used a NXT brick for controlling the train. For Lego World 2017, we want to use EV3 bricks only. Since the RFID sensor is not supported anymore, we needed another way to determine the train location.

30570620511_986d93c8e9_c.jpg

I have build a proof of concept of a loco:

  • Wheels are directly connected to a EV3 medium motor
  • Location detection based on a color sensor (the combination of yellow, red and green makes a unique pattern)

And it works fine! A video of this proof of concept:

Of course, the train needs a bit (... ) of restyling ;-)

Enjoy,
Hans

Edited by Hanso

Share this post


Link to post
Share on other sites

Great idea! We also did this but then we controlled it using Arduino's (project for primary school teachers that my high school students worked on). I think tiles are better to see though :)

Share this post


Link to post
Share on other sites
2 hours ago, JopieK said:

Great idea! We also did this but then we controlled it using Arduino's (project for primary school teachers that my high school students worked on). I think tiles are better to see though :)

One of the constraints that we use, is that we don't allow ourselves to use non-Lego stuff. The only exception that we made so far, is the use of licensed sensors (Codatex and HiTechnic). But it seems that we don't need that exception anymore.

And yes, I know that we're sometimes making live more difficult that necessary ;-)

/Hans

Share this post


Link to post
Share on other sites

Well in a school one has different goals and necessities of course but it is a noble idea to keep it all LEGO. I visited the LEGO Mindstorms area at LEGOWorld this year. Nice setup also helping kids to appreciate it. In a few weeks the First LEGO League in our region is up and will be a referee for two days then again ;)

Share this post


Link to post
Share on other sites

I have made in LDD an impression how the new train is going to look like (or something like this):

31702442725_ef04154bd5_c.jpg

 

31556212262_1eca8e4e0a_c.jpg

The color sensor is now place off-center, meaning that the colored pieces need to be put at the right side of the track. This has the advantage, that - if the train is driving the other way - it will not read these commands backwards.

Enjoy,
Hans

Edited by Hanso

Share this post


Link to post
Share on other sites

Just finished LDD building the trains that will run at Lego World 2017. Since there will be two trains, I made a new artist impression and this is how I want the trains to look like. The colors will be Dark Blue and Dark Red. Not that simple to find the elements for reasonable prices (e.g. one dark blue plate 2x6 would cost 6 euro, I replaced it with two 1x6 plates that I have myself).

31847336146_ae769b0293_c.jpg

Enjoy, Hans

Share this post


Link to post
Share on other sites
7 hours ago, RohanBeckett said:

Go for a vintage 1980's 7740 Red and Yellow! 

or.. since you're from .nl    maybe something in Orange? :)

Orange would be great, since that is not only the color of our country but also from the company. But the needed pieces do not exist in that color and I find the dark red / dark blue more distinguished. Also very important for a train ;-)

The other company color of our mathematical department is called LIME (Laboratory of Industrial Mathematics Eindhoven) and they use (of course) the lime color for the company. So, the best color of the trains would be orange and lime. It would look like this:

Lego train controlled by Mindstorms EV3 (LDD)

Thanks.

/Hans

Edited by Hanso

Share this post


Link to post
Share on other sites

The Sioux.NET on Track team wishes you all the best for 2017.

Enjoy,
Hans

Share this post


Link to post
Share on other sites

Finally received the Lego pieces. This is the result how it looks in real (click on the pictures to beam yourself to our Flickr page):

31783916450_449b6ec691_c.jpg

31783917390_25fe963a80_c.jpg

32010401232_177ecf4556_c.jpg

Enjoy, Hans

 

Edited by Hanso

Share this post


Link to post
Share on other sites

You can watch a short video with a test run of the Lego trains driven by a Mindstorms EV3. During the test, I found out two things:

  • The gear ratio is wrong
  • The bogies are not strong enough

Gear ratio

When I designed and build the locomotives, the gears looked like this:

31981556733_aac04d3288_z.jpg

But even on a motor speed of 90, the train was moving forward slower than a disabled turtle. Apart from the train speed, a high motor speed means also a high power consumption.

Switching the gears did the trick:

31981556773_279a4b4708_z.jpg

Sometimes, a solution can be so simple ...

Bogies

The bogies are designed like this:

32755428246_dc723a5b34_z.jpg

In principle, they work fine. However, if the train speed should increase, the torque on the gears is sometimes too much. Resulting in a middle part coming loose from the bogie:

31981555313_204b3cfecd_z.jpg

I have looked for a piece that would fit in between, but cannot find another brick than the new element 27940 (so, if you have a better suggestion please let me know):

27940.t2.png

If I put this element in between, I hope that it will hold the middle section in place (marked red):

31981554873_b32074f3af_z.jpg

I have ordered them at the Lego site, it normally takes 2 - 3 weeks (!) to arrive. I will let you know later if it works.

 

A video of the train test, can be watched on Youtube:

In the video, the train speed is set to 40 (out of 100) with the new gear ratio. I will add some more bricks (= weight) inside the front part of the train to get more traction on the wheels. The train has run for more than an hour without any problems. I didn't have the idea that the train speed dropped too much, the battery indicator was still on 'fully charged'. In a second test I will measure the time for each round to see how the train speed drops (when and how fast).

I'll keep you posted.

Enjoy, Hans

Edited by Hanso

Share this post


Link to post
Share on other sites

Yesterday, I wrote a new test program to see how the speed will drop when the battery gets empty.

The test program keeps the train running, getting a 4 second break at the yellow mark and measures the time for a full round (including the break):

32024313994_30e5992403_c.jpg

The locomotive doesn't have enough traction, so I added some weight (approx 200 gram) on the front of the locomotive so the wheels have more traction. Of course, I will need to solve this problem.

I started the test with a full battery. After 90 minutes of continuously driving, the battery was almost completely dry:

32024314294_f16b732dc8_c.jpg

I downloaded the file to my PC and calculated the time for each round. At the start, the train needed about 24 seconds for a full round (including the break of 4 seconds). At the end, the same full round took the train 8 seconds more. In the picture below you can see all the data plotted in a graph:

32052506003_94e6ee83c2_c.jpg

Everything together can be viewed in a small Youtube video:

So, what have I learned:

  • I need to add weight to the front of the train to get more traction or redesign the train that it will be more balanced.
  • Since the train won't be driving continuously, I expect that a full battery can be used in a train for 2 hours, maybe 2,5 hours.
  • At Lego World, we need to have a spare battery since the train should run from 10:00 am until 5:00 pm (= 7 hours in total)

If you have any suggestions to make, please drop me a note.

/Hans

Edited by Hanso

Share this post


Link to post
Share on other sites
2 hours ago, RohanBeckett said:

Looks good!

would this piece help?

6585.png

http://www.bricklink.com/v2/catalog/catalogitem.page?P=6585#T=C

what direction is the most force happening, that drives the gears apart?

Dear RohanBeckett,

Thank you for your suggestion. I have now used the 87082 element to keep the middle section in place:

4560175.jpg

That works fine. But your element is even better, I will order a couple of them.

Do you have any suggestions for me for the traction problem?

Regards,
Hans

Share this post


Link to post
Share on other sites

I'll have a play tonight with some of my parts, and see what I can come up with.

have you tried using a PF train motor bogie with NXT?

either homebrewing a cable: http://www.bartneck.de/2015/06/01/building-instructions-for-a-cable-that-connects-lego-power-functions-pf-with-mindstorms-nxtev3/

or with this: http://www.bricklink.com/v2/catalog/catalogitem.page?P=x1676#T=C&C=11  and a regular PF extension cable?

Share this post


Link to post
Share on other sites

I would agree using a PF train motor with the NXT above it as weight for traction can yield better performance.

To keep gears from popping off some of my train's drive train, I have used half bushes.

pacer6.jpg

Share this post


Link to post
Share on other sites

Until 2016, the train was a PF powered train and a NXT + HiTechnic IRLink to control it. The NXT was connected using Bluetooth with the PC application. Everything works fine, but the BT connection was quite unreliable.

17698987399_c1143a47ba_c.jpg

 

Therefore, we decided to switch to a EV3 powered train for Lego World 2017.

Although I really appreciate the suggestions for the PF + NXT, this is not the direction that we want to go to.

/Hans

Share this post


Link to post
Share on other sites

Instead of adding weight to the train, I decided to add traction by means of an extra powered axle. The train has therefore been extended to an articulated version.

32896396020_088ab9950f_c.jpg

The first three axles of the locomotive are powered:

33279417695_a689da89ef_c.jpg

And this is how the real versions look like:

33140772241_7a993083e7_c.jpg

 

On 13-2-2017 at 3:47 AM, RohanBeckett said:

Looks good!

would this piece help?

6585.png

http://www.bricklink.com/v2/catalog/catalogitem.page?P=6585#T=C

what direction is the most force happening, that drives the gears apart?

And by the way, I now use the elements as advised by RohanBeckett to make the bogies much stronger. Thanks again for the tip.

/Hans

Edited by Hanso

Share this post


Link to post
Share on other sites

good work! I'm amazed that you're persisting with the NXT motor, and mechanical linkages!  I would have just modified a regular PF train motor!!

If you're running all day, I'd definitely recommend putting a squirt of silicon spray on all the axle/bearing holes.. (and this comes from a few years of running GBC's!)

Share this post


Link to post
Share on other sites

Thanks for the compliment. I assume that you mean "with the EV3 motor", it is not a NXT motor. And yes, one of the goals of our project is that we forbid ourselves to modify any Lego parts. The thinking behind this, is that in our "real projects", you also have to face these kind of challenges and that we are restricted to specific hardware because of the costs.

Apart from silicon spray, we definitely need an extra pair of rechargeable batteries ;-)

Hans

Share this post


Link to post
Share on other sites

I tested the extended loco in a durability test. Started with a fully charged battery, the train ran for 3 hours and 45 minutes. Better than I expected.

A full round took at the start 22,3 seconds and at the end 27,1 seconds (including a 4 second break at the yellow marker). So, the train speed is quite constant.

A video of the test can be viewed on Youtube:

 

Please note that the color sensor has been placed under an angle. If not, it would read the colors correctly. I used two bars (4L, id 30374) to achieve this angle.

4211628.jpg

Enjoy,
Hans

Edited by Hanso

Share this post


Link to post
Share on other sites
9 hours ago, KikoTube said:

Looks good and has also great functions

Thanks, KikoTube.

Share this post


Link to post
Share on other sites
On 6-3-2017 at 10:30 AM, RohanBeckett said:

good work! I'm amazed that you're persisting with the NXT motor, and mechanical linkages!  I would have just modified a regular PF train motor!!

If you're running all day, I'd definitely recommend putting a squirt of silicon spray on all the axle/bearing holes.. (and this comes from a few years of running GBC's!)

RohanBeckett was right. Doubling the number of driven wheels, also increased the number of gears and therefore the friction. With four wagons attached, the train did run but you cannot say it was a smooth ride. So, I decided to use the regular train motor 88002. Persistence may be good, but having an open mind is even better ;-)

8866-0000-xx-12-1.jpg

As a team we decided to use existing Lego parts only (with the only exception for Mindstorms sensors from other suppliers). Meaning: how to control this 88002 PF motor by an EV3 without altering anything? The solution is simple: the rechargeable battery box 8878 has a power control dial (see photo below). If you connect this dial to an EV3 motor, you can simply control the speed.

8878_1_eng.jpg

The first prototype looks like this:

34221899995_43331580c0_c.jpg

33837737150_f24e666a17_c.jpg

This concept works really fine. As you can see at the right of the previous photo, two PF motors 88002 are connected to the battery box. Both the front and the rear bogie are now powered, giving the locomotive enough momentum to pull the four wagons and run smoothly through the curves.

A video of the working train can be viewed on Youtube:

 

As you can see in the photos as well, it wouldn't be possible to recharge the battery. There is simply no room for the power plug. Since this functionality is also mandatory, I made a second concept. The principle is the same, but now with a little room to insert the power plug.

33865368060_1eb792db42_c.jpg

Enjoy,
Hans

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.