Source code of the PSOC uController for the thesis project.
The motor can lift 500g. I need to add pull up resistors to the hall effect sensors so I can read the position of the rotor all the time.
Edit: using pull up resistors in the hall effect sensors ensures that they are allways turned on, so the rotor position control is always working like a charm :3
Commenting the global macros
//#define MANUAL_CONTROL
//#define NOT_MOVE_MOTOR
the motor follows the position reference (in turns) and stop when it reach the reference (with an error that can be fix moving the PID parameters).
If you only comment
#define MANUAL_CONTROL
//#define NOT_MOVE_MOTOR
the motor follows a speed reference given by the potentiometer.