Bio | Week 15 | Final Project Documentation-Spider Robot “Peter”(Terrence Tu)

Brainstorm:

As it described in the final project proposal, I decide to continue on the locomotion lab and turtle robot prototype and make a spider robot which imitates spider’s locomotion as my final project. I did not choose spider as my targeted object randomly. After I did some exploration, I found out there is similarity between turtle’s and spider’s locomotion. Following two videos show the locomotion of these two different animals.

As we can see, spider has two times of legs as turtle does. However, when I divide spider’s eight legs into front four and latter four, I surprisingly found out these two sets of legs are moved in roughly the same pattern and it is quite similar to the pattern of turtle locomotion. However, since spiders’ leg has more joints, thus it moves more neatly. Thus, the project can be regarded as an upgrade of the turtle robot prototype.

After I researched for spider robot, I found out there is already an existing project which someone make a four-leg spider robot with Arduino system, 3d-printed models and twelve 9g servos. However, as far as I am capable of, I have no idea of how to do it by using Arduino. But the 3d-printed modes are helpful for me to start the first step.

Since for the whole semester, we are using micro:bit robot:bit and kittenbot to build different things, I decide to try to build the spider robot with micro:bit and robot:bit. Also, one biggest advantage of using robot:bit I believe is that it can easily solve the problem of power 12 servos at the same time. However, one robot:bit can only power 8 servos at the same time, which means I have to use two robot:bit. 

Assembly:

The assembly units need to use:

3d-printed spider skeleton (The 3d model was designed by RegisHsu) including:

 

1×body_d

1×body_u

 

2×coxa_l

 

2×coxa_r

 

4×femur

 

8×hold

 

2×tebia_l

2×tebia_r

12×sg90 9g servo

2×robot:bit (for Kittenbot)

4×micro:bit

I guess waiting for all the models printed out is the longest step in the whole project. After a more than 10-hour-printing process(well I have to say school’s 3d printers do not function so well), I finally got and 3d-printed parts. So that, I can assemble the robot according to the blueprint.

However, since I will do the project with robot:bit instead of Arduino, I have to figure it out how to put two robot:bit properly. Luckily, the body part has just fine space to arrange two robot:bit, but it will affect all four legs, which means all four legs cannot turn  to be parallel to the body in this situation. It may affect the final product, but I still decide to try. After Rudi’s helping me by using zip tie to tie two robot:bit on the body, I finally succeeded in assembling all parts so far together. The spider robot I have done is displayed below.

 

First Problem – 3D-printed units:

Apart from the failure of 3d printers, the first problem I met is about the 3d-printed units. Due to limitation of 3d-printer techniques or the fulfillment of 3d-printer, the units I got have fine deviation, which mean not all parts can assemble together as it should be. I have to use drills to fix this problem, though it is just a small problem.

Second Problem – Servo Calibration:

When I was so happy that I have assemble all the units together and I can focus on the coding part, I found that servos did not work as I thought. Some start at a weird place and and some never go to the place I want them be.  After searching for the working principles of servos, I found out that I did not calibrate them to 0 degree before I assemble. There is no other ways so I have to separate all units. Then I use micro:bit to calibrate all the servos to 0 degree since it will be the most precise way. Also, during the process, I record some data such as the degrees which servo are at horizontal position and the degrees that servos can turn at maximum according to the pins these servos connected to. These data will be helpful when I do the coding.

Sparkle:

When I have assembled the body and legs, I found out he robot is almost symmetric from appearance. It will add difficulty when I do the coding. Thus I decide to assemble a head to it. At first, I try to attach whatever something round to the body. Then I suddenly thought about the ultrasonic module of the Kittenbot. To be honest, at first, I just think about the RGB led lights on it. Some of the spiders have red eyes, so If I add it to the robot and make lights red. The robot will be more like a spider and super cool. Then a sparkle suddenly come out to me that even the ultrasonic function can be used. 

1×Ultrasonic module

On the first half of the semester, I have done the Kittenbot which can detect obstacles by using ultrasonic. It is also possible to achieve that on the spider robot. So I connect the module by using zip tie to one side of the body and make it the head side. The product is displayed below.

Third Problem – Weight:

The existing four-leg spider robot done by using Arduino obviously does not have such problem. However, since I use two robot:bit instead of Arduino, the weight is over the expectation. Even there are 12 servos, then can only hold the body when all four legs are stand on the ground. When I try to move a leg in the air, three leg failed to hold the weight of the body and the spider hit the ground. The solution I gave is to attach the body to the ground to relief legs’ pressure. But the junction point must has little or no fraction so that it would not affect spider’s movement. Thus I thought about the Omnidirectional wheels on the Kittenbot.

2×Omnidirectional wheel

Since the Omnidirectional wheels are not high enough, I used eraser to increase height and tie the eraser and the wheel to the body with zip tie. Till now, I have done all the assembly work of the four-leg spider robot. The final product is displayed below:

 

 

  

Coding:

The coding is all done by using Makecode. I will use three micro:bit as controller. Following is the code I wrote for the project.

Right Side:

Left Side:

Three Controllers:

 

The code I have written can be divided into Six parts: Startup, Straight Line Movement Pattern 1, Straight Line Movement Pattern 2, Veer Movement, Obstacle Avoidance, and a Stinger. I guess my following description of the patterns is hard to understand, but I have record several videos for each type of movement. I believe it will be much easier to understand through video.

Start up:

No matter what its beginning posture, when the power of micro:bit turns on, it will turn to a stand posture.

Straight Line Movement Pattern 1:

The spider robot moves forward one foreleg on one side and one hind leg on the other side in the air. Then, similarly, it moves forward the rest two legs in the air. Finally, the joints of four legs to the body move forward. Due to the fraction between legs and the ground, the robot body will move forward. Reversely, the robot can achieve backward movement. The biggest feature of this pattern is that four legs will offer fraction at the same time to move the body.

Forward:

Backward:

Straight Line Movement Pattern 2:

Another pattern is that the robot moves forward one foreleg on one side and one hind leg on the other side in the air while the joints which connect the rest two legs to the body will move forward at the same time. The robot will move forward due to the fraction offered by the two legs which stand on the ground. Reversely, the robot can achieve backward movement. The main difference between pattern 1 and pattern 2 is that pattern 2, at the same time, only has two legs offer fraction which move its body forward while pattern 1 has four.

Forward:

Backward:

Veer Movement:

Veer is the easiest locomotion pattern to achieve. The robot moves one foreleg on one side and one hind leg on the other side in one direction in the air. Then it moves the rest two legs in the same direction. After that, four joints will move towards the same direction. Due the fraction between four legs and the ground, legs will stay at the same position. But the body will veer in the direction that you move the legs.

Turn left:

Turn right:

Obstacle Avoidance:

Once the spider robot sense obstacle in its by using ultrasonic senses, it will turn right.

Stinger:

At last, Let’s have fun!

Comparing Straight Line Movement Patterns:

Both of the two straight movement patterns can help the robots move forward and backward. However, each of them has their own advantages and disadvantages

If we compare them from the perspective of Biology, pattern will definitely be a better and more biomimetic option. Pattern 2 is closer to a regular way of how animals which have four legs crawl. Barely has animals use the first pattern to move.

However, if we consider the problem of stability, pattern 1 is a better choice. The most obvious reason is that pattern 1 uses four legs to offer fraction at the same time while pattern 2 uses only two. The actual results also prove this standpoint. When the spider robot uses pattern 1 to move, it always walks a straight line under most circumstances. However, when it uses pattern 2 to move, it easily deviate from straight line.

Flaws:

Honestly speaking, the four-leg spider robot is far from perfect. There are still a lot of places can be improved. For example, the body is too heavy for the servos even there 12 of them. Also, it is hard for the straight line movement pattern 2 to walk a straight line. But I strongly doubt it is hardware problem. The robot always turn right. It means that left side offers stronger fraction than right side. I guess the problem is possible to solve. 

Reflection:

As a finance major student, I never expect one day I will do this kind of project at school. It is definitely a meaningful project to me as I have done a not bad project from nothing. During the project, I learned always endeavoring to do still better. The innovation ability and thinking capability is what more important I get from this class. I believe these things are more precious than simply how to do a robot and I really appreciate about it.

Bio | Week 12 | Final Project Proposal(Terrence Tu)

Final Project Proposal: Spider Robot

After three weeks’ locomotion labs, I felt locomotion is a quite interesting topic in Robotics. Thus, I tended to choose a topic that is closely related to locomotion. After doing some researches, I decided to choose spider as my object and make a robot which imitates spider’s locomotion.

Bio | Week 13 | Lab Report: Collective Decisions(Terrence Tu)

Plan:

In the lab, we pick a simple algorithm to simulate the behavior of “cohesion”. Steps are as follow:

1. Trigger

We have five micro:bit as operating micro:bit in a square and another one micro:bit as controller. Each operating micro:bit will join a radio group with the controller. Once the controller micro:bit gives out a trigger to all operating micro:bit, they will switch to the mode “cohesion” and begin to move to a certain point.

2. Calculate

Each operating micro:bit will stick to a different individual mark. The computer vision system will determine the coordinates of each mark. After we get the coordinates of all five micro:bit, we will calculate the coordinates of the point which is the average point to all five micro:bit. Then we will sent the current position coordinates and average point position coordinates to five operating micro:bit through controller micro:bit.

3. Display

After five operating micro:bit get the coordinates, they will calculate the direction they need to head to. Then they will show an arrow towards the place the mark is on there 5×5 LED.

4. Move

Operating micro:bit will move towards or away from the marker. After each move, we will get the new location coordinates of the operating micro:bit and send them through controller micro:bit. The operating micro:bit will then automatically calculate the distant away from the average point and compare it with previous distant. If they move towards the marker (distant is smaller) , they show a happy face on their screen. If they move away from the marker (distant is larger) , they show a sad face. Once they are in the position they wanted to be, their screen displays something else (a square or a circle, for example).

Code:

Important Variables:

previous_distance 

current_distance

cur=(x_cur, y_cur)

des=(x_des, y_des)

Logic:

void loop{
current_distance=dist(des,cur);

if (previous_distance>current_distance){
display(HAPPY);
}else{
display(SAD);
}

previous_distance =dist(des,cur);

The logic of our algorithm is not hard to figure out. The only problem we need to solve is how to repeatedly send out coordinates (information) from the controller micro:bit. 

Reflection:

From my point of view, the hardest part of the lab is to figure out what type of collective decision strategy we would like to do. In other words, what simple algorithm we want to apply. We spend about almost half of our time on discussing what we want to do and finally we decide to make a cohesion behavior. Another hard point of the lab I found is that how to define the degree of simple. Sometimes when we try to add move function to the collective decision behavior, I have a feeling that it will be too complicate to call it simple. But in all, I feel the lab is an interesting topic. However, to understand it better may take a long time.

Bio | Week 11 | Lab Report: Locomotion & Prototyping(Terrence Tu)

Inspiration:

Justin and I were inspired by the metal case of the Kittenbot. The metal body of the Kittenbot resemble shell of turtle. Thus, we got an idea to imitate the locomotion of a turtle.

Prototyping:

First step, in the first lab, Justin and I searched for some turtle locomotion videos on the Youtube. We found out that when turtle moves forward, its two forelegs and two hind legs moves in the opposite order so that it can crawl forward. Based on that observation, we build a Lego model.

We can see that the transmission shaft connect two forelegs and two hind leg and it guarantees that two sets of the legs can move in the opposite direction but at the same angle at each time. Also,  the center of the transmission shaft is always on the center axis of the whole prototype. It means that we may only need one motor to make the whole turtle locomotion robot.

Second step, build a prototype. For the reason of the illness, I missed the second lab. In the second lab, Justin built a prototype. Instead of the model of drive we built in the first lab, Justin built a two servo model because there is no such motor can do a linear locomotion as the Lego prototype we did in the first lab. 

Third step, improve the prototype. In the third lab, I modified the material used on the claws of the turtle. I turned forelegs into omnidirectional wheel and hind legs into eraser. The idea comes from the turtle locomotion of a turtle toy. The erasers will offer fraction to make the robot move.

In this way, the turtle robots succeeded in moving forward by moving two sets of legs in the opposite directions at the same time. 

Since it is not convenient to control the robot from the micro:bit connected to the robot by wires. We decided to attach the robot:bit onto the robot and used a remote control to move the robot. The final product is showed below.

However, we find out that once we use remote control, we cannot move two sets of legs at the same time, we can only move one set of legs once. .However, we find out that, even in this situation, the turtle robot still can move forward, but this time, it moves in a much slower speed. The video shows the robot move away from the eraser.

Reflection:

The prototype is very rough. When the robot is moving with two sets of legs, we found a rather serious problem that we have to control the timing of moving these two set of legs manually and the timing must be precise. If the timing gets wrong, the turtle may stay at the same position without moving. But we also notice that besides moving straight forward, our turtle robot can also veer, the only thing we need to do is to adjust the timing of moving two sets of legs. Thus, if we can find the precise timing of moving two sets of legs, we can build a turtle robot which can move and veer freely. This is possible to achieve by programming. We may develop it further into a mature robot in the future (final project). Anyway, the locomotion and prototyping labs are interesting and helpful.