Create accuracy

4 replies [Last post]
SEAL491
SEAL491's picture
Title: NooBot+
Joined: 07/19/2011
Posts:
BotPoints: 54
User offline. Last seen 10 years 12 weeks ago.

Our Create veers off course about 30 degrees when it goes full speed for about 1 meter. Is this something that every team has to deal with?

If so, will create_drive_direct somewhat solve the problem?

Thank you,
- Ulzee

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 18 weeks ago.

I've seen this happen when the Create is insufficiently charged. Try charging the Create for 2-3 hours and see if it improves.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

JMonsorno
JMonsorno's picture
Title: NooBot
Joined: 11/28/2010
Posts:
BotPoints: 37
User offline. Last seen 5 years 28 weeks ago.

So, I think I know the problem because 30 degrees is kinda huge and your suggested solution is to use create_drive_direct.

I'm guessing you are using create_drive(500, 500) and expecting the create to move straight, it shouldn't.
Format: void create_drive(int speed, int radius);
Drives in an arc. Speed range for all commands is 20-500mm/s

If that's the case create_drive_direct(500,500) will fix the problem.
Format: void create_drive_direct(int r_speed, int l_speed);
Specifies individual left and right speeds in mm/s

I have seem many teams make this mistake, some figure it out but must "give-up" using create_drive once the can't get the create to go in reverse or make 0-degree turns.

P.S. I'd always include at least some code snippet when possible.

SEAL491
SEAL491's picture
Title: NooBot+
Joined: 07/19/2011
Posts:
BotPoints: 54
User offline. Last seen 10 years 12 weeks ago.

Thanks for the tips!

@Jmonsorno, I've actually been using create_drive_straight(500)
"Format: void create_drive_straight(int speed);
Drives straight at speed in mm/s"

i.e.

create_drive_straight(500);
sleep(1);
create_stop();

If it turns out battery level affects create accuracy, I am wondering if teams in the past have tried using get_create_battery_charge or its derivatives to offset the wheel speeds so that the create will always move straight?

Sorry this is turning into a programming thread now
- Ulzee

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 7 years 18 weeks ago.

SEAL491: Two answers to your question.

First, the Create always seemed to report a full battery when I queried it, until about 5 minutes before it was completely depleted (at which point it showed a very low charge). I'm not certain why this happens, but unless I was doing something wrong, it seems that the Create's ability to report battery charge should not be relied on.

Second, it's not really an accuracy problem, it's a problem with the nature of the Create's motor controller. When you instruct the Create to drive forward at 500mm/s, it actually passes 500mm/s to each wheel individually. Each wheel will attempt to drive at 500mm/s. This works when the battery is full. When the battery is sufficiently depleted that both motors can't drive at 500mm/s due to lack of power, the motor controller will push each motor to 100% power to attempt to keep them going as close to 500mm/s as possible. This, however, is not what the user probably wants, because driving both motors at 100% power won't drive in a straight line anymore (because all correction is eliminated), similar to how driving a Lego bot with the fd() command won't go straight. The fix is to make sure that the Create has enough power to drive both motors at the requested speed, plus a bit more for correction. This can either be done by (a) charging the battery, or (b) lowering the requested speed. Depending on your intended use, you may find that speed 300 is sufficient, and may use a lower enough amount of power that the motors won't get maxed out. Trial/error is probably your friend here.

As an aside, try at speed 100. If it still veers, then your problem is most likely not what I described, but something else, i.e. you should disregard my suggestion. If 100 works but 500 doesn't work, then I would try charging completely.

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS