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

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

Use Wheel Encoders to Calibrate

Post by fvc.alan »

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: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Use Wheel Encoders to Calibrate

Post by Benj »

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

Post by fvc.alan »

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

Post Reply