Author Topic: Lego mindstorms-what to do?  (Read 15762 times)

0 Members and 1 Guest are viewing this topic.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #15 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.
« Last Edit: February 21, 2011, 03:19:50 pm by fb39ca4 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lego mindstorms-what to do?
« Reply #16 on: February 21, 2011, 03:23:44 pm »
Good luck fb39ca4!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #17 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 :)

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #18 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.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #19 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.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #20 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.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #21 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
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lego mindstorms-what to do?
« Reply #22 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

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #23 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.

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: Lego mindstorms-what to do?
« Reply #24 on: February 26, 2011, 03:49:17 pm »
Aren't there blocks to detect how much it's tilted?
Vy'o'us pleorsdti thl'e gjaemue

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #25 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

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Lego mindstorms-what to do?
« Reply #26 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.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Lego mindstorms-what to do?
« Reply #27 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

Offline nxtboy III

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 795
  • Rating: +26/-1
  • NXT!
    • View Profile
    • Program NXT
Re: Lego mindstorms-what to do?
« Reply #28 on: February 21, 2012, 08:28:54 pm »
You could make an NXT game (might be too advanced).

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Lego mindstorms-what to do?
« Reply #29 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 :)
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES: