Hardware manual

52
bldctest for hi_cpu2 board we can also call function: pxmc_set_default_functions(pxmc_state_t
*mcs, pxmc_motor_kind_e motor). The first parameter is a pointer to a pxmc_state structure
which contains all necessary information about the motor. Second parameter is a value
describing which kind of the motor we are going to use in mcs. T
be a problem to have two kinds of motors connected to the board for example one can be
brushless motor and second a stepper motor. Nevertheless, it should be kept in mind that in
normal case the recommended is always to use pxmc_initialize().
Fig. 5.4-1. Example of a DC motor which
can be also connected to the board.
Now, the last step is just to call some functions which are responsible for movement of the
motor. These functions can be for example: pxmc_go which moves the motor to new position.
Another function is pxmc_spd, which is useful when we want to keep the motion with constant
speed. If the want to keep the power at the output at some constant value we can use:
pxmc_set_const_out. Whenever we want to stop the motor we can call pxmc_stop function. If
from some reason we want to set new actual and request position we can use the
pxmc_axis_set_pos function.
Additionally, for advanced usage we can connect some controller to the motor using function:
pxmc_connect_controller. To change generator we can use the following two functions:
pxmc_set_gen_prep and pxmc_set_gen_smth. First of them is used to prepare the motor to the
change of generator and second changes it in smooth way. It is important to note, that these
last two functions have to be called in the presented order. To check the sampling frequency we
can call pxmc_get_sfi_hz, and to make some changes in sampling frequency of PXMC subsystem
we should use: pxmc_sfi_sel. Additionally after defining the PXMC_WITH_DBG_HIST there are
also available some debug function for the motor: pxmc_dbgset, pxmc_dbg_gnr,
pxmc_dbg_ene_as, pxmc_dbg_histalloc, pxmc_dbg_histfree and pxmc_dbg_hist_t.
pu2 board.
At the end, it should be clearly point out that all of above functions are described in subsection
from 5.3.3 to 5.3.13.