Use Wheel Encoders to Calibrate

For Formula AllCode users to discuss projects, programs, and any other issues related to the Formula AllCode robotics platform.

Moderators: Benj, Mods

fvc.alan
Posts: 7
Joined: Thu Sep 15, 2016 10:35 am
Been thanked: 1 time
Contact:

Use Wheel Encoders to Calibrate

Postby fvc.alan » Mon Mar 13, 2017 5:54 pm

Back to things not going in a straight line, any hints on how we can use the set motors command along with reading the wheel encoders to calibrate/adjust so we can make the Allcode go in a straight line?

Cheers,
Alan

User avatar
Benj
Matrix Staff
Posts: 14655
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4644 times
Been thanked: 4266 times
Contact:

Re: Use Wheel Encoders to Calibrate

Postby Benj » Tue Mar 14, 2017 11:06 am

Hello Alan,

Which command are you using to drive the robot?

Are you using the firmware mode or the API mode?

fvc.alan
Posts: 7
Joined: Thu Sep 15, 2016 10:35 am
Been thanked: 1 time
Contact:

Re: Use Wheel Encoders to Calibrate

Postby fvc.alan » Tue Mar 21, 2017 8:54 am

Hi Ben,

I want to use SetMotors so that everything isn't locked up while it's moving. I can get feedback from the wheel encoders, and think I know what to do with that info (I've never worked with things that move before!)
(Regarding the wheel encoders, is there a further API guide that isn't in the course book? I found that one by looking in the python code.)

Thing is, if the buggy is moving and I request the encoder values one at a time (left then right), the delay in communication means the values will never be correct. Is it possible to request both encoder values in a single command to get simultaneous values? This might allow me to perform what I'm thinking seems like a constant calibration to keep the buggy in a straight line.

That actually got me thinking further, if that did prove to be possible is it possible to do similar with the IR sensors? One of the issues when trying to drive round a maze is (I think) the fact that each sensor in turn needs to be queried over bluetooth, if they could be queried in a single command with a list/array returned that might speed everything up? Or is there already a way of doing this that I've missed?

Cheers,
Alan