P only = Fuzzy Logic?

Thread Starter

MaxHeadRoom

Joined Jul 18, 2013
30,665
I see. But can the error really be zero? If the error is a 32bit floating point, it can be as low 10^-38 or something, and practically you may encounter a situation where it never will be EXACTLY zero.

Anyway, i took a quick glance at the thesis. And even though it works, and i think you can actually prove that it works, it still doesn't seem like an optimal solution.
As the author says, there are some flaws, I am working on improving it by using slightly different routines and Pic usage, also higher resolution pulse which allows for much shorter duration between reads.
Obviously not as good as a true PID, but I am aiming for a live able result.
Max.
 

crutschow

Joined Mar 14, 2008
38,519
But can the error really be zero? If the error is a 32bit floating point, it can be as low 10^-38 or something, and practically you may encounter a situation where it never will be EXACTLY zero.
No, but an analog PID approach is never EXACTLY zero either due to offsets and other errors.
It engineering you get the error low enough to meet the specs and that's where you stop (or shoot the engineer). ;)
 

kjj

Joined Mar 30, 2018
31
As the author says, there are some flaws, I am working on improving it by using slightly different routines and Pic usage, also higher resolution pulse which allows for much shorter duration between reads.
Obviously not as good as a true PID, but I am aiming for a live able result.
Max.
Well, you said it yourself, not as good as PID. So why not implement a proper PID controller? Modelling of a DC motor is very simple, and you should be able to tune all the PID parameters from a simple simulation in Simulink or other programs. Quick tip: velocity control of DC motor -> PI controller. Position control of DC motor -> P controller.

No, but an analog PID approach is never EXACTLY zero either due to offsets and other errors.
It engineering you get the error low enough to meet the specs and that's where you stop (or shoot the engineer). ;)
True, but irrelevant. The control signal is still proportional to the error. As an example, position control for a DC motor: if the error is 10 nanometers, and the control signal is 10 nanovolt, we would consider that the reference is met. In MaxHeadRooms case he has conditional statements: if error>0, do something, if error=0, do nothing. In this case the "do nothing" might never be executed!
 

nsaspook

Joined Aug 27, 2009
16,328
As the author says, there are some flaws, I am working on improving it by using slightly different routines and Pic usage, also higher resolution pulse which allows for much shorter duration between reads.
Obviously not as good as a true PID, but I am aiming for a live able result.
Max.
Interesting. I used a like control system for a positioning system in the track_motor function a while back. The error signal from the set-point was a turns count for a encoder or a voltage differential for positioning pots instead of speed but the 'fuzzy' logic was much the same because it was emulating a primitive motor controller. It required quite a bit of code fine-tuning to make the control system smooth and accurate.
https://forum.allaboutcircuits.com/threads/mandm.75507/

https://www.flickr.com/photos/nsaspook/8121852614/in/album-72157630632759744/
https://www.flickr.com/photos/nsaspook/16565065561/in/album-72157630632759744/
 

Thread Starter

MaxHeadRoom

Joined Jul 18, 2013
30,665
Looks pretty impressive, not quite as tight as a true (PID) CNC machine, but for 'Fuzzy Logic' and a simple positioning application, Nice.
Max.
 

cmartinez

Joined Jan 17, 2007
8,766
Interesting. I used a like control system for a positioning system in the track_motor function a while back. The error signal from the set-point was a turns count for a encoder or a voltage differential for positioning pots instead of speed but the 'fuzzy' logic was much the same because it was emulating a primitive motor controller. It required quite a bit of code fine-tuning to make the control system smooth and accurate.
https://forum.allaboutcircuits.com/threads/mandm.75507/

https://www.flickr.com/photos/nsaspook/8121852614/in/album-72157630632759744/
https://www.flickr.com/photos/nsaspook/16565065561/in/album-72157630632759744/
Very, very nice work ... :)
 
Top