top of page

Lego Axis

Introduction

This creation rotates a platform with it's five arms. It doesn't have any real purpose other then an overcomplicated rotating displaystand. I guess the same thing could be achieved with just one motor but that would be no challange.

It's controlled by 4 EV3 units with 15 motors and 10 touch sensors connected to them.

For the programming i used labview.

How it all started

The inspiration for this project came from a creation made by Mark Setrakian.

After seeing that i wanted to know if it could be done with lego. It didn't end up as good as Mark's but lego has it's limits.

Below is Mark Setrakian's original version "Axis".

How it works

First off, what is the problem?

The problem is to get the arms to follow i curved line at a specific height in space so that the 5 arms together makes a circular motion.

What I need for this is a way to convert X,Y,Z coordinates into angles for the diffrent joint in the arm and then a way to plot a curved path in the X,Y,Z coordinate system.

Converting X,Y,Z coordinates into angles (for 3 joints)

The way i did this was to create two 2-dimensional views of the arm, X-Y and Z-Ys (not same as Y).

So first of i calculate the value of Ys. This is done with the X Y positions that would be part of my desired position.

Ys = sqrt(X^2 + Y^2)

Now it is possible to get the angle between Ys and X

Angle Radians_YsX = arccos(X/Ys) (arccos = inverted cos = cos-1)

Some calculators/softwares (EV3 original software) would directly give you the value in degrees.

But in labview you get the value in radians instaid of degrees so you I had to convert it into degrees myself.

The diffrence between radians and degrees is basically that for degrees 360 = full circle and for

radians 6,28(Pi x 2) = full circle.

So i had to convert it from radians to degrees.

Degrees_YsX = Radians_YsX x 180 / Pi

Now i have the calculated angle for the first joint at the base of the arm.

.

 

 

First joint

Second joint

Third joint

B and C is fixed distances in the mechanical design so they will be constants in this case.

Ys i got from the previous calculations above and Z is part of my desired position so i know that value aswell.

To get the angle for bc (third joint) i first need to know the lenght of V.

V = sqrt(Z^2 + Ys^2)

To get the angle for bc.

Radians_bc = arccos((B^2 + C^2 - V^2) / (2 x B x C))

Degrees_bc = Radians_bc x 180 / Pi

Now i just need the angle between B and Z (bz) for the second joint.

First i calculate the angle between B and V (bv)

Radians_bv = arccos((B^2 + C^2 - V^2) / (2 x B x C))

Degrees_bv = Radians_bc x 180 / Pi

Then i calculate the angle between V and Z (vz)

Radians_vz = arccos(Z/V)

Degrees_vz = Radians_vz x 180 / Pi

Add them together

Degrees_bz = Degrees_bv + Degrees_vz

Now i am able to generate the degree values for the 3 joint in the arm based on the XYZ coordinates.

However the degree values of the joint is not the same as the degree value for the motors so i will have to account for that with some gear ratio calculations.

And in the calibration sequence of the machine i then match the starting position for the motors with the appropriate degree value.

Creating a curved path.

The curved path is based of a circle that has it center in the middel of the machine. Each arm will move along 64 degrees of the circle.

I used 64 degree instaid of 72 (1/5 of 360 degree) to avoid collisions of the arms when they do the transition.

I had to use a separate coordinate system for the path based of the center of the machine, in the new coordinate system i use Xc and Yc.

 

As you can see in the image above the path starts at 328 degree and moves to 392 degree. I keep going above 359 (instaid of starting over at 0) to avoid having make special code that would have to hadle the jump from 360 to 0 as it moves along the path.

To get Xc and Yc coordinates for the path (based of the center of the machine).

Yc = cos(v) x r (v = angle, r = radius)

Xc = sin(v) x r

Ex:

r=150mm

v = 1/ 328 degree, 2/ 360 degree, 3/ 392 degree

1/     (Yc) 127,2mm = cos(328) x 150mm                        (Xc) -79,5mm = sin(328) x 150mm

2/     (Yc) 150mm = cos(360) x 150mm                           (Xc) 0mm = sin(360) x 150mm

3/     (Yc) 127,2mm = cos(392) x 150mm                        (Xc) 79,5mm = sin(392) x 150mm

Now i just need to get the path based in the center coordinate system to the coordinate system for the arm.

The distance between the two coordninate systems is know (just measure).

To get the Z and X positions.

Z = P - Yc (P = distance between the two coordinate systems)

X = 0 - Xc

The Y value for the arm does not need to be calculated, it can be what ever i set it at as long as the arms can reach it.

So that is basically the math for the machine. I use the same calucaltions for all 5 arms.

To get it to move in the path i start at 328 degree and then every 100ms i add 1 degree until i get to 392. Then i lower the Y value to lower the arm and then start to subtract 4 degree every 100ms.

Until it reach 328 again. Then change back the Y value to make to arm go up again then it kinda repeats that.

Each arm starts at 5 diffrents points in this cycle so that when the first arm starts moving forward the last arm will start moving revers. This way there will always be 4 arms holding the plate.

There is probably more efficent ways to solve this, but this is what i could come up with. :)

Most of the equations could be used for a walking robot as long as its only has 3 joints / leg if you want all legs to pull in the same directions. But with lego i have a feeling there might be some weight issue.

Hopefully the explinations was understandable and not too boring. :)

 

bottom of page