hmirrobotics

Robotics November 27, 2011

Posted on: December 4, 2011

The main thing we did for this class was center the servos which are the motors that will control the motion for the Boe-Bot. In order to center the servos we needed to learn the PULSOUT command which requires a pin number and a duration and it looks like this

PULSOUT  pin, duration

The pin number is the pin you want to send the signal and the duration is a little more complex than that. If the duration is 2 that mean the number of microseconds it will run for is 4. This is because you multiply the duration by two. Why do we multiply by 2 you may ask? Well because 1 = 2 microseconds.

We had to resisters and two LEDs on the bread board and we wrote this program. This program sends a signal to pin 13 and 12 to send a 0.13 second pulse. How did I arrive at the number 0.13 when the duration says 65000? Since 1=2 microseconds we multiply 65000 by 2 and then we divide by a million and arrive at 0.13 seconds. Then the LEDs will pause for 2000 which is 2 seconds. The DO…LOOP commands in the program will just make the program run again and again

‘ Robotics with the Boe-Bot – PulseBothLeds.bs2

‘ Send a 0.13 second pulse to P13 and P12 every 2 seconds.

‘ {$STAMP BS2}

‘ {$PBASIC 2.5}

DEBUG “Program Running!”

DO

PULSOUT 13, 65000

PULSOUT 12, 65000

PAUSE 2000

LOOP

Afterwards we divided all the numbers by 10 in order to make the program run 10 times faster and then we moved on to make it a 100 times faster. Instead of turning off and on the LEDs just appeared less bright because then they were turning of and on so fast. After that we substituted 850 for the duration of p13 noticed that the O13 LED appeared brighter than P12 when we cupped our hands around them.

Later we moved on to using the servos which are the motors that control the motion of the Boe-Bot. We connected the servos to a power supply on the Basic. There was a little black box like thing in the middle of the board of education and it was closer to vin but it was supposed to be closer to vdd so Mrs. Thomson carefully moved it with a her skinny tool. Honestly I don’t know why we had to move but I’ll be sure to ask later. For now I think it was because our power supply was from batteries not an adapter.

Now I was time to connect the servos to the board of education. We put one servo in p12 and one in p13. The plugs looked so fragile I thought my big fingers would break them so I watched while Nabila connected them. On our servos we put on horns which were a testing replacement for the wheels.

Image

Next, was the fun part. I have to say that centering the servos was the most fun I’ve had in all of the robotics classes. It seemed so scary when Mrs. Thomson mentioned that when Musad forgot to center his servos he had to take apart his whole Boe-Bot to fix his mistake. But in real it was quite fun. Why would anyone want to forget such an amazing step? In order to center our servos first we needed to write a program.First we wrote it for p12 and then modified it to be for p13.

‘ Robotics with the Boe-Bot – CenterServoP12.bs2

‘ This program sends 1.5 ms pulses to the servo connected to

‘ P12 for manual centering.

‘ {$STAMP BS2}

‘ {$PBASIC 2.5}

DEBUG “Program Running!”

DO

PULSOUT 12, 750

PAUSE 20

LOOP

In order to center our servos we put the four head servo into a whole in our servo and we kept spinning it around. While we were doing so the horn were moving and our goal by spinning the screw driver was to stop them from spinning so we went in multiple direction to fulfill our  job.

Image

I hope all the classes in robotics are like the one I just had. I think what I need to work on in robotics is to ask more questions. If I asked more questions I would know what everything was called and I wouldn’t forget when I got home because I would understand the concept.

Image

Leave a comment

Categories