Machsupport Forum

Third party software and hardware support forums. => CS-Lab => Topic started by: lion_rapid on November 07, 2018, 03:43:56 PM

Title: Lag on inputs
Post by: lion_rapid on November 07, 2018, 03:43:56 PM
Hello
Short code:
Code: [Select]
SetOutBit(90, 2)
    CamRdy = false
    While(Not CamRdy)
        If(GetInBit(90, 10)) Then
        ResetOutBit(90, 2)
            CamRdy = true
        End If
    Wend

Oscilloscope hooked up to input nr 10 and output nr 2. There is a lag of about 100ms!

If I use code:
Code: [Select]
SetOutBit(90, 2)
Sleep(100)
ResetOutBit(90, 2)
Sleep(100)
SetOutBit(90, 2)
Sleep(100)
ResetOutBit(90, 2)

Then the impulse width on the output is 102-103ms.
So nothing wrong here, looks like there is lag on the inputs.
Title: Re: Lag on inputs
Post by: TPS on November 08, 2018, 03:02:38 AM
contact CSLAB via:  office@cs-lab.eu

and ask Wojtek Trawicki for Support.


 
Title: Re: Lag on inputs
Post by: lion_rapid on November 08, 2018, 03:25:54 AM
That was the first thing I did :-)
Title: Re: Lag on inputs
Post by: lion_rapid on November 09, 2018, 05:45:19 PM
Today I got an answer: "We tested it on our setup and average lag time was 90ms, we advise to use PLC in this case".
Title: Re: Lag on inputs
Post by: lion_rapid on November 09, 2018, 05:53:12 PM
Two-three hours later something came to my mind:
It's weird, when I run one of the axis against a limit switch, the reaction time is usually below 10ms.
When I run the tool length macro it's the same.
Why on earth here is 90-100ms?
Tomorrow I'll define those inputs and outputs from Csmio in the MACH3, then declare them in my test macro and see what happens.
Title: Re: Lag on inputs
Post by: lion_rapid on November 11, 2018, 03:37:53 PM
I did this test and came with the same unacceptable delay.
So I can't make my tool changer to work correctly.
Title: Re: Lag on inputs
Post by: TPS on November 15, 2018, 02:25:36 AM
hello,

you can try to add two additional relays for a "Hardware Stop"

according to attached drawing

Rel1 -> Motor turn relay
Rel2 -> enable stop relay
Rel3 -> stop relay paralell to CSMIO Input

Software sequence would be:
1- turn Rel1 on to turn turret
2- if turret Position reached turn Rel2 on to enable HW Stop
3- if Input is ON turn OFF Rel1 + Rel2

with this small circuit you will get the fastest stop time, because the Rel3 will turn OFF the motor