LEGO MindStorms – Stair Climber

This project is so funny and cool, we are controlling a robot which contain the cart and the lifting arm, so that it can climb stairs. Looks like a Mars rover!!

Features of the robot

Gyro Sensor – It is used to detect or reference the degrees that the project is tilting towards. If the object is tilting forward, then the numbers will be positive, it will be negative if it is tilting backwards. How do we use this gyro sensor in our robot? It can be used to set a limit on how much you should tilt. For example, you want your cart to tilt to -15 then stop and reset degrees counter, then the gyro sensor will come in handy because it detects how much the robot tilts.

Touch sensor – It is used to send signals when something goes in contact with it. In this stair climbing project, the touch sensor is used as a calibration. When the top part come in contact with the touch sensor, then it will reset the degrees counter and it will return to the straight form. Why is the calibration important? The calibration is used to limit how much the belt should go. If the belt goes over the limit, then the motor will malfunction or in worst scenario, even break the motor.

‘Little Fella’ – This little guy’s function is kind of confusing, I thought it was just a noise maker at first. This little guy’s function was unknown until we tested the project. When we tried our first run, we realize that the little guy has the function to stop the middle wheel from moving backwards. What a powerful little fella…

Calibration

This program is the calibration part. It is the most important part of the whole program, because we always need to check the limit and identify the zero point, so that it will not mess up the motor movement because of wrong degree number.

Moreover, we also identify the gyro sensor horizontal level and rest to zero when it sitting on the floor.

So what I did in this program is that I made the lifting arm go up until it presses the button, when it presses the button it will reset the degrees counted so that the top will be the zero point, then the lifting arm goes down by moving the motor clockwise by 2900 degrees. (we got it manually) then we reset the Gyro sensor since it is horizontal to the floor.

Stair Climber Movement concept

When the stair climber moves forward and hit the wall, the front wheel will make the cart going upward and result as tiling up. Once we detect tiling for a certain degree, we will activate the lifting arm to push the cart upwards until it reach the top of stair, we call this landing. Once the cart landed, it will be no longer tilting upward, i.e. no tilting or very small tilting. Then, we will collect the lifting arm to the top of stair and moving forward for the next climbing.

IMPORTANT! When we doing above action, we need to control the back wheel action carefully. If back wheel pushing too much, the cart will flip over because of the center of gravity changed.

How’s the program working?

  1. Check whether the gyro sensor detects tiling and if it is more than 15 degree, i.e. the forward wheel rotate against the wall and the head tilt up. If yes, it will start the lifting action 2.
  2. Determine if the cart landed or the lifting arm reach the max. Otherwise, keep the arm lifting action.
  3. We need to balance the speed of the wheels. If we make the back wheel too fast, the cart will flip over while going up the stairs. If the back wheel goes too slow, the cart will be too slow for the landing and it will be stuck at the edge of the stairs. We also need to make the front wheel rotating speed synchronized to the lifting arm speed.
  4. We have to balance the cart if it is tilting so much like it is going to fall. We have to stop the back wheel so that the cart will not keep moving forward, i.e. change the center of gravity. So, we stop the back wheel for a certain tilting angle that the cart may flip over.
  5. We need to stop the wheels before the lifting arm move up or else the lifting arm is going to snap. After stopping the wheels, we pull the lifting arm back up to the original place. Then, the stair climber keep going for next stair.

Build instruction and the program

We created the program from scratch without referring any example, you can download from below.

LEGO Offical build instruction

I also attached the link for LEGO EV3 Classroom for your quick reference, click here.

15 thoughts on “LEGO MindStorms – Stair Climber

  1. Congratulations, this is a great project…my son love it but we have two questions: the program is used looks like scratch ?? Our ev3 use it’s own block programming software and looks different ,,,
    Secondly, do you have instructions to build the robots as your pictures show ?
    Thank you

    1. Thanks! My sons like this project and enjoy much.

      Recently, LEGO changed the programming method from the very difficult block into scratch like and even with Python, it make the world much easier and happier. You need to download the new program editor.

      Please check this link for the build instruction, it’s actually official from LEGO – https://education.lego.com/v3/assets/blt293eea581807678a/blt37ca3874f333f89e/5f880425a302dc0d859a736b/ev3-model-expansion-set-stair-climber.pdf

      Enjoy!

  2. Good day, a very nice project! I am working since quite a while on it, using Lego pdf. programm-code- but it is still not working as it is designed to.
    If I want to use your program (the climber.7z-file), what exatly to I have to? You mentioned above a program editor…which one is that?

    Are you using EV3 Micro Python and Windows Visual studio code?

    Many thanks for any help:-)
    Tom

      1. Hi Molex, thank you for your reply! I have the EV3 Claasroom App installed, but how can I import your program there and transfer it to the EV3 stone?

        Thanks!

        1. Hi Thomas,

          First of all, you need to un-zip the file by using 7-zip, you will get “Stair-Climer.lmsp”. Then, connect your EV3 Classroom App to the EV3 stone via USB or Bluetooth. Once connected, open the file, upload and run. I would recommend you connect via bluetooth, it make you easier to fine tune the program. Please let me know with additional question or help on the fine tune.

          Thanks,
          Molex

  3. Hi Molex- I have try a lot of times now and I get 4 out of 5 times that the climber tips over his back (meaning: towards the chain-“elevator”.

    The climber “thinks”, it has already landed and the lifting arm moves already (to soon) up again.

    Any ideas?

    I have tried to change the variables of the gyro, but no success…

    I could send you a video on WhatsApp if you accept?

    Thank you again for your patience!

    1. Hi Thomas,

      First of all, I believe that the stair climber is calibrated, sitting on a plain floor prior gyro sensor reset to zero, right? Second, there is height limit for the climber to climb. Since I have disassembled the stair climber, cannot measure, but not recommend more than 18cm. You may stack some boxes and let it try first.

      For program step 3.

      Adjust the tile angle to confirm the cart ‘landing’ onto the stair is the right approach. You can also do some adjustment before getting into step 5, may let the cart move forward a bit prior collect the rising arm. But if the touch sensor was pressed, the stair may be too high for the climber. Actually, you can increase the length of the lifting arm if it is the case.

      Feel free to send me the video via my email – molex.bversion.com.

      Thanks!
      Molex

      1. Thanks Molex, I am working on it:-)

        Can you please confirm your email adress? Is there no “@” sign?
        Thanks!

          1. Hi Thomas,

            Once you make it, it will be great if you can share the video with me.

            Thanks,
            Molex

Leave a Reply to Thomas Müller Cancel reply

Your email address will not be published. Required fields are marked *