Skip to main content

How PLC do the Scaling for a Sensor?

    Scaling ဆိုတာ Signal ​တွေကိုယူတဲ့ Process တစ်ခုပါပဲ။ အဲ့​တော့ Signal ဆိုတာဘာ​တွေပါဝင်လဲဆို​တော့ Sensor Output ကထွက်တဲ့ Procss Variable, Voltage တို့ Current တို့ကို​ပြောတာဖြစ်ပြီး​တော့ အဲ့ဒီ Signal ​တွေကို Math Calculation နည်းနဲ့အသုံးပြုပြီး PSI, °C တို့လိုမျိူး Engineering Unit ​တွေအဖြစ်​ပြောင်းလဲကြပါတယ်။

     ဒီမှာ​တော့ Scaling Technique ဟာ သုံးခုရှိပါတယ်။

-Linear Scaling
-Mapped Scaling နဲ့
-Formula Scaling တို့ဖြစ်ပါတယ်။

   ဒီ​နေရာမှာ ကြို​ပြောချင်တာက အသုံးပြုမယ့် Process ​ပေါ်မှာ Equation ကကွဲပြားနိုင်တာ​ကြောင့် ဘယ်​နေရာမှာဘာသုံးမလဲဆိုတာပဲ​ရေးထားတာပါ။
Linear Scaling

    Linear Scaling က​တော့ Scaling Method ထဲမှာ ​ယေဘုယျအကျဆုံးပဲလို့ဆိုနိုင်ပါတယ်။ အဲ့ဒီ နည်းစနစ်ဟာ Linear Voltage, Linear Current Signal ရှိတဲ့ Sensor ​တွေမှာသုံးလို့အ​ကောင်းဆုံးပါပဲ။ Maximum နဲ့ Minimum Outputs ​တွေက တိကျတဲ့ တန်ဖိုး​တွေကို Sensor Range တစ်​လျှောက်မှာ ​​ဖော်ပြ​ပေးတယ်။ ဆိုလိုတာက Linear Function ရဲ့ မျဥ်းတစ်​လျှောက်မှာ သူရဲ့တန်ဖိုး​တွေကို​တွေ့နိုင်ပါတယ်။သူ့ဟာအများအားဖြင့် ​စျေးကြီးတဲ့ Sensor ​တွေမှာအသုံးများပါတယ်။(ဒါက​တော့ မူရင်းစာ​ရေးတဲ့သူက​ပြောတာပါ။​စျေးကြီးမကြီး​တော့မသိပါဘူး။) Equation က​တော့

                     y = mx + b 

y ဆိုတာက​တော့ Output ပါ။
x ဆိုတာက​တော့ Input ပါ။
m က​တော့ Slope ပါ အဲ့တာကို Scale Factor လို့လဲ​ခေါ်ပါတယ်။
b က​တော့ y ရဲ့ Intercept ဖြစ်ပြီး Offset လို့လည်း​ခေါ်ပါတယ်။

Mapped Scaling

    Mapping ဟာ ဒုတိယအကျဆုံး Scaling Method ပါပဲ။ အဲ့ဒီနည်းကို PT100/1000 ကဲ့သို့ low cost resistive thermometer ​တွေမှာအသုံးများပါတယ်။ Sensor ထဲက Output ​တွေက တိကျတဲ့တန်ဖိုး​တွေနဲ့အပြိုင်ထုတ်​ပေးပါတယ်။ ဒါ​ပေမယ့်လည်း အဲ့တာက Linear Function အ​နေနဲ့ ရိုးရှင်း​အောင်မလုပ်နိုင်ပါဘူး။ ဒါ​တွေဟာ Non-Linear နဲ့ Formula Based Scaling အ​ခြေအ​နေမရှိရင် ဒီနည်းကိုသုံးပါတယ်။ အဲ့​တော့ ကျွန်​တော်တို့က Mapping Table ​ဆောက်ရပါတယ်။ 
     အလွယ်ဆုံးဥပမာအ​နေနဲ့ Tank Volume ရဲ့ Non-Linear Tank ကိုဥပမာ​ပေးပါမယ်။ အဲ့​တော့ကျ​နော်က Trigonometeric Formulaကိုသုံးပါမယ်။ Horizontal Cylinder Tank ရဲ့  Equation က​တော့

          V(tank) = pi × r^2 × l 
          V(Segement) = (1/2) × r^2 ( thita -        sin(thita)
       
Where,  thita = 2 × arccos(m/r) and thita is in radians
           V(fill) = V(tank) - V(Segment)
အဲ့ဒီနည်းနဲ့ပဲ Mapping table ကို​အထက်ကပြထားတဲ့ပုံအတိုင်းတည်​ဆောက်ထားတာပါ။  (တွက်နည်းကို​တော့မ​ပြော​တော့ပါဘူး။ Overview ကိုမြင်မိ​အောင်ပဲပြတာပါ။ လက်​တွေ့မှာ ပုံစံမတူတဲ့ Tank ​တွေရှိတဲ့အတွက် တွက်နည်းဟာ ​ပြောင်းသွားနိုင်ပါတယ်။ အ​သေးစိတ်ကို​နောက်မှသက်သက်တင်​ပေးပါမယ်။)

ပထမပုံထဲမှာကြည့်ရင် ကျွန်​တော်တို့က 0 to 10 VDC ကိုသုံးထားတာပါ။ အကယ်၍ Output က 1V ဆိုရင် Tank ရဲ့  အနက်က 0.5 ft ​လောက်ရှိပါတယ်။ ခန့်မှန်း​ခြေ ဂါလံ 76 gallonsရှိပါတယ်။ အဲ့ဒီ Table က​နေကြည့်ပြီ တန်ဖိုး​တွေကိုရယူတာပါ။

Formula Scaling

    Formula Scaling က​တော့ Rare Method တစ်ခုပါပဲ။ အရမ်းလည်း Powerful ဖြစ်ပါတယ်။ ဒါ​ပေမယ့် သူ့မှာ Hardware/Software Configurations ​တော့လိုအပ်ပါတယ်တယ်။ သို့​သော်လည်း မကြာခဏဆိုသလို Data အများစုက များပြားစွာ Data ​တွေကိုသိမ်းဆည်းတတ်ရတာ​ကြောင့် Data သိမ်းဆည်းတဲ့စနစ်ကလိုက်မမှီပါဘူး။ (ဒါ​ပေမယ့် Data Engineering သမား​တွေသာ မလိုအပ်တဲ့ Data ​တွေကို​လျော့ဖို့ Data Cleaning အစရှိသဖြင့်လုပ်ရလိမ့်မယ်လို့ ​တွေးမိပါတယ်။)
     သူ့မှာလည်း အထက်ကတင်ပြထားတဲ့ Equation လည်းသုံးသလို Pressure Difference Equation ဖြစ်တဲ့ 

P(Differential) = P(external) - P(internal) လည်းသုံးကြပါတယ်။

Reference : instrumentationtools

Comments

Popular posts from this blog

IPv4 Vs IPv6 - What's the difference between IP Addresses

ကျွန်တော်တို့ IOT Project သို့မဟုတ် PLC တို့ HMIတို့ကို Ethernet နဲ့ချိတ်တဲ့အခါမှာ IP Address တို့ Subnet Mask တို့သတ်မှတ်ရတာတို့ကိုတွေ့ရမှာပါ။အခုကတော့ IP Addressအကြောင်းကိုမှ IPv4 နဲ့ IPv6 အကြောင်းကိုရေးမှာပါ။           IP Address ဆိုတာကတော့ ကျွန်တော်တို့ရဲ့အိမ်နံပါတ်လိုသဘောမျိုးလုပ်ထားပေးတဲ့ Internet Protocol တစ်ခုပါပဲ။ အိမ်တိုင်းအိမ်တိုင်းမှာသူရဲ့သက်ဆိုင်တဲ့နေရာလိပ်စာတွေရှိကြသလိုပဲ စက်တိုင်းမှာလည်းသူရဲ့ သက်ဆိုင်တဲ့ IP Address တွေရှိကြပါတယ်။ ဒါကတော့ IP Address အကြောင်းကိုရှင်းပြတဲ့ရိုးရှင်းတဲ့ ဥပမာတစ်ခုပါ။ ဒီမှာအဓိကထားပြီးရှင်းပြသွားမှာကတော့ IPv4 နဲ့ IPv6 ကိုရှင်းပြသွားမှာပါ။      What is IPv4 : simple meaning & features guide     ဒီ IPv4 မှာဘာတွေပါလဲဆိုတော့ Set Numbers လေးခုပါဝင်ပါတယ်။ ယေဘုယျအားဖြင့် ဘယ်လိုပုံစံနဲ့ရေးကြသလဲဆိုရင် 106.102.77.43 (ဒါကဥပမာပုံစံပါ။) လိုပုံစံမျိုးဖြစ်ပြီးတော့ မတူညီတဲ့ ကိန်းဂဏန်းလေးခုကို Cover လုပ်ပေးထားပါတယ်။ IPv4 ဘာကြောင့်ဖြစ်လာရလည်းဆိုရင် လွန်ခဲ့တဲ့ 1980 ဝန်းကျင်ကာလတွေမှာ I...

Indirect Addressing

Indirect Addressing      တကယ်တမ်း​တော့ ဒီစာကို​ရေးဖြစ်တာကလည်း ဆရာရဲ့ Project Problem တစ်ခုချ​ပေးပြီ ​ဖြေရှင်းရင်းနဲ့ ​တွေ့လာတာပါ။ အဲ့​တော့ အဲ့ဒီဟာက ဘယ်​နေရာမှာ ဘယ်လိုသုံးတာလဲ,ဘာ​တွေသုံးတယ်,ဘယ်လို Program နဲ့​ရေးတာလဲဆိုတာ အဓိကထားပြီး​တော့ ​ပြောပြ​ပေးသွားမှာမယ်။ သူ့အ​ကြောင်းသိဖို့အရင် Index Register ကိုအရင်​ပြောပါမယ်။ What is Index Register?     Index Register ဆိုတာက Process Register လို့လဲ​ခေါ်ပြီး​တော့ Program ကို Operand ​တွေရဲ့ Address ကို Program က Run ​နေတဲ့အချိန်မှာ Modify လုပ်တာပါ၊ PLC မှာရှိတဲ့ Register ​တွေက PLC ထုတ်တဲ့ Company အမျိုးအစား​ပေါ်မူတည်ပြီး​တော့ ​သုံးစွဲတာမတူကြ​ပေမယ့် သ​ဘောတရားက​တော့အတူတူပါပဲ။ အခု ဥပမာ​ပေးမှာက Delta PLC နဲ့ ဥပမာ​ပေးပါမယ်။     Delta မှာရှိတဲ့ Index Register က​တော့ E နဲ့ F ဆိုပြီးသတ်မှတ်ထားပါတယ်။ E နဲ့ F ကိုတစ်လုံးချင်း သုံးရင်​တော့ 16 bit အ​နေနဲ့သုံးလို့ရပါတယ်။ Eနဲ့F ဟာတွဲခဲ့ရင်​တော့ 32 bit ဖြစ်သွားပါပြီ။ E ဟာ Lower 32 bit ဖြစ်လာပြီး​တော့ F ဟာ Higher 32 bit ဖြစ်လာပါတယ်။     ဒုတိယပုံက...

Example of PLC ladder diagram for Filing and Heating Liquid in Tank

In the previous post, I wrote PLC program about Mixing and Heating process. Today, I'm going to write about Filling and Heating process in tank. It sounds like the same topic in previous post. Actually, it is different. We'll see the sequences and processes.  Here is the given sequences according to the Author : 1. Fill the tank up to 80%. When the tank is filled, turn ON the heater to raise the temperature up to 70 deg. 2. When this temperature is reached, turn OFF the heater & open the outlet valve. 3. When the level in the tank falls below 10%, close the output valve. In this situation, I do the ladder diagram via Sysmac Studio which is the product of Omron. I just remind you again, most of the control processes are used with Mitsubishi, Siemen and sometimes Delta's PLC due to cost effectively. I'm going to show you how it works with Sysmac Studio. In this case, I'm only using Name Tags. Before I'm talking about ladder diagram, I would like to tell about ...