EV3 Puppy, retail edition

I wanted to make an EV3 tamagotchi with a friend, but after various experiments I found the Puppy that comes with the EV3 education set, which is way cuter than anything we designed so far. But the education version contains different parts than the retail version, so we could not build that one.

So I sat down to create a puppy with the parts from the retail edition of the EV3. The end results looks very similar, but the construction is quite different in places.

The only functional difference is that I did not add the touch sensor and added the infrared sensor instead. So you can’t pet this puppy, but it can detect when you’re near and track the beacon with its eyes.

Other than that it’s mostly the same as the educational version. It can tilt its head up and down, stand up and sit down, pee and display different emotions.

The code I wrote so far is only a dozen lines of Python, which I might upload later. The good news is that due to the Christmas holiday, I had time to make some nice building instructions, check them out!

Download building instructions

EV3 Mars Rover

I have tried before to make a Rocker-Bogie robot, similar to NASA’s Mars rovers. But with the NXT I always had a shortage of structural parts, leading to incomplete and unstable constructions.

With the EV3 it works surprisingly well, and I was able to power all the wheels with two motors, and leave enough parts to make a robotic arm.

It looks lovely, and the principle works, but the actual capabilities are slightly disappointing as the torque is very limited. Climbing any large obstacles pushes the bogie off the ground and rattles some of the many gears.

CD spinner

I know this is a rather silly robot. It does nothing at all, and it’s not very beautiful either. I guess I just want to remind you that it’s important to just play without expectations or goals.

According to John Cleese, it is very useful to attempt something impossible sometimes. This often puts your mind in a new perspective, leading to new ideas.

Reading a CD with a light sensor is obviously not going to work, but maybe there are other ways to read data with the EV3?

EV3 Sumo Robot

After a long period of silence, I finally made some things with my EV3. Last time the tools where not really ready, but now everything works great.

I used ev3dev and python-ev3 to build this bulldozer. Watching sumo matches at LEGO World, I saw a few things that do and don’t work.

A lot of people seem to go for blades and hammers, but unless you actually want to destroy the robot, they are useless. Treads sound like a good idea, but wheels have more grip in practice. Make sure the wheels don’t fall off. Encased wheels are the best.

The goal is to push the other robot off the table, so the more powered rubber the better. Four wheel drive is better than rear wheel drive, but rear wheel drive is still much better than front wheel drive.

It’s all about pushing. The only useful thing besides pushing forward is pushing up or sideways. Pushing up is the easiest, because you have the floor to back you up. It also pushes the opponent’s wheels off the ground. This lead me to the following design.

I used two pairs of driven rear wheels on a pivot, so even if I’m lifted, all four remain in contact with the ground. They are geared down, which means I’m slow, but powerful. All the weight of the motors and EV3 is directly above the wheel, for maximum grip.

On the front there is a lift arm, using a worm wheel and a very solid construction. I went through several iterations, improving the strength each time. On the first iteration, it was to weak, but its wedge shape still lifted my opponent a little.

The code is quite simple. Push forward. When you reach the edge, turn around. When something hits the bumper, raise the arm.

from ev3 import lego
import time
import select
import os

# Utility for waiting on the motor.
p = select.poll()
callbacks = {}

def poll():
    for fd, mask in p.poll(0):
        os.lseek(fd, 0, os.SEEK_SET)
        state = os.read(fd, 16)
        if state == "idle\n":
            p.unregister(fd)
            os.close(fd)
            callbacks.pop(fd)()

def on_completion(motor, callback):
    fd = os.open(motor.sys_path + '/state', os.O_RDONLY)
    callbacks[fd] = callback
    os.read(fd, 16)
    p.register(fd, select.POLLPRI)

# Initiate all sensors and motors
l = lego.LargeMotor("A")
r = lego.LargeMotor("D")
lift = lego.MediumMotor()

dist = lego.InfraredSensor()
line = lego.ColorSensor()
touch = lego.TouchSensor()

# reset the motors
l.reset()
r.reset()
lift.reset()

try:
    # run forwards
    l.run_forever(100, regulation_mode=False)
    r.run_forever(100, regulation_mode=False)
    # main loop
    while True:
        poll()
        if touch.is_pushed and lift.state == "idle":
            # we hit something, raise the arm!
            lift.run_position_limited(-3000, 1000)
            on_completion(lift, lambda: lift.run_position_limited(0, 1000))
        elif line.reflect < 20 and l.duty_cycle > 0 and r.duty_cycle > 0:
            # we reached the edge, back up and scan for opponent
            l.run_time_limited(1000, -100)
            on_completion(l, lambda: l.run_forever(100))
            r.run_forever(-100)
        elif dist.prox < 50:
            # found opponent, charge!!!
            r.run_forever(100)
            l.run_forever(100)
finally:
    # stop motors and lower arm
    l.stop()
    r.stop()
    lift.run_position_limited(0, 1000)

Excavator wheel base

Today I took out the RCX and made a wheelbase for the NXT excavator arm I made earlier.

I am satisfied with the look and maneuverability, the only problem remains where to put the RCX. Maybe I can put both the NXT and the RCX on the arm, or make some room in the wheelbase.

It will also be interesting to control the whole maschine. The NXT and RCX can’t really talk to each other, but both can talk to the computer over Bluetooth and Infrared respectivly. So maybe I wil make a command centre on the computer to control both devices.

RCX Plotter with Glidewheel

I modified the UBS plotter model to work with the NXT using 2 glidewheels and a normal converter between NXT and classic LEGO connectors.

The original model has two spoke wheels with touch sensors on them, to count the rotations. I replaced these with glidewheels.

Since the UBS is modular, it should be fairly simple to power other models with the same glidewheel-enhanced modules.

I also slightly modified the compressor gear train and paper feed to be more reliable with my old LEGO. Other than that, the model is completely original.

For a nice introduction to the original model, I refer you to Henrik Bækdahl.

NXT in-line skater

I found a video that features a skating robot, it moves, but skating? I did a lot of skating myself, so I started to think about a better skating movement.

It occurred to me that while skating around pylons, you don’t need to take your skates of the ground. What you do instead is hard to explain.

I tried to explain my idea to anyone who’d listen in #mindboards, but to no avail. You just have to see it with your own eyes.

It is a really fun thing to build and play around with. I suspect you can find more efficient and inexplicable ways to move and turn.

Get the building instructions for this model

This is the Mirah code I used in the video:

import lejos.nxt.Motor
import lejos.nxt.Button

def align()
	Motor.A.rotate(360 - (Motor.A.getTachoCount() % 360))
	Motor.C.rotate(360 - (Motor.C.getTachoCount() % 360))
end

speed = 150
Motor.A.setSpeed(speed)
Motor.C.setSpeed(speed)

Motor.A.forward()
Motor.C.forward()

Thread.sleep(20000)

Motor.A.stop()
Motor.C.stop()

align()

Motor.A.backward()
Motor.C.forward()

Thread.sleep(20000)

align()

Motor.A.forward()
Motor.C.forward()

Button.waitForAnyPress()

Pneumatic Bug

So there you are. This is the result of a day or two of LEGO building, followed by weeks of thinking, sawing and soldering. Lucky for you, you don’t have to go through all that, and can just buy the needed parts.

This cute little bug can walk forwards, backwards and turn around, using 4 pumps on 3 switches. The outer 4 legs can move back and forth, with left and right having an individual pump. The middle legs are connected, and can move up and down.

By tilting the middle leg right, the outer right legs come of the ground, while the middle leg on the left is off the ground, then the outer legs can be repositioned for the next cycle.

There are touch sensors on the middle legs, to detect when they are of the ground.

To build this adorable model, you need your NXT, 4 pneumatic pumps, 1 compressor pump, 3 servo valves and a servo controller.

This is the walking routine in NBC for my custom controller. The concept is the same for the Mindsensors one.

#define tilt 0
#define left 1
#define right 2
#define servoport IN_2

thread main
SetSensorLowspeed(servoport)
OnFwd(OUT_A, 100)

loop:
servo(servoport, left, 150, result)
servo(servoport, right, 150, result)
servo(servoport, tilt, 100, result)
wait 7000

servo(servoport, tilt, 150, result)
servo(servoport, left, 100, result)
servo(servoport, right, 200, result)

wait 5000

servo(servoport, left, 150, result)
servo(servoport, right, 150, result)
servo(servoport, tilt, 200, result)
wait 7000

servo(servoport, tilt, 150, result)
servo(servoport, left, 200, result)
servo(servoport, right, 100, result)
wait 5000

jmp loop

endt

Download building instructions

RCX Snow Plow

Over here in the Netherlands we usually have just a few days or weeks of snow per year. When the time comes, there are three things that absolutely have to happen.

  1. Go sledging
  2. Go ice skating
  3. Build a robot to drive in the snow

I wont bother you with the first two items, but I thought you might like number three.

I was surprised that I couldn’t find a single video of  a snow plow, plowing real snow. There are robots pushing LEGO around, and static models of a snow plow. This is what I made.

The robot is a regular half-track, but uses a triangular tread configuration to keep the motor out of the snow. It also has a rotation sensor on the unpowered front wheels, to detect the robot isn’t moving.

I’m not sure if you are interested in the software or building instructions, because it uses the RCX with parts from Ultimate Accessories and Ultimate Builders sets, as well as miscellaneous red parts. Are you?