Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.
Get Started

Asked

Turn Adventurebot Using Angles

I am pretty new to working on the AdventureBot, and a class project requires me to make it turn at certain angles, such as turn left 55 degrees, turn right 34 degrees, etc.
I have tried varying the speed of the left and right HDD motors, but to find an angle I have to do several tries to find the perfect setting, and repeat it for new values of angles. Also, the speed settings change with the surface of the floor. I do not seem to find a pattern in the left and right speed values either, through which I can write generic code for converting motor speeds to exact angles either for a particular surface.

Has anyone faced a similar problem? If yes, then how can I implement such an operation on AdventureBot? Is there a library or app that I can install on EZ-Builder?

Thanks


Related Hardware EZ-Robot AdventureBot
#1   — Edited
Without additional hardware this cannot be done accurately with the stock AdventureBot..... You will need either wheel encoders or an accelerometer/gyro (for example an mpu6050 accelerometer)...
#2   — Edited
I only can offer links for some help:



EzAng
#3  
@Ezang:
If you know how to do it, please post the solution.
#4  
ptp, I just got back, 

DJ should answer this one
#5   — Edited
@EzAng:
Why you post the above URLS ?
#6   — Edited
trying to help as I stated above, my friend

I will try with my adventure Bot later
#7  
OK makes sense.  You don't know the solution and you post random links for other people to follow and waste time.
#8   — Edited
@EZAng... I had already answered him and gave him solid advice. If you didn't know how to help him you should not have responded.... Perhaps you didn't understand exactly what the OP wanted to do... That's fair, but just be careful with helping if you are not clear in what is being asked...

FYI... you cannot use timing (sleep commands) to accomplish this... motor output varies and so does battery voltage. Even the surface the robot is running on (friction) will cause different results... As an example the robot will rotate a certain amount depending on battery voltage... Voltage drops so does your turning angle.... Solution.... You need wheel encoders or an IMU (accelerometer/compass) for precise angular rotation...
Synthiam
#9  
Even with wheel encoders, there’s no way to accurately turn accurate degrees due to wheel slippage. Any robot with wheel encoders or not will always have a margin of error. 

Because the adventure bot uses lipo batteries with a voltage monitor, the speed  of the servos do not change. The voltage monitor cuts off before that would happen. 

the best way to have the robot turn a set number of degrees is to...

1) place a piece of paper on the ground with lines drawn by a protractor of the specified degrees 

2) in the adventureBot project,  press the configuration button on the continuous servo movement panel. Ensure the use stop values checkbox is checked. 

the checkbox will ensure the servos are locked into a stop position vs freely rotating. When the stop command is sent, the servos will immediately stop. 

IF the servos keep moving when the checkbox is set and the stop command is set, the servos will need calibration. There’s a good tutorial on ezrobot’s website for that. I think I might actually Star in that tutorial video? Can’t remember:)

3) okay, now that you have the robot on the paper and ready. Create a Script control by Add Control - Scripting - Script

4) press the configure button

you can use Blockly for this I’d preferred. The Blockly will generate JavaScript anyway. So select the Blockly tab (assuming you’re using ARC for JavaScript)

5) the code will use a turn, sleep, stop. And experiment with the turn speed and sleep to get the best degrees. I’ll add a screenshot example when I’m on my laptop in an hour 

6) now that you have the degrees for this script set, say it’s 90 degrees. Give the script a name at the top of the configuration window. Call it Left 90 Degrees

7) now set the checkbox that says RoboScratch Module. What this does is turn your script into a RoboScratch module on the RoboScratch editor 

8) now when the students program the robot using roboscratch, they will see your Left 90 Degrees module
#10  
Thanks D J, I knew there was an answer in  ARC for the young man at school

EzAng
#11   — Edited
@DJ I respectively disagree. Your method will be crude at best... From what the op said he sounds like he was fairly advanced and looking for precision (Turn right 34deg, etc)... Maybe your method you can get "relatively" close but down to the degree?... I should think not. FYI wheel slippage/surface also applies to your method as well... For precision an IMU accelerometer/compass would work the best... 270deg on a calibrated compass is 270deg irregardless of battery voltage, motor variances or surface condition... The robot will keep turning until it hits 270deg or runs out of battery/or motor burnout trying. That is unless you program it to abort before that happens... Remember repeat ability is also one of the OPs requirements...

@EzAng.... You may feel vindicated, because @DJ came to your rescue, but remember it was DJ and I who were the only ones who put forth a possible solution....

FYI... In my roomba hacking days I used to routinely get any rotational angle I wanted with the old 400 series. With the old 400 series (via the ROI) you had pretty much full access to the Roomba's wheel encoders so it made precision turning a snap...
Synthiam
#12   — Edited
I didn't realize the solution was requiring specific degrees of 34 or some incredibly accurate number. My solution will provide a vague turning degree for a classroom to demonstrate angles (roughly) of pre-set degrees. It would be similar to any educational robot product. Perhaps with an outcome similar to Turtle Graphics or LOGO.

If you're looking for very precise (to 34 degrees), then there really isn't a great way to do it. You'll need to do it slowly, and use a kalman filter to combine multiple sensor data. A compass isn't accurate enough alone. It would require multiple scans of a lidar or camera sensor. Combined with a compass. Combined with wheel encoders. So three high grade sensors can provide you with the turning. But, the wheels will also have to be centered. Additionally, the wheels would have to have incredibly low friction, and castor could not be used either. So, that will also create some challenges because the robot may move forward a slight amount while turning.

Really, it's going to be incredibly difficult with any platform without combining significant number of sensors with high sample rate to accomplish the precision you believe the OP is requesting. 

I do not believe the OP is requesting that level of precision. My interpretation is the OP would like to demonstrate angles of a robot on the ground, similar to how Turtle Graphics or LOGO would be on a computer screen. If i'm incorrect, I accept that as well:)
#13   — Edited
Richard R -  Sort of sound childish -  Why would you say "EzAng.... You may feel vindicated, because @DJ came to your rescue"?

I simply thought there was a way, not being so precise as you are describing, to use the ARC program. I also thought the young man for school just wanted to get some angles, as he said "to make it turn at certain angles, such as turn left 55 degrees, turn right 34 degrees, etc. "

for a school project, do you really need to be so precise? I think not...

If I am wrong, let akshaymathurcse0009 inform me.

I bet akshaymathurcse0009 is long gone by now, lol

by the way I tried it, was a few degrees off, due to my surface, wheels were not calibrated (5 off)  - fine for a school project

User-inserted image



EzAng
#14   — Edited
@DJ... Yes Lidar, now we're talkin'... 

Cheers
#15   — Edited
@EZang.... Seriously dude time to let this go... The op wanted precise degrees not approx... Ok, preform the same script on a shag rug, oily surface, dirt and loose gravel.... Now quickly adapt it to cover any angle between 0 - 359deg... without 360 different scripts, that is.... I could have given him this and much more but again without additional hardware there would be no precision and no reliable repeat ability....
Synthiam
#16  
I wouldn't worry to much - the OP was scared off a long time ago with this convo:)
#17  
lol, that is what I said above, be well