Hi Greg,
Thanks for posting this demo and for making it nice and clear... Would you like to add a short page about this demo in the
Example Category of the website? It would be great to have few more details about the motor used, its simulink model, and few curves of the closed loop response... or whatever you want... Musa could also contribute if he would like too...
Let me know (You may not have the right to create a new page on this wiki ; I will just create it and let you write...)
Few technical points about the simulink model you posted:
* Sampling time for all blocks is 10Khz except for delay blocks (1/z) which are at 5Khz. (It is very useful to use sample time colour :
Format ==> SampleTimeDisplay
* 10Khz is very fast for the calculation to be done using single. You may check using the
Calculus Time Step block that calculation are done within the 100us. This block will provide you with the calculation time. It's interesting also to get the free time you may have for others tasks... (You could get the numerical value of the Calculus Time Step block directly with the UART or with another PWM output)
More general question about the control scheme:
It seems that this motor is a big one (from the several amperes current you provide). I guess thus that its dynamics may be quite slow. Coupled with the very fast time step of 100us, I suspect the PWM output to be in fact use as an on/off signal (always saturate to PWMmax or to 0). i.e. it could be interesting to see if it this control scheme works when replacing the PWM output with a threshold followed by a binary Output PIN (Sliding mode).
On a similar subject, a sensorless controller for a tiny motor using Simulink with dsPIC is described in this article:
http://ieeexplore.ieee.org/xpl/freeabs_ ... er=4602072
Lubin