Omnimaga

General Discussion => Technology and Development => Other => Topic started by: fb39ca4 on February 20, 2011, 08:47:53 pm

Title: Lego mindstorms-what to do?
Post by: fb39ca4 on February 20, 2011, 08:47:53 pm
For a couple of years now, I have had a Lego mindstorms robotics set. However, the infrared transmitter for sending programs to the robot is broken, and I have Not been able to use it until now, when my friend gave me a transmitter he doesn't use anymore. Now that I can use it, could some one suggest to me a challengeing task I could get a robot to do?
Title: Re: Lego mindstorms-what to do?
Post by: DJ Omnimaga on February 20, 2011, 08:50:04 pm
Programming a calculator game.

But seriously I don't have any clue. I unfortunately never had the chance to get a robot-type lego set back then, because my mom didn't want to spend money on batteries and stuff, and I don't know about new sets since I mostly played LEGO's around 1990-99 (Yay for Dark Knights and Blacktrons!)
Title: Re: Lego mindstorms-what to do?
Post by: Builderboy on February 20, 2011, 09:05:20 pm
You are in luck :) I actually was *introduced* to the whole concept of programming by Lego Mindstorms.  Some good exercises when you are starting out is building a little car that moves forwards and then backs up and turns if it runs into something.
Title: Re: Lego mindstorms-what to do?
Post by: thepenguin77 on February 20, 2011, 09:17:29 pm
If you want a real challenge. (Depends on how good you are at it.) You could try to make a segway. I've seen it done so I know it's possible.
Title: Re: Lego mindstorms-what to do?
Post by: Builderboy on February 20, 2011, 10:08:14 pm
A line following segway :P
Title: Re: Lego mindstorms-what to do?
Post by: jnesselr on February 20, 2011, 10:09:55 pm
Let's see, I'm assuming you are talking about those old RCX ones.  Personally, I have the NXT, but I would try and get it to talk to your calc over infrared.  Either that, or it's a 2 wire interface, I think (One is probably a safe bet to be ground) in which case, splice one of the cables, and talk to it via the link port.  That is assuming the RCX can talk via pull-up resistors, I'm not too sure about that part.
Title: Re: Lego mindstorms-what to do?
Post by: Silver Shadow on February 20, 2011, 10:23:34 pm
Make a line-following robot. ;D
Title: Re: Lego mindstorms-what to do?
Post by: Juju on February 20, 2011, 10:24:06 pm
I had a course at school called "LEGO Blocks and Robotics" that used RCX sets. We were in teams of two (I was with my mom, somehow) and we had to make a bipedal walking robot. Of course, at first, the robot kept falling, but at the end it walked a good distance without falling and I had 100%. So, IMHO, that's a good challenge :)
Title: Re: Lego mindstorms-what to do?
Post by: Darl181 on February 20, 2011, 10:26:58 pm
All I had was this cheap "micro scout" thing, with only an infrared sensor and a single output motor :P  So I wasn't able to do much with it...
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 20, 2011, 10:35:42 pm
I actually have a micro scout too. I wonder if I could use the infrared link and make it a third motor. It would sure be bulky, though.

The Segway seems like a really good idea, except I don't know how I would get the robot to detect how much it is tilted.
Title: Re: Lego mindstorms-what to do?
Post by: Darl181 on February 20, 2011, 10:39:24 pm
I also have a spybotics (the purple one) but one of the wheel motors retired, so I haven't touched it in years :P
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 20, 2011, 11:24:33 pm
Please don't even try to suggest something like this to me.
[ Invalid YouTube link ]
Title: Re: Lego mindstorms-what to do?
Post by: leafy on February 20, 2011, 11:25:06 pm
Didn't they make a lego robot a while back that could make more lego robots?
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 21, 2011, 11:13:49 am
I've decided to try making a Segway robot. I've just built the actual robot, but I am waiting for my mom to finish using the computer so I can program it. Once it works, I will get a video up of it running. I may try to get the robot to turn, as well.
Title: Re: Lego mindstorms-what to do?
Post by: Builderboy on February 21, 2011, 01:00:35 pm
All I have to say is good luck :) A segway might be one of the harder things you could choose to build and program, but I really hope you get it working :)
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 21, 2011, 03:19:17 pm
Programming it is a challenge. I think i've wrapped my head around pid control loops, but the default bytecode used to program the rcx is too slow (think TI-BASIC slow), so I'm going to have to figure out how to get C working on the brick.
Title: Re: Lego mindstorms-what to do?
Post by: DJ Omnimaga on February 21, 2011, 03:23:44 pm
Good luck fb39ca4!
Title: Re: Lego mindstorms-what to do?
Post by: Builderboy on February 21, 2011, 04:34:21 pm
For the RCX, you can use NQC, which is a C like language that runs very quickly and has a lot of useful features :)
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 21, 2011, 08:52:41 pm
I've already tried that. Nqc is just compiled to the same byte code as the Lego software, and as the interpreter on the Default rcx firmware is slow (for what I need) Nqc is also slow. However, I'm running true c code now, with the brickos firmware. It is much faster, like the difference between TI-BASIC and asm.
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 23, 2011, 10:35:35 pm
It works! :w00t: :w00t: :w00t: :w00t: :w00t:

It is programmed in c, as the default firmware only allows for interpreted programs, which would mean the robot wouldn't react fast enough. However, there is still more work to be done on this, as the robot can not move around, if I try to poke it, it falls down. I might also add turning later on.

Oh yeah, sorry the video is in portrait, I forgot to turn my itouch sideways when I took the video.
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 24, 2011, 02:49:36 pm
Can someone help me wrap my head around the I and D parts of PID loops? I haven't taken calculus yet, so I don't know what integrals and derivatives are.
Title: Re: Lego mindstorms-what to do?
Post by: ruler501 on February 24, 2011, 05:40:56 pm
a derivative is calculating the slope of a function at any point
an integral is calculating the area under a function
Title: Re: Lego mindstorms-what to do?
Post by: DJ Omnimaga on February 26, 2011, 02:13:51 pm
Nice fb39ca4. I think it definitively needs something to hold it so it won't always fall, though. :P
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 26, 2011, 03:35:27 pm
Nice fb39ca4. I think it definitively needs something to hold it so it won't always fall, though. :P
Well, the whole point of this was to make something that balanced on its own. My robot depends on the light sensor (the blue brick on the front of the robot) for determining how much it is tilted, and when I waved my finger under the sensor, it affected the values, making the calculated angle inaccurate, so it fell.
Title: Re: Lego mindstorms-what to do?
Post by: Darl181 on February 26, 2011, 03:49:17 pm
Aren't there blocks to detect how much it's tilted?
Title: Re: Lego mindstorms-what to do?
Post by: Builderboy on February 26, 2011, 03:52:45 pm
There might be, but i have a hunch that they won't be as accurate or as quick to respond as the light sensor.  Also, fb39ca4, I am no expert in making the robot move forward, but i think as long as you move them slow enough, if you just run the motors forward in small incremented each loop, you can move forward without a hitch
Title: Re: Lego mindstorms-what to do?
Post by: fb39ca4 on February 26, 2011, 05:46:03 pm
Aren't there blocks to detect how much it's tilted?
Lego doesn't make any, but they can be custom built. However, I don't have any, so I'm making do with the light sensor. Someone made a very nice robot that balances in two axes, on a ball, with a gyroscope senso, but I don't have that kind of stuff.
Title: Re: Lego mindstorms-what to do?
Post by: DJ Omnimaga on February 28, 2011, 01:10:35 am
Nice fb39ca4. I think it definitively needs something to hold it so it won't always fall, though. :P
Well, the whole point of this was to make something that balanced on its own. My robot depends on the light sensor (the blue brick on the front of the robot) for determining how much it is tilted, and when I waved my finger under the sensor, it affected the values, making the calculated angle inaccurate, so it fell.
Oh right I see now, lol. That will make it even better. :D
Title: Re: Lego mindstorms-what to do?
Post by: nxtboy III on February 21, 2012, 08:28:54 pm
You could make an NXT game (might be too advanced).
Title: Re: Lego mindstorms-what to do?
Post by: saintrunner on February 21, 2012, 08:36:21 pm
You could make an NXT game (might be too advanced).

^^ check out nxtboys game O.O I see a future in NXT games :)
Title: Re: Lego mindstorms-what to do?
Post by: nxtboy III on February 21, 2012, 08:46:01 pm
Haha, thanks. :)