SC06b. Calculate Motor Speed RPM via Siemens S7-1200 HSC(High-Speed Counter) and Encoder

Поделиться
HTML-код
  • Опубликовано: 16 окт 2024
  • #Siemens #HSC #Encoder #PLC
    Before: SC06a. Read Incremental Encoder • SC06a. Read Incrementa...
    This video introduces how to calculate motor speed RPM Rev/s or Rev/min by using the encoder raw data. The encoder value is counted by Siemens S7-1200 PLC HSC(High-Speed Counter).
    According the link "RPM Equation" as the link the below as well as the recommendation from viewer 'Vu duy phuong", the equation used in the video:
    Speed (RPS) = [(C1-C2) / 0.2s ] / 1024
    or (RPM) = [(C1-C2) / 0.2s ] *60/ 1024
    Here the interval time between C1 and C2 is 0.2s (200ms interrupt OB)
    RPM Equation
    en.wikipedia.o...
    Siemens Control Play List:
    • Siemens Controls
    SC09. Siemens PLC Free Chat about S7-200 S7-300 S7-1200 S7-1500
    • SC09. Siemens PLC Free...
    SC08. How To Deliver a New Program to a Remote Siemens S7-1200 PLC via Memory Card
    • SC08. How To Deliver a...
    SC07. How to Solve "Missing Image Error" for Siemens TIA Portal Comfort Panel
    • SC07. How to Solve "Mi...
    SC06b. Calculate Motor Speed RPM via Siemens S7-1200 HSC(High-Speed Counter) and Encoder
    • SC06b. Calculate Motor...
    SC06a. Read Incremental Encoder via Siemens PLC S7-1200 HSC(High-Speed Counter)
    • SC06a. Read Incrementa...
    SC05. Siemens KTP HMI Touch Screen Replacement
    • SC05. Siemens KTP HMI ...
    SC04. Siemens TIA Portal PLC Upload and Firmware Upgrade S7-1200/S7-1500
    • SC04. Siemens TIA Port...
    SC03. Use a Memory Card to Reset a Siemens PLC with Password (S7-1200/S7-1500 CPU)
    • SC03. Use a Memory Car...
    SC02. Siemens TIA Portal Sequence Control Programming
    • SC02. Siemens TIA Port...
    SC01. Two Ways to Update Siemens TIA Portal Service Pack, Updates, HSP Support Packages
    • SC01. Two Ways to Upda...

Комментарии • 36

  • @akashmaurya2193
    @akashmaurya2193 2 года назад

    Thanks Man, this one really saved me from lots of trouble... Although I used different formula, but your cyclic interrupt really explained it all. Keep it up with such videos. 👍

    • @electricalautomation
      @electricalautomation  2 года назад

      Thanks Bro! Glad your like it! Yes, my motivation for publishing those videos is to terminate/solve the issues and solutions I had, so it could save my self and another people enjoying seeing it. Thanks again!

  • @DavidSanchez-gb6dd
    @DavidSanchez-gb6dd 2 месяца назад

    You saved my live with this video, Thanks a lot man!

  • @saifullah4412
    @saifullah4412 2 года назад +1

    Hello! very helpful video. Just want to know can we use absolute encoder instead of incremental encoder to achieve the same goal?

    • @electricalautomation
      @electricalautomation  2 года назад

      The method shown in this video is a cost effective way, meaning using PLC buitin IO high pulses for counting incremental encoder. Using absolute encoder basically means that you need a dedicated card "SSI" for reading absolute encoder, and it is 'extremely' high cost. Being that, I would use incremental encoder + encoder battery + motor brake.

  • @sethgabriel9356
    @sethgabriel9356 2 года назад

    valeu cara estava fazendo um projeto aqui e voce me ajudou muito😄

  • @kgauravb
    @kgauravb 3 года назад

    Very well explained, can you explain how to calculate the distance in linear motion using same encoder?

    • @electricalautomation
      @electricalautomation  3 года назад +3

      Thanks for your question! I will launch two videos in next two weeks talking about the position control via S7-1200 -> analog output -> DC Motor -> Encoder feedback. The encoder ratio will be discussed in the video. See you then.

  • @ghouseahmed4u
    @ghouseahmed4u 2 года назад

    Nice Explanation, one doubt to be clarified:
    If Counter is overflowing with counts more than 2147483647, can we do like this - "Since pulses are DInt format, after counter finishes counting until 2147483647, then can i move "1" to ID1000 directly, so that the cycle repeats?

    • @electricalautomation
      @electricalautomation  2 года назад

      Good Call, yes, when the counter almost or has been over flow, you can reset it to '1', and ignore this cycle of calculation.

    • @ghouseahmed4u
      @ghouseahmed4u 2 года назад

      @@electricalautomation hi, I tried moving 1 to ID1000 of HSC counter with physical input(I0.0) bit as reset. When I press reset(I0.0)then 1 is moving to ID1000 and when I release reset (I0. 0)then same value which was existing before doing reset, is coming back. Any suggestion please?

    • @electricalautomation
      @electricalautomation  2 года назад

      @@ghouseahmed4u Please review the SC06a ruclips.net/video/1CWL4bMro9M/видео.html, find the video 25:00- 27:00 talking about using CV to preset a counter value. For your question, you cannot over write a value to an 'Input' address. That the reason it returned the encoder value once your I0.0 was released.

  • @adi1257
    @adi1257 Год назад

    nice video, i have question....why in my program value of record counter and current counter are always same value, therefore the delta counter must be in zero (0), how to solve my problem ?

    • @electricalautomation
      @electricalautomation  Год назад

      I think you may missing something. Please review the video carefully and take care the sequence of the logic

  • @mestresplinter2467
    @mestresplinter2467 3 года назад

    Hello! Great video as always. I'm trying to use this method to build a control for a DC motor, but the PID_COMPACT just don't understand my inputs. The RPM can actualy go from -80 to +80, and the h bridge accepts values from 0 to 127 (0 max speed CCW, and 127 max speed CW, resting on value 64). This just don't work, and the PID shows some very high values at the input, that doesn't seems related to my actual input... can you help me somehow? Thank you btw for all of these beautiful videos.

    • @electricalautomation
      @electricalautomation  3 года назад

      Hello friend, please review the video launched today, ruclips.net/video/Od4cqjMst4Q/видео.html , it could solve your positioning control with a better way. And the video talking about how to use the program MC Function Blocks with TO will be launched next Monday.

  • @sangarabdulrahman6140
    @sangarabdulrahman6140 3 года назад

    Thanks very much ... siemens 😍😍😍

  • @aliosmantopkan8339
    @aliosmantopkan8339 Год назад

    video için teşekkür ederiz programı paylaşabilir misiniz

  • @taavikoppel1769
    @taavikoppel1769 3 года назад

    What happens if the Double integer overflows? A signed 32bit integer has a max value of 2,147,483,647. So if your encoder has 1024 increments per revolution... it overflows after roughly 2 million revolutions. So after ca 580 hours at 60rpm.
    Then one time this speed calculation will be very wrong... a very large negative value when going from 2 billion to a very low number.
    Can it cause the PLC to stop because of an error? You used a REAL but if someone uses a regular Integer than this large number would not fit inside it.
    Can this be avoided somehow? Can you reset the encoder value every 200ms so it will never grow so big.

    • @electricalautomation
      @electricalautomation  3 года назад

      Hello Taavi, thanks for coming up this topic, this is a really good question. If you are using the HSC and its counter for calculating the speed, you need to consider avoiding the calculation when the counter goes cross the 2^31 to '-' negative value. it is a just short moment and could use program to ignore the value when it is having the overflow. If you are using the ‘TO’ the axis for reading the encoder, please view the link below and find the “encoder value overflow ” solution. support.industry.siemens.com/cs/document/109794046/simatic-s7-1500-product-information-on-the-s7-1500-1500t-motion-control-documentation?dti=0&lc=en-CA. Also I would like correct one thing, the max value of 2,147,483,647 (2^31) represents the revolutions, which means if a motor runs 3000rpm, the TO encoder raw can count 715827 mins, -> 1.36 year (likely should be also higher these hours, I am counting the worst case, I remember it would be 5000 years). This motor runs full speed and runs for more than 1 year without any stop and TO HOME chance. Then mathematically, it could cause the overflow error. But then this come back to the question to "Design" that THIS IS NOT FIT FOR USING "TO" TO CONTROL THE CONTINUOUS RUNNING MOTOR. Also in real life, there would be chances for maintenance the production line, power shutdown, production change over, and cycle start/stop. There have many chances to HOME the axis.

  • @muhammadtauhidhidayat6020
    @muhammadtauhidhidayat6020 Год назад

    Record counter = Current counter and you do Sub its meant the result is 0?

  • @movies1774
    @movies1774 2 года назад

    Why #current counter is moved to #Record Counter in Network 3

  • @serhatkyar2887
    @serhatkyar2887 Год назад

    Thanks

  • @elizeusimoes490
    @elizeusimoes490 3 года назад

    Ver good 👏👏👏👏👏👏🍺🍺🍺🍺🍺🍺

  • @rizwanmahmood7350
    @rizwanmahmood7350 Год назад

    It is not working i tried many times

  • @vuduyphuong2327
    @vuduyphuong2327 3 года назад

    I think you can explain to everyone : Speed = Distance/ Time = [(C1-c2) / 0.2s ] / 1024 (RPS) = [(C1-c2) / 0.2s ] *60/ 1024 (RPM)
    it will be easy to understand

    • @electricalautomation
      @electricalautomation  3 года назад

      Thanks a lot! I will reference your comments and add this explanation under my video. Thanks again!

    • @spk7054
      @spk7054 2 года назад

      That's another great explanation.

    • @spk7054
      @spk7054 2 года назад

      From this formula Assume (C1-C2)= 1024
      The result after sol . Speed =Distance /Time = 12 yes or right?

  • @Kozak450
    @Kozak450 Год назад

    It's easier to call OB30 every 1000ms.