You can use the functions specified in the documentation of the library.
Get motor angle and velocity
/* when feelix.run() and feelix.move_feelix() or feelix.bldc->loopFOC()
* is called in the loop the angle can be directly accessed with:
*/
float angle // Radians
float angleDeg // Degrees
/* the velocity can be directly accessed with: */
float velocity
/* read value magnetic rotary encoder without using feelix.run()
* function is handled in feelix.run() no need to duplicate
*/
feelix.sensor->update();
feelix.sensor->getAngle();
feelix.sensor->getVelocity();
Control type options
/* motion control type can be updated at run time to alternate between different control types.
You only need to control these settings when writing your own custom effects with SimpleFOC */
feelix.bldc->controller = MotionControlType::torque;
feelix.bldc->controller = MotionControlType::angle;
feelix.bldc->controller = MotionControlType::velocity;
Move the motor
/* SimpleFOC function - running the low level torque control loop
* it sets the appropriate voltages to the phase pwm signals
* the faster you can run it the better
*/
feelix.bldc->loopFOC();
/* SimpleFOC function to update torque, velocity, or angle
* depending on the set MotionControlType
*/
feelix.bldc->move(value);
Move the motor to a specific position, speed value is optional.
/* function to let the motor move towards specific angle (blocking code)
* angle: angle in degrees
* speed: percentage 0.0 - 0.1 of max velocity
* threshold: accuracy target position (degrees)
* default: stop within 0.2 degrees from target area
*/
feelix.move_to(float angle, float speed, float threshold);
/* returns is set to TRUE while moving to desired positoin,
* and FALSE when position is reached
*/
feelix.MOVING;
PID controller settings (more )
For all possibilities, check out the complete documentation at