Can anyone direct me to any links on how to implement a fuzzy controller for
a servo drive in dsPIC.

Can anyone direct me to any links on how to implement a fuzzy controller for
a servo drive in dsPIC.

Not particular to dsPIC, but check out Walter Bank's stuff: http://www.bytecraft.com/Fuzzy_Logic

He has a fuzzy PID controller on that page.

On Sat, 17 May 2008 20:15:13 -0400, Freelance Embedded Systems Engineer
wrote:

"The easiest way to describe Fuzzy Logic is as a tool that helps describe complex algorithms in an intuitive way."

PID algorithms aren't complex, and their behavior is often severely counter-intuitive until you've understood the math and flogged it a__ _lot_.__

As near as I can tell fuzzy logic is for problems that are severely nonlinear, difficult or impossible to analyze, and for which an 'intuitive' solution exists.

__
_After_ __you know traditional control inside and out is the time to go
mucking around in fuzzy controllers, for those corner cases that can't be
addressed the 'normal' way.

"The easiest way to describe Fuzzy Logic is as a tool that helps describe complex algorithms in an intuitive way."

PID algorithms aren't complex, and their behavior is often severely counter-intuitive until you've understood the math and flogged it a

As near as I can tell fuzzy logic is for problems that are severely nonlinear, difficult or impossible to analyze, and for which an 'intuitive' solution exists.

--

Tim Wescott

Control systems and communications consulting

Tim Wescott

Control systems and communications consulting

Click to see the full signature.

Fuzzy logic and other rule based controls are best for multi input multi output problems in which there are many "partial scenarios" which need to be recognized and controlled for. They are great if you have several inputs because the "partial cases" can span the inputs. The basic algorithm examines which partial cases are active, and the extent that they are active, then controls to that. It is possible to have very different responses in different areas of the operating space.

Michael

I agree that fuzzy logic is for those that want an intuitive solution but as Tim suggested the best solution may not be the intuitive one. I don't agree that fuzzy logic always the best for MIMO or non-linear solutions. If you are going to tweak parameters then fuzzy logic probably is best for those that don't want to truly understand their system. One can fine tune a fuzzy system by using a minimizing or optimizing routine. At that point I think fuzzy logic becomes more competitive with other methods that do the same. Are you prepared to writing an auto tuning system for the fuzzy logic? Most servo controllers have auto tuning. Servo motor systems are usually easily modeled and therefore easy to understand so some form of PID with feed forwards is usually the preferred method of control. I certainly don't think fuzzy logic is the best solution for a servo motor controller.

The real trick to a servo motor controller is the motion profile generator. The closed loop control is insignificant to the motion profile generator.

Peter Nachtwey.

wrote:

I agree that fuzzy logic is for those that want an intuitive solution but as Tim suggested the best solution may not be the intuitive one. I don't agree that fuzzy logic always the best for MIMO or non-linear solutions. If you are going to tweak parameters then fuzzy logic probably is best for those that don't want to truly understand their system. One can fine tune a fuzzy system by using a minimizing or optimizing routine. At that point I think fuzzy logic becomes more competitive with other methods that do the same. Are you prepared to writing an auto tuning system for the fuzzy logic? Most servo controllers have auto tuning. Servo motor systems are usually easily modeled and therefore easy to understand so some form of PID with feed forwards is usually the preferred method of control. I certainly don't think fuzzy logic is the best solution for a servo motor controller.

The real trick to a servo motor controller is the motion profile generator. The closed loop control is insignificant to the motion profile generator.

Peter Nachtwey.

Thank you for a detailed answer. Can you explain a little more about motion profile generator. I dont know what that is.

I agree that fuzzy logic is for those that want an intuitive solution but as Tim suggested the best solution may not be the intuitive one. I don't agree that fuzzy logic always the best for MIMO or non-linear solutions. If you are going to tweak parameters then fuzzy logic probably is best for those that don't want to truly understand their system. One can fine tune a fuzzy system by using a minimizing or optimizing routine. At that point I think fuzzy logic becomes more competitive with other methods that do the same. Are you prepared to writing an auto tuning system for the fuzzy logic? Most servo controllers have auto tuning. Servo motor systems are usually easily modeled and therefore easy to understand so some form of PID with feed forwards is usually the preferred method of control. I certainly don't think fuzzy logic is the best solution for a servo motor controller.

The real trick to a servo motor controller is the motion profile generator. The closed loop control is insignificant to the motion profile generator.

Peter Nachtwey.

Thank you for a detailed answer. Can you explain a little more about motion profile generator. I dont know what that is.

On Sun, 18 May 2008 10:52:51 +0200, Incubus wrote:

Most servo systems are divided into a more or less linear PID controller and a motion profile generator. The reason is that a linear PID controller doesn't 'understand' that there's a limited output available. This means that if you just tell the PID controller to go from point A to point B it'll 'put on the brakes' way too late, because it 'thinks' that it can ask for 100 (or 1000) times more acceleration than the motor is actually capable of.

A motion profile generator 'understands' the motor's limited acceleration and other system limits. It takes the "move to B" command and generates a vector of intermediate targets for the PID controller that will bring the motor to a stop without exceeding the motor's acceleration capability, and often without exceeding some desired jerk parameter.

Do a web search on "trapezoidal velocity profile" and you'll get the basics.

Note that for about the same overall software complexity, but potentially higher processor loading and__ _definitely_ __higher requirements on the guy
analyzing the software, you can build an awareness of the motor's
acceleration and jerk limits into your PID controller. This has a number
of advantages, particularly if you are concerned about the mechanism
partially binding in the middle of a move or if you are constantly
updating the position target before the previous move has finished.

Most servo systems are divided into a more or less linear PID controller and a motion profile generator. The reason is that a linear PID controller doesn't 'understand' that there's a limited output available. This means that if you just tell the PID controller to go from point A to point B it'll 'put on the brakes' way too late, because it 'thinks' that it can ask for 100 (or 1000) times more acceleration than the motor is actually capable of.

A motion profile generator 'understands' the motor's limited acceleration and other system limits. It takes the "move to B" command and generates a vector of intermediate targets for the PID controller that will bring the motor to a stop without exceeding the motor's acceleration capability, and often without exceeding some desired jerk parameter.

Do a web search on "trapezoidal velocity profile" and you'll get the basics.

Note that for about the same overall software complexity, but potentially higher processor loading and

--

Tim Wescott

Control systems and communications consulting

Tim Wescott

Control systems and communications consulting

Click to see the full signature.

I general that is true but there are tricks. I have used them many times in my example .pdf files. A good motion controller should be able to handle the step change in position. You never know what the user is going to try to do.

'Understands' is OK but actually most controllers expect you to specify the acceleration and deceleration in the command and the target generator uses that information to compute a motion profile.

A second order motion or trapezoidal velocity profile has infinite jerk at the end of the motion segments. A third order motion profile allows one to specify the jerk limit. The jerk should never exceed this limit.

I consider 3rd order to be the bare minimum. A third order motion profile is much more difficult than a second order motion profile. http://www.google.com/search?q=3rd+order+motion+profile&rls=com.microsoft:en-us:IE-SearchBox&ie=UTF-8&oe=UTF-8&sourceid=ie7&rlz=1I7GGLR

Tim, you are not being clear here. Are you talking about limiting the control output, feed forwards, what? If I were to guess you make sure the control output doesn't go above the feed forward output plus a percentage.

If you have a proper target generator then one can quickly detect problems by monitoring the following error and the control output. The control will normally do this for you automatically.

Incubus, is going to have a lot of fun with this.

Peter Nachtwey

<Cited: Page 2>

•I like Fuzzy Logic as an alternative to probability theory, especially in applications involving man-machine interactions •Fuzzy feedback control methods represent inferior engineering practice, often by people that never bothered to learn control theory and design •Fuzzy feedback control is a vacuous technology for the design of high-performance control systems •Fuzzy control methods are “parasitic;” they simply implement trivial interpolations of control strategies obtained by other means •Theological arguments about “fuzzification”, “defuzzification”, nonlinear control, and inherent robustness are simply nonsense •Fuzzy feedback control has failed to capture and utilize alternative means in dealing with uncertainty using Fuzzy Sets and Fuzzy Logic •Prof. Zadeh should communicate to his disciples the sorry state of affairs in fuzzy feedback control and tell them to “shape-up”

</Cited>

http://fuzzy.iau.dtu.dk/download/athans99/athans99.ppt

--

Regards/Grüße http://home.arcor.de/janch/janch/menue.htm

Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de

Regards/Grüße http://home.arcor.de/janch/janch/menue.htm

Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de

Click to see the full signature.

### Measurement validation for process signals

- - next thread in ⧑ Industrial Control Group

### Transfer Function of an Observer designed by Kalman filter

- - previous thread in ⧑ Industrial Control Group

### Walter Dreiger

- - newest thread in ⧑ Industrial Control Group

### Druk 3D

- - the site's newest thread. Posted in Engineering Science (Polish)

### statische Aufladungen

- - the site's last updated thread. Posted in ⏚ Electrical Engineering (German)