Hardware manual

59
Last two files: Makefile and Makefile.omk have descriptions of the rules for compilation and are
used by make command. In Makefile.omk we should list all files which we use in our driver. For
example:
default_CONFIG = CONFIG_PXMC_VARIANT=bldctest
lib_LIBRARIES = pxmcbsp
pxmcbsp_SOURCES = bldctest.c pt.c
renamed_include_HEADERS += bldctest.h->pxmcbsp.h
renamed_include_HEADERS += pxmc_config_h8mirosot.h-
>pxmc_config.h
First line describes the variant of the compilation and as an option was described in subsection
6.2. The same is with lib_LIBRARIES. In pxmcbsp_SOURCES we list all source files which are
needed by our driver. In this case we use bldctest.c and pt.c. Next lines which define:
renamed_include_HEADERS informs that we are going to change the names of header files to
some standard one. Thanks that, later in some external project we can just include pxmcbsp.h,
what gives us opportunity to compile one application for different platforms without making
changes in the code.
6.5. Work with Eurobot.
My work with Eurobot was very closely correlated with work with hi_cpu2 board. Because of
that, all changes described in previous subsection are also valid for this point. Only one
difference is that in Eurobot we used different parameters for PID controller and also phase
tables were different. Namely, in this case we used phase tables with length equal to 2000 (for
motors on the robot) and 4000 (for motors used for testing).
Another work, which I made for this project, was to design some odometry for the robot. My
original solution was created in Matlab and can be described as below:
alfa=alfa+((vl-vr)*dt*O)/l; % [rad]
alfa=mod(alfa,2*pi);
xl=xl+vl*O*dt*sin(alfa);
yl=yl+vl*O*dt*cos(alfa);
xr=xr+vr*O*dt*sin(alfa);
yr=yr+vr*O*dt*cos(alfa);
Where: O - perimeter of the wheel, l distance between two wheels, dt difference in time
between two measurements, vl speed of the left wheel, vr speed of the right wheel, alfa
angle in which robot is pointed, xl new position of the wheel, xr new position of the right
wheel.