妯℃嫙閲忔爣瀹氬簱 AnalogFilter Library-CODESYS璧勬簮涓嬭浇鍖-閰峰痉缃 - CoDeSys杞欢鏁欑▼涓嬭浇,CoDeSys宸ユ帶璧勮闂ㄦ埛
HSC6490-cn涓浗鍒堕狅紝涓浗鑺瘇
鏌ョ湅: 4036|鍥炲: 5

妯℃嫙閲忔爣瀹氬簱 AnalogFilter Library

[澶嶅埗閾炬帴]
  • TA鐨勬瘡鏃ュ績鎯
    鎿︽睏
    2019-8-13 14:13
  • 绛惧埌澶╂暟: 32 澶

    [LV.5]甯镐綇灞呮皯I

    鍙戣〃浜 2018-7-4 22:27:37 | 鏄剧ず鍏ㄩ儴妤煎眰 |闃呰妯″紡
    CUT 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    鎶婅緭鍏ュ艰繘琛岄澶勭悊锛岃皟鏁存枩鐜囷紝娑堥櫎涓ょ闈炵嚎鎬у奖鍝嶃傝皟鏁存晥鏋滆鍥撅細
    640.jpg
    鍔熻兘鍧楀涓嬪浘锛

    640 (1).jpg
    杈撳叆锛氾紙1InputUINT 鍨嬶紝瑕佸鐞嗙殑淇″彿銆

    锛2锛塒AR_InputILowLimit锛孶INT 鍨嬶紝鐢ㄦ潵鎺у埗杈撳嚭鐨勪笅闄愩 褰
    Input<=256*PAR_InputILowLimit 鏃惰緭鍑轰负 0銆
    锛3锛塒AR_InputHighLimit锛孶INT 鍨嬶紝鐢ㄦ潵鎺у埗杈撳嚭鐨勪笂闄愩傚綋
    Input>=256*PAR_InputHighLimit 鏃惰緭鍑哄氨涓 0銆
    杈撳嚭锛氾紙1锛塐utput锛孶INT 鍨嬶紝澶勭悊瀹岀殑淇″彿銆
    锛2锛塋owLimit锛孊OOL 鍨嬶紝Input<=256*PAR_InputILowLimit 鏃 LowLimit 涓 TRUE銆
    锛3锛塇ighLimit锛孊OOL鍨嬶紝Input>=256*PAR_InputHighLimit鏃禜ighLimit涓篢RUE銆
    HP 鍔熻兘鍧

    鍔熻兘鎻忚堪锛
        璁剧疆涓涓鍖猴紝鎶婃鍖轰互鍐呯殑鍊奸兘璁句负 0銆傚姛鑳藉鍥撅細

    640 (2).jpg
    鍔熻兘鍧楀涓嬪浘锛
    640 (3).png                      
    杈撳叆锛氾紙1InputUINT 鍨嬶紝杈撳叆淇″彿銆
       锛2锛塒AR_CutLimit锛孶INT 鍨嬶紝姝诲尯鎺у埗鍙傛暟銆傚綋 Input<=65535*PAR_CutLimit%鏃惰緭鍑轰负 0銆
    杈撳嚭锛氾紙1锛塐utput锛孶INT 鍨嬶紝澶勭悊瀹岀殑淇″彿銆
    JoyFilter 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    JoyFilter 鍧楁槸涓涓弻鍚戠殑妯℃嫙閲忔爣瀹氬潡锛屼篃灏辨槸璇村畠瀵硅緭鍏ョ殑妯℃嫙閲忚繘琛岄澶勭悊锛岃緭
    鍑鸿寖鍥磋皟鏁翠负-32767~32767銆
    鍔熻兘鍧楀涓嬪浘锛
    640 (4).jpg

    杈撳叆锛1AnalogInputUINT 鍨嬶紝妯℃嫙閲忕殑杈撳叆淇″彿銆
    锛2锛塂I_JoystickDirSwitchPOS锛孊OOL 鍨嬶紝姝e悜寰姩寮鍏炽傚綋
    PAR_DirSwitchDiagnosticNotUse 涓 FALSE 鏃讹紝姝ゆ椂鍙堟墜鏌勫悜姝e悜绉诲姩锛岄偅涔堝彧鏈夋鍚戝井鍔ㄥ紑鍏 TRUE锛孫UTPUT 鎵嶄細鏈夎緭鍑恒
    锛3锛塂I_JoystickDirSwitchNEG锛孊OOL 鍨嬶紝璐熷悜寰姩寮鍏炽傚綋
    PAR_DirSwitchDiagnosticNotUse 涓 FALSE 鏃讹紝姝ゆ椂鍙堟墜鏌勫悜璐熷悜绉诲姩锛岄偅涔堝彧鏈夎礋鍚戝井鍔ㄥ紑鍏 TRUE锛孫UTPUT 鎵嶄細鏈夎緭鍑恒
    锛4锛塒AR_NegFull锛孶INT 鍨嬶紝璐熷悜杈撳叆鐨勮皟鑺傚弬鏁般傚彇鍊艰寖鍥达細0锝255锛屼富瑕佺敤
    浜庡綋璐熷悜杈撳叆鏈澶ф椂锛岃皟鑺傚弬鏁颁娇寰 OUTPUT 涔熶负璐熷悜鏈澶с
    锛5锛塒AR_POSFull锛孶INT 鍨嬶紝姝e悜杈撳叆鐨勮皟鑺傚弬鏁般傚彇鍊艰寖鍥达細0锝255锛屼富瑕佺敤
    浜庡綋姝e悜杈撳叆鏈澶ф椂锛岃皟鑺傚弬鏁颁娇寰 OUTPUT 涔熸璐熷悜鏈澶с
    锛6锛塒AR_Zero锛孶INT 鍨嬶紝闆惰緭鍏ョ殑璋冭妭鍙傛暟銆傚彇鍊艰寖鍥达細0锝255锛屼富瑕佺敤浜庡綋
    鎵嬫焺鍦ㄩ浂浣嶆椂锛屽嵆闆惰緭鍏ユ椂锛岃皟鑺傚弬鏁颁娇寰 OUTP UT 涔熶负闆躲
    锛7锛塒AR_DeadBand锛孶INT 鍨嬫鍖鸿缃弬鏁般傚彇鍊艰寖鍥达細0锝100銆傚綋杈撳叆杩涘叆鍙
    鏁拌缃寖鍥达紝杈撳嚭涓洪浂
    锛8锛塒AR_NegProgression锛孲INT 鍨嬨傚彇鍊艰寖鍥达細-100锝100,璁剧疆璐熷悜杈撳嚭缂撳啿鏇茬嚎搴︼紝鎵嬫焺璐熷悜杈撳嚭鍊肩浉瀵逛簬杈撳叆鍊肩殑涓涓搷搴旀洸绾匡紝鏇茬嚎濡傚浘锛
    640 (5).jpg
    锛9锛塒AR_PosProgression锛孲INT 鍨嬨傚彇鍊艰寖鍥达細-100锝100锛岃缃鍚戣緭鍑虹紦鍐叉洸
    绾垮害锛屾墜鏌勬鍚戣緭鍑哄肩浉瀵逛簬杈撳叆鍊肩殑涓涓搷搴旀洸绾裤
    锛10锛塒AR_MinErrorDifference锛孶INT 鍨嬶紝鍙栧艰寖鍥达細0锝100锛岃缃嚭閿欒寖鍥达紝
    褰撹緭鍏ヨ秴鍑鸿寖鍥存椂锛屾縺娲 ErrorHigh 鎴 ErrorLow 寮鍏筹紝骞朵娇杈撳嚭涓洪浂銆
    锛11锛塒AR_FaultOnDelay锛孶INT 鍨嬶紝鍙栧艰寖鍥达細0锝255锛岃繃杞藉欢鏃躲
    锛12锛塒AR_DirSwitchDiagnosticNotUse锛孊OOL 鍨嬶紝姝 鍙傛暟涓 TRUE 鏃讹紝寰姩寮鍏
    鏃犳晥锛屼负 FALSE 鏃讹紝寰姩寮鍏虫湁鏁堛
    杈撳嚭锛
    锛1锛塐utputEable锛孊OOL 鍨嬶紝杈撳嚭浣胯兘锛屼负 TRUE 鏄潡鎵嶄細鏈夎緭鍑恒
    锛2锛塐utput锛 INT 鍨嬶紝璋冩暣鍚庣殑淇″彿閲忥紝杈撳嚭鏁板艰寖鍥-32767锝32767 銆
    锛3锛塃rrorHigh锛孊OOL 鍨嬶紝褰撹緭鍏ヨ秴鍑 PAR_Full +5000 鑼冨洿鏃讹紝 ErrorHigh 涓
    TRUE锛岃緭鍑虹疆闆躲
    锛4锛塃rrorLow锛孊OOL 鍨嬶紝杈撳叆瓒呭嚭 PAR_Zero鈥揚AR_MinErrorDifference 鑼冨洿锛
    ErrorHigh 涓 TRUE锛屽苟鎶婅緭鍑虹疆闆躲
    锛5锛塉oystickDirSwitchPOSMissing锛孊OOL 鍨嬶紝姝e悜寰姩寮鍏冲嚭閿欐椂锛屽间负 TRUE銆傦紙6锛塉oystickDirSwitchNEGMissing锛 BOOL 鍨嬭礋鍚戝井鍔ㄥ紑鍏冲嚭閿欐椂锛屽间负 TRUE銆
    锛7锛塉oystickDirSwitchPOSAndNEGOn锛孊OOL 鍨嬶紝姝c佽礋鍚戝井鍔ㄥ紑鍏冲悓鏃朵负 TRUE 鏃讹紝鍊间负 TRUE銆
    JoystickAllnputOutOfRange 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    鏈姛鑳藉潡鏄敤鏉ュ疄鐜板涓涓ā鎷熼噺杈撳叆鐨勮瀵熴
    鍔熻兘鍧楀涓嬪浘锛
    640 (6).jpg
    杈撳叆锛
    (1) Allnput锛孶INT 鍨嬶紝闇瑕佽瀵熺殑妯℃嫙閲忎俊鍙枫
    (2) PAR_PosFull锛孶INT 鍨嬶紝姝e悜鏈澶ц皟鏁村弬鏁般
    (3) PAR_NegFull锛孶INT 鍨嬶紝璐熷悜鏈澶ц皟鏁村弬鏁般
    (4) PAR_MinErrorDifference锛孶INT 鍨嬶紝璁剧疆鍑洪敊鑼冨洿锛屽綋杈撳叆瓒呭嚭鑼冨洿鏃讹紝婵娲籈rrorInputTooHighOut 鎴 ErrorInputTooLowOut 寮鍏筹紝骞朵娇杈撳嚭涓洪浂銆
    杈撳嚭锛
    (1) ErrorInputTooHighOut锛孊OOL 鍨嬶紝AIInput > PAR_PosFull*256 +
    PAR_MinErrorDifference, 鍒欒緭鍑轰负 TRUE銆
    (2) ErrorInputTooLowOut锛孊OOL 鍨嬶紝AIInput <
    PAR_NegFull*256-PAR_MinErrorDifference锛屽垯杈撳嚭涓 TRUE銆
    JoystikDirSwitchDiagnostic 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    鏈姛鑳藉潡鏄敤鏉ヨ瀵熸墜鏌勬ā鎷熼噺杈撳叆鏃跺井鍔ㄥ紑鍏崇殑鐘舵併
    鍔熻兘鍧楀涓嬪浘锛
    640 (7).jpg
    杈撳叆锛
      (1) AnalogInput锛孶INT 鍨嬶紝闇瑕佽瀵熺殑妯℃嫙閲忎俊鍙枫
    锛2锛塂I_JoystickDirSwitchPOS锛孊OOL 鍨嬶紝姝e悜寰姩寮鍏炽傚綋
    PAR_DirSwitchDiagnosticNotUse 涓 FALSE 鏃讹紝姝ゆ椂鍙堟墜鏌勫悜姝e悜绉诲姩锛岄偅涔堝彧鏈夋鍚戝井鍔ㄥ紑鍏 TRUE锛孫UTPUT 鎵嶄細鏈夎緭鍑恒
    锛3锛塂I_JoystickDirSwitchNEG锛孊OOL 鍨嬶紝璐熷悜寰姩寮鍏炽傚綋
    PAR_DirSwitchDiagnosticNotUse 涓 FALSE 鏃讹紝姝ゆ椂鍙堟墜鏌勫悜璐熷悜绉诲姩锛岄偅涔堝彧鏈
    璐熷悜寰姩寮鍏 TRUE锛孫UTPUT 鎵嶄細鏈夎緭鍑恒
    (4) PAR_PosFull锛孶INT 鍨嬶紝姝e悜鏈澶ц皟鏁村弬鏁般
    (5) PAR_NegFull锛孶INT 鍨嬶紝璐熷悜鏈澶ц皟鏁村弬鏁般
    (6) PAR_Zero锛孶INT 鍨嬶紝闆惰緭鍏ョ殑璋冭妭鍙傛暟銆備富瑕佺敤浜庡綋鎵嬫焺鍦ㄩ浂浣嶆椂锛屽嵆闆惰緭
    鍏ユ椂锛岃皟鑺傚弬鏁颁娇寰 OUTPUT 涔熶负闆躲
    (7) PAR_FaultOnDelay锛孶INT 鍨嬶紝杩囪浇寤舵椂銆
    杈撳嚭锛
    锛1锛塉oystickDirSwitchPOSMissing锛孊OOL 鍨嬶紝姝e悜寰姩寮鍏冲嚭閿欐椂锛屽间负 TRUE銆
    锛2锛塉oystickDirSwitchNEGMissing锛 BOOL 鍨嬭礋鍚戝井鍔ㄥ紑鍏冲嚭閿欐椂锛屽间负 TRUE銆
    锛3锛塉oystickDirSwitchPOSAndNEGOn锛孊OOL 鍨嬶紝姝c佽礋鍚戝井鍔ㄥ紑鍏冲悓鏃朵负 TRUE
    鏃讹紝鍊间负 TRUE銆
    MeanValue 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    瀵圭粰鐨勬暟缁勮繘琛屾眰骞冲潎鏁版搷浣溿
    鍔熻兘鍧楀鍥撅細
    640 (8).jpg
    杈撳叆锛
    (1) Input锛孶INT 鍨嬶紝鏁版嵁杈撳叆銆
    (2) PAR_Length锛孶INT 鍨嬶紝鍙栨暟闀垮害锛屽鍊间负 5锛屽垯姣 5 涓兼眰涓娆″钩鍧囧硷紝骞
    杈撳嚭鍒 output銆
    (3) Reset锛孊OOL 鍨嬶紝澶嶄綅淇″彿锛屽间负 TRUE 鏃朵笉杩涜骞冲潎鍊艰繍绠椼
    杈撳嚭锛
    (1) Output锛孶INT 鍨
    PedalFilter 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    PedalFilter 鍔熻兘鍧楁槸涓涓崟鍚戠殑鏍囧畾妯″潡锛屼富瑕佺敤浜庢妸杈撳叆妯℃嫙閲忚繘琛岄澶勭悊锛屾妸杈
    鍑洪噺鑼冨洿璋冩暣鍒 0锝65535銆
    鍔熻兘鍧楀涓嬪浘锛
    640 (9).jpg    
    杈撳叆锛
    锛1锛堿balogInput锛孶INT 鍨嬶紝鏉ヨ嚜浜庝紶鎰熷櫒鐨勮緭鍏ラ噺
    OutPutEnable锛 BOOL 鍨嬶紝浣胯兘寮鍏炽傚弬鏁板间负 TRUE 鏃讹紝妯″潡鎸夊綋鍓嶅艰緭鍑猴紱
    涓 FALSE 鏃讹紝淇濇寔涓婁竴娆¤緭鍑哄笺
    锛2锛塒AR_Full锛孶INT 鍨嬶紝鍙栧艰寖鍥达細0锝255锛屾鍙傛暟鐢ㄤ簬璋冩暣鏈澶ц緭鍑哄硷紝褰撹緭
    鍏ユ渶澶ф椂锛屼娇杈撳嚭鎺ヨ繎 65535锛屽皬浜 65535銆
    锛3锛塒AR_Zero锛孖NT 鍨嬶紝鍙栧艰寖鍥达細0锝255锛屾鍙傛暟鐢ㄤ簬璋冩暣闆朵綅锛屼娇杈撳嚭涓洪浂銆
    锛4锛塒AR_DeadBand锛孶INT 鍨嬶紝鍙栧艰寖鍥达細0锝100锛岃缃鍖猴紝褰撹緭鍏ヨ繘鍏ュ弬鏁拌
    缃寖鍥达紝杈撳嚭涓洪浂銆
           锛5锛塒AR_Progression锛孲INT 鍨嬶紝鍙栧艰寖鍥达細-100锝100 璁剧疆杈撳嚭缂撳啿鏇茬嚎搴︺
           锛6锛塒AR_MinErrorDifference锛孶INT 鍨嬶紝鍙栧艰寖鍥达細0锝100锛岃缃嚭閿欒寖鍥达紝褰撹緭鍏ヨ秴鍑鸿寖鍥存椂锛屾縺娲 ErrorHigh 鎴 ErrorLow 寮鍏筹紝骞朵娇杈撳嚭涓洪浂銆

           锛7锛塐utputEnable锛孊OOL 鍨嬶紝浣胯兘寮鍏炽
    杈撳嚭锛
           锛1锛塐utput锛孶INT 鍨嬶紝鍙栧艰寖鍥达細0锝65535锛岃緭鍑轰俊鍙枫
           锛2锛塃rrorHigh锛孊OOL 鍨嬶紝楂樹綅鍑洪敊寮鍏炽傝緭鍏>PAR_Full + PAR_MinErrorDifference鑼冨洿锛孍rrorHigh 涓 TRUE锛屽苟鎶婅緭鍑虹疆闆躲
           锛3锛塃rrorLow锛孊OOL 鍨嬶紝浣庝綅鍑洪敊寮鍏筹紝杈撳叆<PAR_Zero 鈥 PAR_MinErrorDifference 鑼冨洿锛孍rrorHigh 涓 TRUE锛屽苟鎶婅緭鍑虹疆闆躲
    RC 鍔熻兘妯″潡
    鍔熻兘鎻忚堪锛
    640 (10).png

    RC 鍔熻兘鍧楁槸婊ゆ尝鍔熻兘鍧楋紝瀹冩槸瀵逛紶鎰熷櫒淇″彿鐨勮緭鍏ヤ俊鍙疯繘琛屾护娉€傛护娉㈠叕寮忎负锛歽( z )=0.6x( z )+0.4锛坹-z)^1

    640 (11).jpg
    鍔熻兘鍧楀涓嬪浘锛

    杈撳叆锛
    (1) Input锛孶INT 鍨嬶紝杈撳叆淇″彿銆
    杈撳嚭锛
    (1) Output锛孶INT 鍨嬶紝杈撳嚭淇″彿銆
    Scale 鍔熻兘鍧
    鍔熻兘鎻忚堪锛
    Scale 鍔熻兘鍧楃殑涓昏浣滅敤鏄妸涓涓 0~65535 閲忓彉鎹㈡垚涓轰袱涓 0~65535 鐨勯噺锛屽涓嬪浘锛
    640 (12).jpg
    鍔熻兘鍧楀涓嬪浘锛
    640 (13).jpg
    杈撳叆锛
    锛1锛塈nput锛孶INT 鍨
    锛2锛塒AR_Zero锛孖NT 鍨嬶紝璁剧疆闆朵綅锛屽綋杈撳叆涓 PAR_Zero * 256 鏃,杈撳嚭涓 0銆
    锛3锛塒AR_PosFull锛孶INT 鍨嬶紝褰 input 鍊>=PAR_PosFull * 256 鏃, 杈撳嚭涓 65535 锛孭osValue 涓 TRUE銆
    锛4锛塒AR_NegFull锛孶INT 鍨嬶紝褰 input 鍊<= PAR_NegFull * 256, 杈撳嚭涓-65535 锛孭osValue 涓 FALSE銆
    杈撳嚭锛
    锛1锛塐utput锛孶INT 鍨
    锛2锛塒osValue BOOL 鍨嬶紝PAR_Zero * 256 > Input 鍊硷紝鍊间负 TRUE锛汸AR_Zero * 256< Input 鍊硷紝鍊间负 FALSE銆
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鍥炲

    浣跨敤閬撳叿 涓炬姤

  • TA鐨勬瘡鏃ュ績鎯
    寮蹇
    2017-11-15 14:53
  • 绛惧埌澶╂暟: 1 澶

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2018-8-3 16:36:44 | 鏄剧ず鍏ㄩ儴妤煎眰

    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鏉ヨ嚜瀹夊崜瀹㈡埛绔鏉ヨ嚜瀹夊崜瀹㈡埛绔
  • TA鐨勬瘡鏃ュ績鎯
    寮蹇
    2018-1-23 09:17
  • 绛惧埌澶╂暟: 2 澶

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2018-8-17 10:14:12 | 鏄剧ず鍏ㄩ儴妤煎眰
    寰堝ソ  闈炲父鎯崇湅鐪
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
  • TA鐨勬瘡鏃ュ績鎯
    寮蹇
    2018-1-23 09:17
  • 绛惧埌澶╂暟: 2 澶

    [LV.1]鍒濇潵涔嶅埌

    鍙戣〃浜 2018-8-17 10:15:42 | 鏄剧ず鍏ㄩ儴妤煎眰
    鎬庢牱鎵嶈兘涓嬭浇杩欎釜搴撴枃浠跺憿
    +10
    涓嶈禐涓涓紵
    鎵撹祻榧撳姳涓涓嬶紒
    鎮ㄩ渶瑕佺櫥褰曞悗鎵嶅彲浠ュ洖甯 鐧诲綍 | 绔嬪嵆娉ㄥ唽 鏂版氮寰崥鐧婚檰

    鏈増绉垎瑙勫垯

    椤堕儴qrcode搴曢儴
    鍏虫敞閰峰痉缃戣闃呭彿锛岃幏鍙栨洿澶氳祫璁紒

    QQ|灏忛粦灞|鎵嬫満鐗|Archiver|閰峰痉璁哄潧 ( 鑻廔CP澶16065247鍙-1 )|缃戠珯鍦板浘

    GMT+8, 2024-11-23 20:28 , Processed in 0.166173 second(s), 83 queries .

    閰峰痉缃

    © 2001-2013 Hicodesys. 鎶鏈敮鎸 by 閰峰痉缃

    蹇熷洖澶 杩斿洖椤堕儴 杩斿洖鍒楄〃