Boe Bot degree turns in Arduino
hungryTechie
Posts: 14
Hi ,
I use the Boe Bot with Arduino in my CS class and have completed lots of exercises and practices from the pdf manual available.
Question #1
In chapter 4 there is a challenge that goes like this: " Lets say that you tested your servos and discovered that it takes 1.2 seconds to make a 180°turn with right-rotate. With this information, write routines to make the BOE Shield-Bot perform 30, 45, and 60 degree turns." Can anybody explain the Math behind this and how it relates to the formula: time = (BOE Shield-Bot distance / BOE Shield-Bot speed) * (1000 ms / s)? The goal here is to easily calculate degrees and implement with the Arduino code for Boe Bot turning maneuvers.
Question # 2
Does anybody have suggestions, ideas on how we can further modify Boe-Bot to look differently ( maybe have 4 wheels or case it) or even combine Arduino with Lego EV3?
I use the Boe Bot with Arduino in my CS class and have completed lots of exercises and practices from the pdf manual available.
Question #1
In chapter 4 there is a challenge that goes like this: " Lets say that you tested your servos and discovered that it takes 1.2 seconds to make a 180°turn with right-rotate. With this information, write routines to make the BOE Shield-Bot perform 30, 45, and 60 degree turns." Can anybody explain the Math behind this and how it relates to the formula: time = (BOE Shield-Bot distance / BOE Shield-Bot speed) * (1000 ms / s)? The goal here is to easily calculate degrees and implement with the Arduino code for Boe Bot turning maneuvers.
Question # 2
Does anybody have suggestions, ideas on how we can further modify Boe-Bot to look differently ( maybe have 4 wheels or case it) or even combine Arduino with Lego EV3?
Comments
Regarding Question #2: There are additional sensors and add-ons that you can use with the Parallax "Shield-Bot." This page has a list of Parallax sensors and kits with Arduino Uno example code: https://www.parallax.com/product/arduino. The first product on that page is the Ping))) Ultrasonic Distance Sensor with Mounting Bracket Kit. I posted a project using this kit on the Shield-Bot:
http://learn.parallax.com/project/shield-bot-roaming-ping
Question 1 really has three parts: (A) about turning, and (B) about the distance equation, and (C) how are they related
(A) If you know how long it takes the bot to turn a 360, program it to turn for half the time and it'll give you half the turn. A quarter of a turn will take a quarter of the time, and so on. More generally, whatever fraction of 360 you need, make it turn that fraction of the full circle time.
(B) Since you are a CS student, start by grabbing a pencil, paper, and calculator and doing the math problems on this page: http://learn.parallax.com/node/222. Also, hand enter the example program on that page and carefully follow the red checklist instructions. Once you've got a feel for them, the goal would be to solve the run time you need for a desired distance with an equation.
In case its still not clear, here is an additional hint: You need to multiply the run time result by 1000 ms/ 1 s because it converts seconds to the ms the program needs to do the job. That's because 1 s = 1000 ms. So divide both sides by 1 s, and you get 1 = 1000 ms / 1 s. Multiplying by 1000 ms / 1 s is equivalent to multiplying by 1, except that when you cancel the units, the result will be in ms instead of s.
(C) Once you are familiar with calculating and programming linear distance, rotational distance works the same way. Just as time = distance / speed, we also have time = angular distance / angular speed. Let's say it takes the bot 3 seconds to make a pivot 360. That's an angular speed of 360 degrees per 3 seconds, or 120 degrees per second. With that piece of info, you can go through the same exercise in http://learn.parallax.com/node/222 and come up with an equation for turning that can also be converted to code.
I want to thank you for your time answering this question in such detail for hungryTechie (ahem, ahem).
I realize that you took a break from a significant workload to compose the reply.
So, thank you!
Ken Gracey