Jump to content




How to program your coasters with NXT 2.0


  • Please log in to reply
24 replies to this topic

#1 Sniggeh

Sniggeh

    Lead Engineer

  • 1511 posts

Posted 11 January 2011 - 04:20 PM

Okay, I just recently got Lego Mindstorms NXT 2.0, and I wanted to make a tutorial on how to program you coasters with it so they can run automatically.

Step 1: The Lift

You will want to create a new program and select Complete Pallet, Common, then Move.
Posted Image

Here is the program close-up:
Posted Image

You are then going to want to create a block so it is simpler to look at:
Posted Image

Here is what you should have after this:
Posted Image

Step 2: The circuit

You will then want to go to Flow and pull out a Wait block. Set the time to however long your circuit will be until the final breaks:
Posted Image

Step 3: The Cycle

Then you will want to go to Action, then bring out three motor blocks and one wait block:
Posted Image

First Block: (This will be the brake run)
Posted Image

Second: (This will be the station. Just make it run for as long as you want the train to pull in to the station. The train will then stop at the gates if you want it to)
Posted Image

Wait block: (Just as long as you want the train to stay in the station)
Posted Image

Third: (Just until the train finishes exiting the station)
Posted Image

Then create a block with all of those:
Posted Image

Then put a loop box around them:
Posted Image
(Do this by highlighting everything, putting a loop block into the beginning of the program, then dragging everything into the block)


Please Comment!

.

Posted Image


#2 Jumpge

Jumpge

    Stopping by every now and then!

  • 3930 posts

Posted 11 January 2011 - 04:29 PM

Very god program for all of the newbies that got NXT for their coaster! Very nice tutorial and very helpful! I had a hard time putting a loop on the program the first them I used this.

Posted Image


#3 Maxlaam

Maxlaam

    Tracing Tyrant's Steps

  • 8116 posts

Posted 11 January 2011 - 04:53 PM

Doesn't mindstorms have sensors that would be able to detect the train? Using a wait is very inaccurate.


SSCoasters Administrator
Read The Forum Rules(smart)

Posted Image
Posted ImagePosted Image


#4 ForgotToGrowUp

ForgotToGrowUp

    Lead Engineer

  • 1732 posts

Posted 11 January 2011 - 04:54 PM

Hey guys, I am not familiar with lego mindstorms. Can you point me to a coaster link that shows this system in action? I am curious about it.

(programming things comes easy to me, been doing it in different forms for 40 years)

Comet Recreation still underway.

Proof you never grow up if you keep playing with toys!


#5 Maxlaam

Maxlaam

    Tracing Tyrant's Steps

  • 8116 posts

Posted 11 January 2011 - 05:02 PM

Invertigo - SSCoasters Rides Database


SSCoasters Administrator
Read The Forum Rules(smart)

Posted Image
Posted ImagePosted Image


#6 Sniggeh

Sniggeh

    Lead Engineer

  • 1511 posts

Posted 11 January 2011 - 05:24 PM

Very god program for all of the newbies that got NXT for their coaster! Very nice tutorial and very helpful! I had a hard time putting a loop on the program the first them I used this.


Thanks! I'm glad you like this!

Doesn't mindstorms have sensors that would be able to detect the train? Using a wait is very inaccurate.


Yes, this was just for a very simple coaster. I'll be updating this tomorrow with the touch sensor programming.

.

Posted Image


#7 pkiknex25

pkiknex25

    Ello!!!

  • 8238 posts

Posted 11 January 2011 - 05:32 PM

I'd love to use this! If only the intelligent brick wasn't so damn expensive.

SSCoasters Staff
The SSCoasters Forum Rules

cincinnatibearcats07sp-1.jpg

GigaSonic XLC, Déjà Vu, Werewolf, WildSide, Thunderhawk, Kaibutsu, Diamondback, Couloir

SVengeance|Voyage|LightningRod|Goliath(SFGAm)|OutlawRun|Fury325|RF2|Taron|StormChaser|Orion|

Coaster Count: 300


#8 RCExtreme

RCExtreme

    Entry Engineer

  • 851 posts

Posted 11 January 2011 - 10:06 PM

O.o Wow, that looks confusing.

Actually, now that I look more carefully at it, it makes sense. My dad has thought about getting me the Mindstorms, but it's too expensive.


#9 Knexrule11

Knexrule11

    Sferico's President

  • 4456 posts

Posted 11 January 2011 - 10:17 PM

I have a NXT, but I need to have a coaster to install it on. Maybe I'll have one sometime soon.

This is a great tutorial, it will sure help me if I do it.

:ph34r: SSCoasters Moderator :ph34r:
Fear the Bankatana | The SSCoasters Forum Rules

MySSCoasterssig.png
SfericoUserbar-1.png
Maverick|Tatsu|TTD|Fahrenheit|Skyrush|MF|Cheetah Hunt|Storm Runner|SheiKra|Montu
Coaster Count: 102


#10 ~stεεlspectrum~

~stεεlspectrum~

    You ready to ride the Fist O' Pain?

  • 7526 posts

Posted 11 January 2011 - 10:37 PM

The Mindstorms is incredibly simple to program, it's just that connecting the motors to Knex is sometimes an issue. I almost always use the NXT motors to switch other motors on/off; that way you can have stronger motors and preserve the NXT's battery life longer.


#11 floris2burn

floris2burn

    Software Engineer

  • 414 posts

Posted 12 January 2011 - 10:14 AM

The Mindstorms is incredibly simple to program, it's just that connecting the motors to Knex is sometimes an issue. I almost always use the NXT motors to switch other motors on/off; that way you can have stronger motors and preserve the NXT's battery life longer.


Looks like a simple solution :)

And yeah, one of those controllers is really expensive, but what I spent on electronics is already higher then one of those controllers XD


#12 Sniggeh

Sniggeh

    Lead Engineer

  • 1511 posts

Posted 15 January 2011 - 11:47 AM

Sorry for the long wait, I have strep throat.

In this post I will show you how to make a trigger system attached to the touch sensor. Programming part should come soon.

What you will be making:
Posted Image

Posted Image

Posted Image

Parts:
Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Make these:
Posted Image

Make these:
Posted Image

Attach like so:
Posted Image

Build and attach these:
Posted Image

Posted Image

Attach a green rod:
Posted Image

Add these on to the ladder piece:
Posted Image

Build this with Mindstorms:
Posted Image

Attach the second rod:
Posted Image

Add these:
Posted Image

Tape the sections together like this:
Posted Image

Now attach this to you station/brake run like this:
Posted Image

Posted Image


Programming part should be coming soon!

.

Posted Image


#13 LaMbChOpZ

LaMbChOpZ

    Lead Particle Physicist and Musical Orchestrator

  • 2812 posts

Posted 15 January 2011 - 01:40 PM

This is awesome!!! i just wish i had NXT... :/

Member of a few physics experiments; Orchestrator and/or Copyist for a few musicals.


#14 ~stεεlspectrum~

~stεεlspectrum~

    You ready to ride the Fist O' Pain?

  • 7526 posts

Posted 15 January 2011 - 01:52 PM

That's pretty cool, I've never used the touch sensor like that before. I have one question--how much does it slow down the train?


#15 Sniggeh

Sniggeh

    Lead Engineer

  • 1511 posts

Posted 15 January 2011 - 01:54 PM

That's pretty cool, I've never used the touch sensor like that before. I have one question--how much does it slow down the train?


I'm not sure yet, but if you're using it near a station or brake run I don't think that it would matter much.

.

Posted Image


#16 LaMbChOpZ

LaMbChOpZ

    Lead Particle Physicist and Musical Orchestrator

  • 2812 posts

Posted 15 January 2011 - 02:20 PM

^well it also looks like the automatic station gates, and those dont slow it down much, so i wouldn't think that it would slow it down a ton.

Member of a few physics experiments; Orchestrator and/or Copyist for a few musicals.


#17 Maxlaam

Maxlaam

    Tracing Tyrant's Steps

  • 8116 posts

Posted 15 January 2011 - 02:24 PM

I'm not sure yet, but if you're using it near a station or brake run I don't think that it would matter much.


Doesn't mindstorms have light and colour sensors? Those would be better imho.

However Project Phase also relies on physical switches, however those are so small they barely give any resistance.


SSCoasters Administrator
Read The Forum Rules(smart)

Posted Image
Posted ImagePosted Image


#18 Sniggeh

Sniggeh

    Lead Engineer

  • 1511 posts

Posted 15 January 2011 - 02:27 PM

Doesn't mindstorms have light and colour sensors?


Yes, but that will be added into this thread using the ultrasonic sensor.

.

Posted Image


#19 Maxlaam

Maxlaam

    Tracing Tyrant's Steps

  • 8116 posts

Posted 15 January 2011 - 02:32 PM

Not entirely sure how fast the update rate of those sensors are, especially the ultrasonic sensor. But you could use that to align your train in the station using some easy variables. that would be awesome and is the only thing I really hate about Project Phase atm. I rely on using delays that come down to the milliseconds.


SSCoasters Administrator
Read The Forum Rules(smart)

Posted Image
Posted ImagePosted Image


#20 scott

scott

    Architect

  • 566 posts

Posted 31 January 2011 - 10:05 AM

perhaps use the light sense thing to detect the train to make it go?

Skype: ksbf113
Steam: rodimus113
MC and XBL: rodimuz
PC:
amd a4-3420, r5 230, 8gb ddr3 1333