X-CUBE-SPN1-20150128 example source code for one motor compiled under mbed.
Tested OK on Nucleo F401.
l6474.cpp is modified from original with defines in l6474_target_config.h to select the original behaviour (motor de-energised when halted), or new mode to continue powering with a (reduced) current in the coils (braking/position hold capability).
On F401 avoid using mbed's InterruptIn on pins 10-15 (any port). Beware of other conflicts!
L0 & F0 are included but untested.
Computes the speed profile according to the number of steps to move.
Parameters:
[in]
deviceId
(from 0 to 2)
[in]
nbSteps
number of steps to perform
Return values:
None
Note:
Using the acceleration and deceleration of the device, this function determines the duration in steps of the acceleration, steady and deceleration phases. If the total number of steps to perform is big enough, a trapezoidal move is performed (i.e. there is a steady phase where the motor runs at the maximum speed. Else, a triangular move is performed (no steady phase: the maximum speed is never reached.
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.