Fuzzy control++使用经验手册
- 格式:pdf
- 大小:525.27 KB
- 文档页数:7
Matlab模糊控制工具箱为模糊控制器的设计提供了一种非常便捷的途径,通过它我们不需要进行复杂的模糊化、模糊推理及反模糊化运算,只需要设定相应参数,就可以很快得到我们所需要的控制器,而且修改也非常方便。
下面将根据模糊控制器设计步骤,一步步利用Matlab工具箱设计模糊控制器。
首先我们在Matlab的命令窗口(command window)中输入fuzzy,回车就会出来这样一个窗口。
下面我们都是在这样一个窗口中进行模糊控制器的设计。
1.确定模糊控制器结构:即根据具体的系统确定输入、输出量。
这里我们可以选取标准的二维控制结构,即输入为误差e和误差变化ec,输出为控制量u。
注意这里的变量还都是精确量。
相应的模糊量为E,EC和U,我们可以选择增加输入(Add Variable)来实现双入单出控制结构。
2.输入输出变量的模糊化:即把输入输出的精确量转化为对应语言变量的模糊集合。
首先我们要确定描述输入输出变量语言值的模糊子集,如{NB,NM,NS,ZO,PS,PM,PB},并设置输入输出变量的论域,例如我们可以设置误差E(此时为模糊量)、误差变化EC、控制量U的论域均为{-3,-2,-1,0,1,2,3};然后我们为模糊语言变量选取相应的隶属度函数。
在模糊控制工具箱中,我们在Member Function Edit中即可完成这些步骤。
首先我们打开Member Function Edit窗口.然后分别对输入输出变量定义论域范围,添加隶属函数,以E为例,设置论域范围为[-3 3],添加隶属函数的个数为7.然后根据设计要求分别对这些隶属函数进行修改,包括对应的语言变量,隶属函数类型。
3.模糊推理决策算法设计:即根据模糊控制规则进行模糊推理,并决策出模糊输出量。
首先要确定模糊规则,即专家经验。
对于我们这个二维控制结构以及相应的输入模糊集,我们可以制定49条模糊控制规则(一般来说,这些规则都是现成的,很多教科书上都有),如图。
模糊逻辑跟踪控制
模糊控制的基本原理框图如下:
图1 模糊控制的基本原理框图
模糊控制器是模糊控制系统的核心,一个模糊控制系统的性能优劣主要取决于模糊控制器的结构、所采用的模糊控制规则、合成推理算法,以及模糊决策的方法等因素。
文本对应的程序,采用单变量二维模糊控制器,输入分别是 误差和误差的倒数,输出为控制量。
其中基模糊控制器结构如图2所示,模糊规则表如表1所示。
de dt
图2模糊控制器结构
表1 模糊规则表
在本仿真程序中,被控对象为:5
3245.235*10()+87.35 1.047*10G s s s s
=+
采样时间为1ms ,采用z 变换进行离散化,经过z 变换后的离散化对象为:
()(2)(1)(3)(2)(4)(3)(2)(1) (3)(2)(4)(3)
yout k den yout k den yout k den yout k num u k num u k num u k =------+-+-+-
其中,反模糊化采用“Centroid”方法,方波响应及控制器输出结果如图3和图4所示:。
第六章 模糊控制算法§6.1 §6.2 §6.3 §6.4 §6.5 §6.6 §6.7 模糊数学基础知识 模糊控制概述 精确量的Fuzzy化 模糊控制算法的设计 输出信息的Fuzzy判决 Fuzzy控制器查询表的建立 Fuzzy控制器实例1§6.1 模糊数学基础知识6.1.1 普通集合及其运算规则 6.1.2 Fuzzy集合 6.1.3 Fuzzy关系矩阵的运算26.1.1 普通集合及其运算规则:1.基本概念:UAB①论域:指在考虑一个具体问题时,先将议题局限在 一定范围内,这个范围称为论域,常用U表示; ②元素: 指论域中的每个对象,常用小写字母 a、b、c表示; ③ 集合:指对于一个给定论域,其中具有某种相同 属性的、确定的、可以彼此区别的元素的 全体,常用A、B、C、X、Y、Z等表示。
例:论域为U = { 1,2,3,4,5,6 } 偶数集合A = { 2,4,6 },奇数集合B = { 1,3,5 }32.普通集合的表示法:① 列举法(枚举法):当集合的元素数目有限时,可将其中的元素一 一列出,并用大括号括起,以表示集合。
例:论域为U = { 1,2,3,4,5,6 },则用列举法表示 偶数集合A = { 2,4,6 },奇数集合B = { 1,3,5 }② 描述法(定义法):当集合的元素数目无限时,可通过元素的定义来 描述 , 即A={x | p(x)}, 其中x为集合A的元素(x∈A), p(x)是x应满足的条件。
例:A = {x | 25 ≤ x ≤ 50 } ,U ={ x |x≥ 0的实数 }4③ 特征函数法:由于元素a与集合A的关系只能有a∈A和a∈A 两种情况,故集合A可以通过函数 1, a∈A CA(a)= 来表示。
0, a∈A CA(a)称为集合A的特征函数,它只能取0,1两个值。
FOTEK台湾阳明电机MT系列FUZZY+PID温度控制器台湾阳明电机股份有限公司(FOTEK CONTROLS )成立于1985年,是台湾自动化领域规模最大、品牌最著名的公司之一,擅长开发、生产各类民用传感与控制器材,主要产品有温度控制器、计数器、计时器、光电开关、接近开关、固态继电器、各种控制与保护器、磁簧开关等等。
FOTEK产品以优质可靠、规模经营、物美价廉著称,不仅在竞争激烈的台湾市场始终保持数一数二的市场占有率,而且被众多欧美著名品牌选为OEM加工合作伙伴,大量出口欧美亚等海外市场。
FOTEK近期正式推出的MT系列FUZZY(模糊智能)+PID温度控制器(产品图片见本刊内页彩色广告插页),性能稳定可靠,操作简单方便,控制精度可达到~度,代表了台湾本土自动化品牌在温度控制领域所能达到的最高水平,同时价格非常有竞争力,因而深受市场特别是大陆、台湾市场的瞩目。
为了让用户尽快了解MT系列FUZZY (模糊智能)+PID温度控制器,我公司根据大陆部分用户对MT系列的实践经验,结合MT系列原以英文、繁体字注释为主的使用说明书,重新编写、整理了有关使用说明,以符合大陆用户的阅读习惯。
我们欢迎读者来信、来电指教。
现将主要内容摘录如下:一、MT系列FUZZY+PID温度控制器基本参数、特性面板显示:双层4位数,红色液晶显示屏。
.温度显示范围:-99至19990C。
.输入:K/J/PT可选.15种报警模式可选.RS-485通讯可选.控制输出:电压12V/50mA.显示精度:满刻度的%+1个数字位.控制方式:PID+模糊智能调节或ON/OFF控制.使用环境温度:-100C至+75 0C.使用相对湿度:25%至85%RH.工作电压:90至265VAC 50/60HZ.P比例带范围:0—999.I积分时间范围:0—3999秒.D微分时间范围:0—3999秒.报警范围:-99—999.显示值取样时间:秒二、、如何进行温度报警值、上限值的设定和锁定1、设定步骤:控温状态下,按键3秒——显示LCK——输入“0”进入“解锁或无锁定”状态——按键3秒——显示LCK ——可选择输入“1”或“2”进行分别设定:A、如选“1”——按键——显示SLH,可直接设定温度上限值(即SV值)B、如选“2”——按键——显示AL1报警值设定——按键——显示AL2报警值设定——按键——显示SLH,可设定温度上限值(即SV值)2、锁定步骤:SV值设定后,按键3秒——显示LCK——输入“3”进行温控器锁定,经此设定后,所有SV、AL设定值被锁定,可防止非授权人员对设定值的更改;如果要重新设定,需要先运行解锁步骤。
模糊逻辑跟踪控制
模糊控制的基本原理框图如下:
图1 模糊控制的基本原理框图
模糊控制器是模糊控制系统的核心,一个模糊控制系统的性能优劣主要取决于模糊控制器的结构、所采用的模糊控制规则、合成推理算法,以及模糊决策的方法等因素。
文本对应的程序,采用单变量二维模糊控制器,输入分别是 误差和误差的倒数,输出为控制量。
其中基模糊控制器结构如图2所示,模糊规则表如表1所示。
de dt
图2模糊控制器结构
表1 模糊规则表
在本仿真程序中,被控对象为:5
3245.235*10()+87.35 1.047*10G s s s s
=+
采样时间为1ms ,采用z 变换进行离散化,经过z 变换后的离散化对象为:
()(2)(1)(3)(2)(4)(3)(2)(1) (3)(2)(4)(3)
yout k den yout k den yout k den yout k num u k num u k num u k =------+-+-+-
其中,反模糊化采用“Centroid”方法,方波响应及控制器输出结果如图3和图4所示:。
谷夫道Pungo双Z轴控制系统版本号V1.0操作手册安全须知本节叙述有关CNC装置使用的安全预防措施。
用户必须遵守这些预防措施以保证配置有CNC的机床的安全操作,这是非常重要的。
注意有些预防措施只与一些特定的功能相关,因此对某些CNC装置是不可用的。
操作者还必须遵守由机床厂商提供的说明书中指明的与机床有关的安全预防措施。
操作者必须在完全熟悉本说明书以及由制造厂商提供的相关说明书的内容后,才能操作机床或编制程来控制机床。
一般的警告和注意1.零件加工前,一定要首先检查机床的正常运行。
加工前,一定要通过连续仿真保证机床正确工作。
例如利用单段执行,进给倍率,或手轮引导等,且在机床上不装工件和刀具时检查机床的正确运行。
如果未能确认机床动作的正确性,机床可能出现错误动作,有可能损坏工件、机床或伤害用户。
2.操作机床之前,请仔细地检查输入的数据。
如果使用了不正确的数据,机床可能错误动作,有可能引起工件的损坏、机床本身的损坏或使用户受伤。
3.确保指定的进给速度与想要进行的机床操作相适应。
通常,每一台机床都有最大许可进给速度。
合适的进给速度根据不用的操作而变化。
请参阅机床厂提供的说明书来确定最大的进给速度。
如果没有按正确的速度进行操作,机床有可能发生错误动作,从而引起工件或机床本身的损坏,甚至伤及用户。
4.当使用刀具补偿功能时,请仔细检查补偿方向和补偿量。
使用不正确的指定数据操作机床,机床可能发生错误动作,从而引起工件或机床本身的损坏,甚至伤及用户。
C内部的参数都是机床厂设置的,通常不需要修改,当必须修改参数的时候,请确保改动参数之前对参数的功能有深入全面的了解。
如果不能对参数进行正确的设置,有可能引起机床的错误动作,可能损坏工件、机床本身或伤害用户。
6.在软件启动以后,请不要随意触碰键盘上的键。
键盘上很多键被指定为软件的快捷键,按下这些键,可能使机床处于某种状态。
7.本说明书叙述的某些功能,对特定机床实际上并不适用。
2012 FMP Inc. All Rights Reserved Product Manual v1.0What’s this Freq knob?..you ask.Turn it Clockwise and a (Patent Applied For) circuit adds as much as 20db of active narrow band juicy MIDRANGE right where it does the most good, it‘s like installing a wah-wah right where the distortion is being generated. But unlike turning on your wah-wah along with a distortion pedal, with the ‘Freq. the bass and treble frequencies don't disappear...Very unique, and not to be confused with a simple active or passive midrange control tacked on to the end of the circuit, as is the case with all other pedals you’ve tried with a “Mid” control. Adding the ‘Freq’s midrange imparts WAY more sustain and lets you easily place the guitar in the mix where you want it, irrespective of volume.....soundman's not going to bury you anymore. Easily get sounds ranging from Jimmy Page’s finest to Michael Schenker, all the way to Brian May. The secret Freq is allowing me to get an unbelievable range of sounds in my recording studio...let me know what it does for your sound.sincerely,Michael Fuller/President Secret Freq.Congratulations on your purchase of the2012 FMP Inc. All Rights Reserved FeaturesTrue Bypass On/Off switch (see #7) This is the best switch in the world…the Fulltone-made 3PDT footswitch.The pedal is ON when the bright Red L.E.D. (see #10) is lit up...the pedal is bypassed when this light is OFF.Distortion Knob: (see #2) Turn this Clockwise (CW) for more distortion, keep it below 10 0‘clock for cleaner soundsand for overdriving your favorite amp. Clean-Boost sounds can be attained by lowering this knob almost full CCW,and turning up the “Volume” knob.Volume Knob: (see #1) This knob controls the amount of signal that exits the pedal. The ‘Freq. has about 30db ofavailable gain, more than most distortion or overdrive pedals offer, so don’t be surprised if you end up running theVolume knob at only around 9 o’clock and are still getting a tremendous volume boost.Freq knob: (see #3) This is the magic Midrange knob! Set Full counter-clockwise (CCW) for a pedal that has a transparentsound and not a lot of Midrange. Now turn up the Freq knob and on comes the wah-wah-like midrange, the volume will increase tremendously in the midrange frequencies only....very different from other pedal’s midrange controls in thatyou can get infinite sustain with relatively low Distortion settings!Highs Knob: (see #4)This is a “Hi-Cut” function only, meaning that this knob only affects upper Treble frequencies. You’ll find that FULL CW position is very much neutral, depending on how much “Distortion” you are using. You should turn it CCW to around 10 o’clock for smoother high-gain lead sounds or turn it CW for more clarity.Input jack: (see #6) Plug the cable that is connected to your guitar into this jack. Note that the pedal will not power-on unlessyou have a cable plugged in to this jack.Output jack: (see #5) Plug the cable that goes to the amplifier into this jack. Sample Settings (with Amp set Clean)SRV-ish Rhythm tones Jimmy Page “Custard Pie” Brian May “We will Rock You”SpecificationsInput Impedance= 680K (good and high, like your guitar pickups)Output Impedance= as low as 10K (nice and low to so as not to load down your guitar cables or cause interference with other pedals.Max Voltage Gain= 60-80dBV (depending on settings, including the Freq knob)Current draw= 6 ma. (milliamps) which means a battery should last months, and 50ma,100ma, 200ma, 500ma, adapters are fine.DC Power Port: (see #8) You may run this pedal on the 9 volt battery (included) or on any voltage between 9 and 18 Volts DC as long as the adapter is (standard) 2.1mm x 5.5mm barrel plug with “Negative to Center Pin” configuration. (as illustrated by the following diagram)To access the battery remove all four Thumbscrews (see #9) from the sides of the pedal and pull the housing apart. Replace battery, put housing back together and re-tighten all four screws. Unplug guitar cable from INPUT when not in use to prolong battery life but If you have an adapter plugged in to the DC outlet there is no need to unplug the guitar cable from the INPUT because our DC outlet is True-Bypass and disconnects the battery supply line, thus keeping the battery fresh. The Fulltone FPS-1 is a great 9VDC regulated wall wart adapter. As far as pedalboard power supplies, we have always recommended ours and the Voodoo Lab products....nothing’s changed, beware, there are some crappy power supplies being sold as “Pro product out there!Warranty Fulltone products carry a Limited 5 year Warranty to the original owner with proof of purchase that the product was bought from an Authorized Fulltone Dealer. There is no need to register your product, simply keep a copy of your original sales receipt. The Warranty covers failure due to manufacturing errors only and is void if any mod or repair is performed by anyone other than Fulltone AND/OR if we deem that any operator-caused abuse or damage has occurred, for example; the use of an incorrect power supply, a dropped pedal, water damage, etc. Batteries are not warranty-covered and Customer is always responsible for all shipping costs both to and from Fulltone. Do not attempt to call Fulltone, instead, all Repair issues are handled via email to troubleshoot the possible problem and (after troubleshooting) for the scheduling of Warranty Repair. After we have deemed that a repair is necessary, we will email you an Acrobat PDF copy of our ReturnAuthorization Form (RA Form) and print it out, fill out all information, and include it with the device you are sending. Fulltone Musical Products Inc. is not responsible for and injuries and/or damages related to the use of our productsFulltone Musical Products Inc.11018 Washington Blvd. Culver City, CA 90232for more info and expanded information/videos go to and/or /fulltoneSales related questions email ******************Repairs/Technical related questions email *****************Features Diagram 19324510967899。
Technical Manual0xEAE FuzzRevision BMay23,2023John W Snyder1IntroductionThank you for purchasing the0xEAE Fuzz,the second collaboration pedal from Electronic Experiments and Obstructures.This manual is an in-depth guide for properly understand-ing and enjoying your pedal.Below is a bit of context.If you would like to skip ahead to how the pedal works,look for the Detailed Operating Instructions section below.The aesthetic format of the0xEAE Boost has become a blank canvas for the realization of other auditory power tools.With more utilitarian needs addressed,we set our sights towards wilder and weirder sounds.We stripped away any pretense of transparency or fidelity in a brute force,single-minded pursuit of extreme fuzz.The0xEAE foundation consists of an over-built power supply and a robust buffered relay bypass scheme.The fuzz circuit is built on this framework.From a conceptual standpoint its design is starkly minimal:at its core,cascaded op amp gain stages attempt to amplify the signal by a factor of10000(80dB),failing gloriously in the process.At the input is a lightly resonant high pass filter controlled by the Weight slider,which dramatically alters the feel of the gain stages from sharp to sludgy.But the real centerpiece of this fuzz is the Texture control,which blends an analog octave up into the input of the fuzz.By using a precision full-wave rectifier,the signal is folded on itself for an extremely prominent2nd harmonic plus several other tonal and atonal artifacts.With this slider you can get some-thing approximating a classic octave sound,or you can completely annihilate your signal with intermodulation products far beyond a vintage style octave fuzz.We are extremely proud of this pedal and hope you enjoy it.Thanks for reading!John Snyder(EAE)Matt Hall,Brian Johnson,Nathan Matteson(Obstructures)2Power and I/OTo power your0xEAE Fuzz,use a standard,reliable9VDC center-negative supply with a 2.1mm barrel tip.The pedal has a current draw of approximately200mA when active.An isolated power supply is preferred when using a signal chain consisting of multiple pedals. Recommended brands include Truetone™,Voodoo Lab™,Cioks™,etc.The power input is protected against over-voltage,under-voltage,and reverse polarity conditions up to±20V.The unit will not turn on if an incorrect power supply is used.Please note that all Electronic Audio Experiments products do not use batteries.Use standard1/4”patch cables to patch the0xEAE Fuzz into a pedal chain,as normal. The input jack is on the top right and the output jack is on the top left.3ControlsThe controls are as follows:Level Output volume level.Slide right to get loud.Very,very loud.Texture Slide right to blend in an analog octave up at the input of the fuzz circuit.Low settings add broken harmonics,high settings add a strong2nd harmonic with harsh overtones and sub-bass artifacts.Gain Primary gain stage.Slide right to add gain up to an irresponsible+80dB.For conven-tional sounds,keep below halfway.This control is not for the meek.Expect,embrace, and channel the noise.Weight Changes the cutoff of a high pass filter at the input to alter the attack and thickness of the fuzz.Slide left for a tight attack,slide right for crushing bass frequencies.Highly interactive with the Texture and Gain controls.Footswitch Activates the effect.The0xEAE Fuzz has soft-touch electronic switching with buffered bypass.When the effect is disengaged,your signal passes through a high-headroom op amp buffer to preserve its integrity over long cable runs and ensure a consistent high-impedance load to your in-strument.4Detailed Operating Instructions4.1Using the PedalWhen applying power to the Boost,allow the power supply about half a second to stabilize. The bypass LED will light up briefly and then turn off.To start,set the Texture and Weight sliders to the left position with Gain and Volume centered.Press the footswitch to engage the fuzz.The LED will glow violet to indicate the effect is active.The resulting tone should be a sharp,distorted sound with a sizzly high end.To thicken it up,increase the Weight slider and observe how the attack of the fuzz changes.Higher Weight settings will impart a slowness or sag to the dynamic response (especially noticeable on palm mutes)while also increasing the bass content and sustain. These controls go far beyond the typical ranges and well into noisy,unstable territory.If both the Weight and Gain sliders are up high,feedback and noise may result.For very bass heavy settings you may want to reduce the Gain to compensate.At lower settings of the Gain and Weight sliders,the fuzz circuit behaves more like a tight distortion sound which is also quite useful.And,of course,the Level slider is capable of extremely high output volumes if amp smashing is desired.The Texture slider deserves extra attention.Sliding right blends an analog octave up at the input of the circuit.Analog octave circuits are found in many kinds of fuzz pedals and are great for adding a searing,scrambled quality that occasionally sounds like a ring modulator.Our implementation is unique in a few ways,but can achieve some familiar sounds.Like any good analog octave circuit,it will freak out if you play chords.But,you can get a clear octave up if you use your neck pickup,roll back your guitar’s tone knob to zero,and play around the12th fret.It is worth nothing that,because the octave circuit is placed before the Gain control,the Texture and Gain sliders will interact in unique ways. For high Texture settings,it is usually worth reducing the Gain.Weight will also interact with the Texture setting.Cut bass for a thin,broken sitar sound,or add bass to overload the octave circuit and emphasize the sub frequency content it creates.For more on how this circuit achieves its distinctive sound,read below.4.2On Analog Octave CircuitsAnalog octave circuits have a unique way of operating,and I thought this manual would be a good opportunity to talk about that.The octave circuit in the0xEAE Fuzz consists of a precision full-wave rectifier.A rectifier circuit flips the negative side of a waveform in the positive direction.Math nerds will recognize this as the absolute value or|x|.If x is greater than or equal to zero,it is not changed.If it is less than zero,it is made positive.Rectifiers are traditionally used in power supplies to convert AC voltages to DC voltages.But,they’re a useful signal processing tool as well.The sonic impact is better shown than told.The graphs in Figure1show what happens to various input signals when they pass through the rectifier circuit.By“folding”the negative-going half of a sine wave up,the output strongly resembles a signal with twice the frequency of the input—in other words,an octave up.The first two graphs display this in action.It’s not a perfect octave up because the bottom side is stillFigure1:Impact of a rectifier on various signals.pointy(technical term),but this works pretty well for single notes that are as close to a pure tone(sine wave)as possible.As the input signal becomes more complex,the output breaks down in fascinating ways.By complex,I mean anything more than just a pure sine wave.This is why analog octave circuits are good for fuzz pedals,and why DSP is the preferred medium for pitch shifting effects where clean,predictable tracking is required. As an example we use a perfect5th as an input signal.The5th of a note is1.5times its frequency.Already,we can see some strange results.By applying the|x|function to two sine waves a perfect5th apart,new frequencies emerge.The dotted line in the last graph shows a frequency component equal to0.5times the fundamental—in other words,an octave down! (Technically,this more closely resembles the absolute value of two octaves down,which is sort of like one octave down,but you get the idea.)This is an example of how analog octave fuzzes can sound so massive with power chords.I speculate that this is why some classic units like the Foxx Tone Machine and the Univox Superfuzz have an aggressive notch filter at the output,because it helps to emphasize the sub frequencies that chords can generate. This analysis barely scratches the surface,but can hopefully give you an idea of why octavefuzzes sound so distinctive.5Suggested Settings(a)Speaker Rippage(b)Smelting Accident(c)Angle Grinder(d)Beyond RecognitionFigure2:Some settings to try.These should help familiarize you with the controls and how they interact.Level is just a suggestion and can be set to taste.Revision HistoryRevision ChangesB Fixed typos,updated incorrect image in suggested settings A Original Release。
1、命令窗口中输入fuzzy命令、得到以下界面
2、edit--add variable 此时便有经典的E EC 输入,U输出系统
3、输入输出变量的模糊化:即把输入输出的精确量转化为对应语言变量的模糊集合Edit--membership functions
在上面的界面上edit-Add-mfs
这个图表明的是添加隶属函数的个数为7.
添加完后会出现比较乱的线实际上是可以直接删掉的
Params填对应type的范围 range为总的范围
此处的type指的是nb nm ns zero ps pm pb
4、模糊推理决策算法设计:即根据模糊控制规则进行模糊推理,并决策出模糊输出量。
Edit--rules
5、最后步骤为解模糊
对输出模糊量的解模糊:模糊控制器的输出量是一个模糊集合,通过反模糊化方法判决出一个确切的精确量,凡模糊化方法很多,我们这里选取重心法。
然后Export to disk,即可得到一个.fis文件,这就是你所设计的模糊控制器
最后得到的fis文件如下:
说明:此文档就是为了说明步骤不代表控制真的就是这个样子的
(注:可编辑下载,若有不当之处,请指正,谢谢!)。
1.要使用Fuzzy control++模糊控制软件功能,需先安装SIMATIC NET,(二者都需取得授权)否则Fuzzy control无法找到S732.dll,从而不能运行。
如下图。
2.Fuzzy control++安装完成后,在Step7内,将模糊控制功能块添加到库,即:单击“文件”菜单中的“打开…”,在弹出的对话框中选择“库”选项卡,单击“浏览”按钮,在“浏览”对话框,展开“S7LIBs”目录,选择“FuzzyS7”后单击确定。
3. 在“HW config”中,单击工具栏上“网络组态”按钮,将PLC和计算机连接至同一MPI网络,并分配地址。
即:展开窗口右侧“stations”目录,双击PG/PC将它添至左侧窗口,双击PG/PC模块图形,在打开的对象属性对话框中,单击“接口”选项卡中的“新建”按钮,选择“MPI”接口类型,单击确定后选择一个MPI网络并设定地址返回“PG/PC属性”对话框。
4.在Fuzzy control运行前,需先在Step7内将包含FB30(模糊控制功能块)及背景数据块(此处为DB30)的程序编译无误,并确定计算机已与S7-300经MPI口建立了连接。
5.运行Fuzzy control++,单击“File”中的“New”,弹出的对话框如下图。
“Number of Inputs”:确定工程的输入变量的个数(最大为8)
“Number of Outputs”:确定工程的输出变量的个数(最大为4)
“Targetsystem”:选择模糊控制功能块的类型,此处选择s7-4k(不同类型所占空间不同)如下图。
6.确定好输入输出变量的个数及类后,单击确定。
在打开的项目窗口中依次双击各项图标(Input01,Input02,outpu01,if…then),设置具体参数(需根据工程实际数据设定)。
输入设定:
“Name Of Input”:设定输入变量的名称;
“Minimum”:设定输入变量下限;
“Maxmum”:设定输入变量上限;
“insert”:设定模糊控制输入量模糊化分段数;
“Delete”:在坐标系中单击某段先后,单击该按钮可删除该段;
“Corner Points”:选中坐标系中的某段后,可设置该段的各拐点。
输出设定:
控制规则:
“Change Inputs”:改变输入变量的位置;
“Table”:单击该按钮,以表格形式显示输入输出变量,如下图。
“Paste Empty”:在第一条规则前增加一空规则;
“Compress”:清除空规则;
“Matrix”:单击该按钮,以矩阵形式显示输入输出变量,如上一图。
7.在Fuzzy control++中,单击“Targetsystem”菜单中的“Manager”命令,弹出如下对话框。
“Installed targetsystem”下拉框显示当前
已安装的模块类型,双击某个类型或选中某个
类型单击“delete”,可删除该模块类型。
“DLL Selection”:单击该按钮,将Fuzzy
control安装目录中“target”文件夹下的DLL
文件选中,“Install targetsystem component”下
拉框将显示该DLL文件包含的模块类型;在其
中选中某模块类型,单击“insert”将其添加到
上面的下拉框。
8. 单击“Targetsystem”菜单中的“Selection”命令,可选择要连接的类型模块。
9. 单击“Test”菜单下的“Curve plotter”命令,将弹出曲线图仿真窗口,如下图。
10.根据仿真数据,反复修改控制规则直到初步满意。
11.单击“Targetsystem”菜单中的“Connect”命令,弹出“Connect”对话框。
“Browse”:单击该按钮,打开S732.dll
所在目录并选中该文件(它在SIMA TIC NET
安装目录的SimNetCom文件夹下)
在“Connection Parameter”选项组中可
选择PLC与计算机的通讯类型,这里选择
“MPI”。
“Target address”:PLC的MPI地址(前
面网络组态时分配给PLC的地址);
“RACK”:目标CPU的机架号;
“Slot”:目标CPU的插槽号;
“Number of the DB”:Step7程序中模
糊控制模块的背景数据块编号(一定要和程
序中的编号一致)。
12.(1)如果下载模糊控制规则前网络不通会弹出下面的信息框。
(2)通讯参数(address,rack,slot)错误会弹出下面信息框。
(3)“Number of the DB”设置与Step7程序中模糊控制模块的背景数据块编号不一致时会弹出下面信息框。
(4)Fuzzy control++与PLC连接成功后弹出下面的信息框。
13.单击“Targetsystem”菜单中的“Write”命令,将仿真好的模糊控制规则写入PLC 中模糊控制功能DB30的背景数据块中(此处为DB30)。
写成功后将弹出如下画面。
14.下图是写入模糊控制规则后的在线实时曲线图。
14.模糊控制库中FC30是输入模拟量的规格化功能程序;FC31是输出模拟量规格化功能程序。