Could you let us know exactly what kind of a motor control algorithm you are looking for ?
As you may be knowing, there are several motor control algorithms and knowing what you are looking for is important. Also, various other factors need to be considered before developing the code like the type of the motor, motor parameters, motor rating, control architecture that you want to use.
Before developing the motor control algorithm, please consider preparing a plan for the motor controller considering all the aspects some of which are mentioned above.
If you need any specific help on any issue that you face, I will be happy to help you