panic mode

MrPLC Admin
  • Content count

  • Joined

  • Last visited

Community Reputation

33 Excellent


About panic mode

  • Rank
    Mitsubishi Moderator
  • Birthday 12/15/69

Contact Methods

  • Website URL
  • ICQ 0

Profile Information

  • Gender Male
  • Location Mississauga, ON
  • Country Canada
  • Interests many...

Recent Profile Visitors

5473 profile views
  1. Trouble Wiring a Simple LED with a Micro820 Controller

    LEDs are polarized devices like all diodes. When forward biased voltage drop is usually 2-3V and current is usually 5-20mA. To operate on higher DC voltage al you need is series resistor but 10K will be too high value (LED will likely show some output but very dim).  If we assume 15mA (0.015A) and 3V for LED, then resistor will be 21V/0.015A = 1400 Ohm. Nearest common value is 1.5k and it should be rated for 0.5W    But keep in mind that reverse biased LED will not survive if it is connected to voltage that exceeds some 6-7V.  common solution is to either make sure this will never happen or protect LED somehow. simplest solution is to wire another diode anti-parallel to LED. another option is to use bridge so polarity will not matter.  
  2. Binary string to int conversion

    i agree, using string to represent numeric values is less than ideal. but if that's what you have, use a loop and go through each string character, something like this (sample pseudo code): INT N, I N:=0 FOR I:=1 to stringData.LEN   N:=N+N   if stringData[I]=='1' then       N:=N+1   endif NEXT  
  3. Binary string to int conversion

    and post your code
  4. PE Exam

    Ever hired or relied on services of others? contractor, doctor, anyone?  Is there any value in confirming that they are capable of doing their job?   
  5. New laptop, comms errors

    you put HDD into another laptop? are you sure they are identical machines? do you have drivers for all hardware (such as network port)? did you try to connect to anything else and at least try PING? also check network settings on both nodes, communication between two devices is possible if both are on a same subnet
  6. Float substraction?

    Computer representation of numbers in different formats is a really interesting topic. Key is to use correct format... Note, REAL is encoded data format. If you are interested in making each and every digit count.... do not use REAL data type! This is why servo controllers count pulses. You only see distances in REAL format as a secondary result. Many things about REAL look nice and easy at first but there are pitfalls. For example: - comparing floating points directly for equality is generally a bad idea (even if some systems may have some sort of a workaround in place) - adding or subtracting floating point values that greatly differ in size is a bad idea. one can check it by making loop and adding very small value to a real number. eventually it will stop increasing, usually long before reaching maximum value that REAL can hold. - etc.   I see cases all the time when programmers favor REAL in calculations thinking they get "better resolution" because software they look at generates bunch of meaningless digits. They don't realize that 32-bit is 32-bit. both 32-bit INT and 32-bit REAL can represent same number of different states.... they are just distributed differently. in case of integers, distribution is uniform. in case of REAL it is not. you get really small increments when values are close to zero. but you get really huge increments when values are big. in fact REALs have a problem with significant figures because they only use 23-bit for this. There is no magic or "free lunch". 32 bits are divided into groups:          1 bit is sign          8 bits are exponent          23 bits are significant those 23 bits are determining how many significant figures in your number are correct. 23 bits in binary comes up to some 6, in best case 7 significant figures in decimal. Anything after that is garbage.... there is no point in using so many decimal places in your examples when system that is used to do calculation can at best do 6-7 significant figures.   Back to your question:  IF result<=Param then .... IF 0.05000305 <= 0.05000000 this is a problem?   I would not even consider it....    note: Value 0.05000000 is a result of subtraction from "70.000000". i would not count on more than 6 significant figures. this means 70.000000 is an exaggeration as only four decimal places are useful so this should be displayed as 70.0000 instead of 70.000000. subtracted number is of same magnitude so result is going to be good only for up to those four places after decimal point. Anything beyond 0.0500 in this case is nothing but wishful thinking... values such as 0.05000305 or 0.05000000 make no sense as they are really no better than 0.0500. Sure you can get "wrong" result at the very slim margins of your range but why would you care. And if you do .... don't use REALs (floating point numbers), use integers to represent fixed point numbers.          
  7. Float substraction?

    i don't see why would one care unless this is data to be displayed on HMI. in that case HMI should have options to display specific format (number of decimal places etc.). If for some reason this is not available, don't use floating point, use fixed point format... for example multiply value by 1000 and place result into an integer variable. so value such as 79500 will really represent 79.500 (three decimal places are implied). This is something even oldest HMIs would handle.
  8. Float substraction?

    70.0 - 69.95 = 0.05  - nothing wrong with that...  0.05000305 is just closest floating point representation possible in 32-bit...   note that not all REAL numbers can be presented accurately, most are approximated. and you get "artifacts" after 6th place or so.  
  9. floating and Nonfloating I/O modules

    Floating means that output is galvanically isolated so it 'floats'. This means that it is not referenced to ground and if you measure potential difference between one of output terminals (positive or negative) and ground, just about any value is possible.    Using floating output is special case in electrical standards around the world and may need special condition in order to be deemed acceptable.  Normally this is reserved only for low power device, some instrumentation etc. and when used, double insulation is a minimum. You can see this on small consumer devices and power supplies - it is double wall rectangle.  Generally transformer and PSU outputs are required to be referenced in order to meet safety requirements and avoid harm due certain modes of failure (leakage current).         
  10. Modbus RTU communication Toshiba PLC - Hitech HMI

    Well, supplier is only one link in support chain. Did you contact manufacturer of your HMI? 
  11. Sequential Function Charts (SFC)

    one create FSM in any language... if someone takes 5x longer to do it in one language instead of another, that is not testament to language but level of his/her experience.
  12. To Infinity

    agreed. besides, flow rate (gal/sec) and total (gal) are two different things... while decimal places may make sense in flow rate, they are pointless in displaying total volume that goes into billions. i would suggest to consider fixed point math instead of floating point. then you cam easily do what TW suggested and keep "decimal places"
  13. Controls Designing

    Design practices must be within constraints of the applicable standards in your place of business and client location.    One can learn theory at school or university but everything discussed there is purely academic. When you start wrestling with real product, you need to find out what standards are applicable. You probably want to look up local national electrical standard. Some places do have electrical standard but it's use is voluntary. Also there may be specific standards that your clients insist on.    Here in Canada, there is CEC or Canadian Electrical Code. One can buy book or better sign up for a course at one of colleges. This will introduce you to a standard and how to read and interpret it... Unlike material in college (that explains how to solve various circuits), this tells you what the trade standards are, how big wire mist be, how to do proper grounding and bonding, when and how to derate wire size, how to size conduit, how to select and apply circuit protection and much more.  Next you need to practice somewhere good... Guy that does all kind of hacks in his garage is probably not the best mentor (he may know a lot but he does not play by the rules). Try finding an integrator, preferably someone catering to automotive because they will be cranking out tons of panels fast and they don't fool around because automotive clients are generally very knowledgeable and - they know what they want.  Then you need to apply all learned to design circuits. That involves reading datasheets, making selections, sizing circuits, applying CEC, etc.  Here it is also required to approve equipment before use (law requires that employers provide safe workplace for everyone). This means getting electrical inspection done by one of approved labs, and performing safety risk analysis.    I used to interview controls candidates and I would ask them many questions about circuits, CEC, math, programming, networking etc.    For someone wanting to do design I would ask something like: You need to design something that can lift 750L tank of water 25m in 42sec. Tank etc.  weighs 180kg. Client is supplying 600VAC 3phase power. There is no PLC, there are just push buttons and relays. Draw entire circuit, size all components. 5min is enough, 10min is generous time but if someone takes twice as long and still gets right solution - we can still talk...   
  14. MR J3 A SERVO

    Yes.. I have seen the same when on a slow network... Second click while waiting for confirmation seem to produce second look post 
  15. Surge supressor diode

    diode is only one of several  types of suppression devices. need for suppression comes from operating principle of solenoid. basically is works like "flywheel" and opposes any current change. before solenoid is connected into circuit, current through it is zero amp. when solenoid is connected into circuit, it resists change and tries to maintain current of zero amp but it eventually gives in so current rises gradually. supposedly current settles at some value after while (say 0.5A). when output turns off, solenoid again resist change and tries to push that current (0.5A) through output. but since turned off output is high resistance (open circuit), this will result in very high transient voltage. this spike is brief but... it can damage output as well as cable etc. to put this into perspective, suppose output has off resistance of 100kOhm, using Ohms law we can see that untamed transient would generate voltage V=I*R=0.5A * 100000 Ohm = 50000V. in reality things are more complicated so there are usually other things that will dampen this transient to some degree. for example if wiring is using cable rated for 300V, it may break down at some 1500-1800V or so. this is of course bad for wiring (insulation deteriorates, lookup "lichtenberg") but... it may survive anywhere from few cycles to few hundred thousand cycles depending on case. this is also very bad for outputs - for example transistor outputs without protection will die instantly on a very first transient even if load was a tiny solenoid (drawing only few mA of current). in short - concern with inductive loads is when they - turn off.   so how to deal with this? as mentioned there are suppression devices such as diodes, varistors (MOVs), RC elements, zeners etc. diodes are simplest and most common type of protection. manufacturers of PLCs are of course very well aware of this so they always add protection - for transistor outputs! without it, transistor outputs would be unable to do second cycle on inductive load. so if the protection is included, why add additional one?  well it is not always included (they are added to transistor output cards such as OB16), for example there are other types of outputs such as relays (OX8 or OW16). another issue is that wiring may be long - wires themselves have inductive properties so diode in PLC will protect an output but it will do little or nothing to protect end of 10m long cable that is connected to inductive load such as solenoid or contactor coil (transient will be able to create large spike at the far end of the cable, away from suppressor). how does it work? diode is wired in parallel to a DC inductive load and - it must be reverse biased. when load is turned on, current flows from output to load, no current goes through diode (except some really really small leakage current). when load is turned off, inductive loads tries to keep pushing current in same direction. since output is off, no current will flow there, however now the current has closed path -  through diode. this will eliminate big voltage spike (well, it will reduce it to 0.7V above supply voltage so it will be 24.7V). this current will stop flowing once the energy stored in magnetic field is exhausted (usually this is fraction of a second). relay contacts that are used to power inductive loads erode much faster when there is no suppression device across load. also transients can cause other issues (communication failures, "random" reboots etc). but adding diodes to each solenoid takes time (labour).