Current Updates

This blog is an informal, and sometimes intermittent, record of my MEng project.

Friday, 17 February 2012

System Improvement

Today I did quite a bit of theory work and coding.  Most of this concerns the dead reckoning system.


Dynamics
I drafted a rigid body dynamics block-diagram, which might be useful if I want to use something like Simulink to simulate the system dynamics.  I managed to work through equations to determine the proportion of the robot's weight supported by each wheel, given the current movement conditions.

Because there are four fairly static wheels, the system ends up as three equations with four unknowns.  To get around this problem, and solve for the normal force on each wheel, I removed a castor from the problem - the choice of castor can be determined by deciding which will support the base in a given manoeuvre.  The equations are then solvable.

Dead Reckoning
I modified the dead reckoning routines to use more natural units than the existing code.  To do this, I stored the sine and cosine premultiplied by the wheel step length - this removes the need to multiply them up by the wheel step length for use in straight motion, saving two multiplications.

The angular unit used is still 1/65536 of a cycle, as this naturally wraps around in a 16-bit integer.

I worked out that the traversal of an arc, when approximated by the traversal of a chord, can be carried out by turning by half the total angle, proceeding forwards for the distance required (approximately the arc-length for small angles), then turning by another half of the total angle.  This is quite accurate, and removes the need for the iterative routine currently in use, saving lots of repeated multiplications.

I tested the system using the new routines - the heading was produced correctly, but the sine and cosine values weren't changing at the correct rate.  This was due to the use of incorrect gains in the sine / cosine generation routine.  To correct it, I added an extra constant, which represents the angle-step in radians * 65536.  This is used only in the trigonometry calculation, and not in the main heading counter.

Basic Navigation
To test out the system properly, I wrote a basic routine to move the robot around a simple course.  The routine relies on vector algebra to represent the sine and cosine of the angle toward the next target with respect to the robot's location and heading.  These are used to drive the motors.

I then found, during the test, that the system resets itself, seemingly at random.  I wondered if the 7805 was playing up (after having reverse-supplied it once before), but this didn't fix the issue.  A 'scope trace showed that there were moderate spikes on the supply lines.

On Monday, I'll rewire the supply lines on the board.

No comments:

Post a Comment

Comments are moderated. Sometimes it might take me a long time to get round to it, so please be patient.