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
EzAng
If you know how to do it, please post the solution.
DJ should answer this one
Why you post the above URLS ?
I will try with my adventure Bot later
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...
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
EzAng
@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...
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
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
EzAng
Cheers