• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. r3sist
    R
    • Profile
    • Following 1
    • Followers 0
    • Topics 2
    • Posts 11
    • Best 0
    • Controversial 0
    • Groups 0

    r3sist

    @r3sist

    0
    Reputation
    201
    Profile views
    11
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    r3sist Unfollow Follow

    Latest posts made by r3sist

    • RE: Optimizing program for minimum real cycle time, lowest possible input lag

      Anything near real sub-200ms would be applicable.
      Right now on 2.3.0 os / ide, the same program from 2.1.3 version seems to have even more input lag than before.
      Machine operator states that its worse than before, and indeed, the machine is having trouble reacting to a limit switch in time, ignoring the signal and moving past it.
      From button push, to relay output turning on, there is like ~1250ms total delay.
      Also this :

      iPressure:= REAL_TO_INT(hw.$Neuron M203_AI_1.01$);
      	IF iPressure >= iPressure_setpoint THEN
      		xPressureReached:= TRUE;
      	ELSE
      		xPressureReached:= FALSE;
      	END_IF;
      
      	IF bTableDown_button AND NOT xPressureReached THEN
      		bTableDown_valve:=TRUE;
      		bHighPressure_valve:= TRUE;
      	ELSE
      		bTableDown_valve:=FALSE;
      		bHighPressure_valve:= FALSE;
      	END_IF;
      

      Seems to fail now, lets say the setpoint is a const 100, it does not close the valve and pressure goes way above setpoint. Sensor seems fine just the logic feels slow in execution.

      There is a task set on freewheeling on 0%, i've tried to separate them using cycling on a 50/100ms scan but it didnt affect the outcome 1200ms+ reaction time.
      I've sent you the project file and appreciate your insight.

      posted in Mervis
      R
      r3sist
    • Optimizing program for minimum real cycle time, lowest possible input lag

      Hi,
      On sidenote, I've just successfully merged my project to newest RT and IDE (2.30 and according RT).
      And thanks for that, I remember 2.2.0 made my project unusable.
      So I've seen people complain about the cycle time and I'm having an issue aswell.
      I understood from @Martin Kudláček that NeuronOS is just a software PLC and it shares resources with various system bg processes, even though, is there something we can do except mapping only essential for our program needs I/O's to reduce the cycle time of PLC?

      posted in Mervis
      R
      r3sist
    • RE: Hydraulic Press project on Neuron M203 - beginner needs help

      I finally convinced my boss, and we went with Weintek MT8051iP.
      Unfortunately i am not able to make any progress with automatic work cycle other than getting function blocks to work at last. Although nothing happens when i press fbAutoCycleOn.

      Also i wanted to make things easier for me and tried to rename generated variable names for Neuron I/O, but i think the way I did it is completely wrong as I've ran into random troubles.
      At first i tried something like this :

      hw.$Neuron M203_RO_2.01_w$:= bPumpOn;
      

      But it didnt work, neither for RO or DI's.

      iPressure:= REAL_TO_INT(hw.$Neuron M203_AI_1.01$);
      iPressure_setpoint:=200;
      IF iPressure >= iPressure_setpoint THEN
      xPressureReached:= TRUE;
      ELSE
      xPressureReached:= FALSE;
      END_IF;
      
      (*// relay outputs binding
      
      // down valve
      IF bTableDown_valve THEN
      hw.$Neuron M203_RO_2.01_w$:= TRUE;
      ELSE
      hw.$Neuron M203_RO_2.01_w$:= FALSE;
      END_IF;
      // up valve
      IF bTableUp_valve THEN
      hw.$Neuron M203_RO_2.02_w$:= TRUE;
      ELSE
      hw.$Neuron M203_RO_2.02_w$:= FALSE;
      END_IF;
      // bot down valve
      IF bBottomTableDown_valve THEN
      hw.$Neuron M203_RO_2.03_w$:= TRUE;
      ELSE
      hw.$Neuron M203_RO_2.03_w$:= FALSE;
      END_IF;
      // bot up valve
      IF bBottomTableUp_valve THEN
      hw.$Neuron M203_RO_2.04_w$:= TRUE;
      ELSE
      hw.$Neuron M203_RO_2.04_w$:= FALSE;
      END_IF;
      // high pressure
      IF bHighPressure_valve THEN
      hw.$Neuron M203_RO_2.05_w$:= TRUE;
      ELSE
      hw.$Neuron M203_RO_2.05_w$:= FALSE;
      END_IF;
      // pump 
      IF bPumpOn THEN
      hw.$Neuron M203_RO_2.06_w$:= TRUE;
      ELSE
      hw.$Neuron M203_RO_2.06_w$:= FALSE;
      END_IF;
      
      // input assignment
      
      // manual
      IF hw.$Neuron M203_DI_2.10$ THEN
      bManualMode:= TRUE;
      ELSE
      bManualMode:= FALSE;
      END_IF;
      // auto
      IF hw.$Neuron M203_DI_2.11$ THEN
      bAutoMode:= TRUE;
      ELSE
      bAutoMode:= FALSE;
      END_IF;
      // autoeject
      IF hw.$Neuron M203_DI_2.12$ THEN
      bAutoEjectorMode:= TRUE;
      ELSE
      bAutoEjectorMode:= FALSE;
      END_IF;
      // Limit up
      IF hw.$Neuron M203_DI_1.01$ THEN
      bLimitTableZero:= TRUE;
      ELSE
      bLimitTableZero:= FALSE;
      END_IF;
      // Limit bot up
      IF hw.$Neuron M203_DI_1.02$ THEN
      bLimitBottomTableUp:= TRUE;
      ELSE
      bLimitBottomTableUp:= FALSE;
      END_IF;
      // Limit bot down
      IF hw.$Neuron M203_DI_1.03$ THEN
      bLimitBottomTableDown:= TRUE;
      ELSE
      bLimitBottomTableDown:= FALSE;
      END_IF;
      // Pump on
      IF hw.$Neuron M203_DI_2.01$ THEN
      bPumpOn_button:= TRUE;
      ELSE
      bPumpOn_button:= FALSE;
      END_IF;
      // Pump off
      IF hw.$Neuron M203_DI_2.02$ THEN
      bPumpOff_button:= TRUE;
      ELSE
      bPumpOff_button:= FALSE;
      END_IF;
      // Table down
      IF hw.$Neuron M203_DI_2.03$ THEN
      bTableDown_button:= TRUE;
      ELSE
      bTableDown_button:= FALSE;
      bTableDown_valve:= FALSE;
      END_IF;
      // Table up
      IF hw.$Neuron M203_DI_2.04$ THEN
      bTableUp_button:= TRUE;
      ELSE
      bTableUp_button:= FALSE;
      bTableUp_valve:= FALSE;
      END_IF;
      // Bot table up
      IF hw.$Neuron M203_DI_2.05$ THEN
      bBottomTableUp_button:= TRUE;
      ELSE
      bBottomTableUp_button:= FALSE;
      END_IF;
      // Bot table down
      IF hw.$Neuron M203_DI_2.06$ THEN
      bBottomTableDown_button:= TRUE;
      ELSE
      bBottomTableDown_button:= FALSE;
      END_IF;
      // Auto on
      IF hw.$Neuron M203_DI_2.07$ THEN
      bAutoCycleOn:= TRUE;
      ELSE
      bAutoCycleOn:= FALSE;
      END_IF;
      // Auto off
      IF hw.$Neuron M203_DI_2.08$ THEN
      bAutoCycleOff:= TRUE;
      ELSE
      bAutoCycleOff:= FALSE;
      END_IF;
      // Zero
      IF hw.$Neuron M203_DI_2.09$ THEN
      bZeroTable_button:= TRUE;
      ELSE
      bZeroTable_button:= FALSE;
      END_IF;
      

      So right after this I have these IF's :

      // table up
      
      IF bTableUp_button = TRUE AND NOT bLimitTableZero THEN
      bTableUp_valve:=TRUE;
      ELSE
      bTableUp_valve:=FALSE;
      END_IF;
      
      // table down
      
      IF bTableDown_button = TRUE AND NOT xPressureReached THEN
      bTableDown_valve:=TRUE;
      ELSE
      bTableDown_valve:=FALSE;
      END_IF;
      
      // ejector down
      
      IF bBottomTableDown_button = TRUE &
      bLimitBottomTableDown = FALSE &
      bManualMode = TRUE THEN
      bBottomTableDown_valve:=TRUE;
      ELSE
      bBottomTableDown_valve:= FALSE;
      END_IF;
      
      // ejector up
      
      IF bBottomTableUp_button = TRUE &
      bLimitBottomTableUp = FALSE & 
      bManualMode = TRUE THEN
      bBottomTableUp_valve:=TRUE;
      ELSE
      bBottomTableUp_valve:=FALSE;
      END_IF;
      

      ///

      fbAutoInit_RTRIG(CLK:=bAutoCycleOn);
      fbAutoOff_RTRIG(CLK:=bAutoCycleOff);
      
      IF  fbAutoInit_RTRIG.Q THEN
          xPumpStart:= TRUE;
          iState:= 10;
      ELSE
          xPumpStart:= FALSE;    
      END_IF;
      
      CASE iState OF 
          10:
          // timer init to let the pump run well
          fbStartautotimer(IN:=xPumpStart,PT:=iPumpTimeDelay);
          IF fbStartautotimer.Q THEN
              fbStartautotimer(IN:=FALSE);
          END_IF;
          fbCycle_RTRIG(clk:=fbStartautotimer.Q);
          IF fbCycle_RTRIG.Q THEN
          sCurrentCycleState:= "Pressing cycle start";
          END_IF;
          IF bLimitTableZero = FALSE THEN
          bTableUp_valve:= TRUE;
          END_IF;
          iState:= 20;
          20:
          IF iPressure <= iPressure_setpoint AND NOT fbAutoOff_RTRIG.Q AND bLimitBottomTableDown THEN
          bTableDown_valve:= TRUE;
          sCurrentCycleState:= "Pressing to the pressure setpoint";
          xAutoZeroPos:= TRUE;
          ELSE
          bTableDown_valve:= FALSE;
          sCurrentCycleState:= "Cycle stopped, reset";
          END_IF;
          iState:= 30;
          30:
          // expression cycle completed, move the table upwards to 0 position
          fbZeropos_RTRIG(clk:=xAutoZeroPos);
          IF fbZeropos_RTRIG.Q AND NOT bLimitTableZero & fbAutoOff_RTRIG.Q THEN
          bTableUp_valve:= TRUE;
          iTotalAutoCycles:= iTotalAutoCycles +1;
          sCurrentCycleState:= "Zeroing table, cycle end";
          END_IF;
      END_CASE;
      

      And im totally clueless about what's wrong. I also should point out that i have all that code in one main .st file. Should i divide functions for manual operation and automatic cycle into another .st? Set individual tasks for them?

      Any help or tips on this would be very appreciated. Im basically out of ideas and my knowledge on PLC programming is narrow.

      Oh of course Mervis shows no errors. I can upload the project if someone is willing to take a look.

      posted in Mervis
      R
      r3sist
    • RE: Hydraulic Press project on Neuron M203 - beginner needs help

      @jaroslav_sobota said in Hydraulic Press project on Neuron M203 - beginner needs help:

      If segment LCD is all you need, maybe something like this could do the trick:
      https://en.papouch.com/tds-rs485-7-segment-led-display-p1922/

      You can connect it via RS485 and communicate using Modbus RTU.

      Oh, thanks, I was totally unaware of displays over RS485. Yes, this should work.
      Going to look for a suitable device then, and post updates here.

      posted in Mervis
      R
      r3sist
    • RE: Hydraulic Press project on Neuron M203 - beginner needs help

      @jaroslav_sobota
      Yes exactly. I just need anything to notify the operator directly on the machine about current pressure , and let him adjust this one pressure setpoint variable. It could even be a segment lcd.

      posted in Mervis
      R
      r3sist
    • RE: Hydraulic Press project on Neuron M203 - beginner needs help

      So we got most of the leaking solved, time came to code the auto cycle.
      While coding manal valve closing/openings on button presses was easy, this is where i began to struggle.
      I followed a guide which was based on a TwinCat 3, but obviously things are different between IDE's.
      What i would like to know is to how to properly init and call a simple timer and r_trig function block in mervis. Does it have to be manually added into the main.fbd, then called properly from main.st for example? Or can i just declare it in .st which would seem more convenient for me.

      VAR
      // timers
      fbStartautotimer:TON;
      // triggers
          fbAutoInit_RTRIG:R_TRIG;
          fbAutoOff_RTRIG:R_TRIG;
          fbCycle_RTRIG:R_TRIG;
          fbZeropos_RTRIG:R_TRIG;
      END_VAR
      

      Also im not sure if the code below will work even if I call the function blocks properly.

      // auto cycle
      
      // button mapping
      hw.$Neuron M203_DI2.10$:= bManualMode;
      hw.$Neuron M203_DI2.11$:= bAutoMode;
      hw.$Neuron M203_DI2.12$:= bAutoEjectorMode;
      // pressure setpoint and scaling
      iPressure:= REAL_TO_INT(hw.$Neuron M203_AI1.01$);
      iPressure_setpoint:= 200;
      fbAutoInit_RTRIG(clk:=bAutoCycleOn);
      fbAutoOff_RTRIG(clk:=bAutoCycleOff);
      
      IF bAutoMode & fbAutoInit_RTRIG.Q AND NOT fbAutoOff_RTRIG.Q THEN
          bPumpOn:= TRUE;
          iState:= 10;
      ELSE
          bPumpOff:= TRUE;    
          iState:= 0;
      END_IF;
      CASE iState OF 
          10:
          // timer init to let the pump run well
          fbStartautotimer(IN:bPumpOn,PT:T#2s);
          IF fbStartautotimer.Q THEN
              fbStartautotimer(IN:=FALSE);
          END_IF;
          fbCycle_RTRIG(clk:=fbStartautotimer.Q);
          IF fbCycletrigger_RTRIG.Q THEN
          iState:= 20;
          sCurrentCycleState:= "Pressing cycle start";
          END_IF;
          20:
          IF iPressure <= iPressure_setpoint AND NOT bLimitswitch2 & fbAutoOff_RTRIG.Q THEN
          bTableDown_valve:= TRUE;
          sCurrentCycleState:= "Pressing to the pressure setpoint";
          iState:= 30;
          ELSE
          bTableDown_valve:= FALSE;
          sCurrentCycleState:= "Cycle stopped, reset";
          END_IF;
          30:
          // expression cycle completed, move the table upwards to 0 position
          fbZeropos_RTRIG(clk:=iState:=30);
          IF fbZeropos_RTRIG.Q AND NOT bLimitswitch3 & fbAutoOff_RTRIG.Q THEN
          bTableUp_valve:= TRUE;
          iTotalAutoCycles:= iTotalAutoCycles +1;
          sCurrentCycleState:= "Zeroing table, cycle end";
          END_IF;
      END_CASE;
      

      I would appreciate a helping hand on this one.

      Also wondering if this: https://www.waveshare.com/wiki/3.5inch_HDMI_LCD

      can be hooked up to display the pressure? And assign some leftover DI's for +/- ?

      posted in Mervis
      R
      r3sist
    • RE: Hydraulic Press project on Neuron M203 - beginner needs help

      @josar Yes, we have a lot of leaking problems at the moment, but its almost finished. Still trying to figure out something more basic for HMI than a weintek panel. I will post the updates with some pictures soon, gonna take about 2 weeks I hope.

      posted in Mervis
      R
      r3sist
    • RE: Hydraulic Press project on Neuron M203 - beginner needs help

      Im back, got my hands on an used STS ATM/T 0-400bar, 0-10V output. Configured AI1.1 for voltage mode, plugged the sensor into air line, got some readings after the transformation on around 6,3-6,4bar so it seems correct.

      Now when i have the pressure value I should start coding the machine program itself.

      For first i would want and idle menu machine state, use some kind of case instruction to choose between the automatic and manual press mode where:
      In auto, some RO's would stay on until the before set pressure is met and until limit switches arent tripped.
      Where in manual, no more than 400bars and also to the min/max limit switch positions.

      Could you guys guide me or show some .st examples? I've no idea on how to start it right.

      Also is there a way to connect a simple display to neuron, and also program plc to output for example the A1.1 value?
      I know there is a full hmi panel available, but I would prefer something simple, + / - using DI's, and simple lcd/segment display for it, so an operator could adjust the set pressure for auto mode easily.

      posted in Mervis
      R
      r3sist
    • RE: Hydraulic Press project on Neuron M203 - beginner needs help

      Hi @martin-kudláček, yes, i did reconfigure the module, even twice, trying to swap between the sensor's voltage and current output, with the same result.
      New sensor is on the way, i should give some updates tomorrow.

      posted in Mervis
      R
      r3sist
    • RE: Hydraulic Press project on Neuron M203 - beginner needs help

      @martin-kudláček Very detailed tips, i found the setting immediately. I lost myself while looking for parameters under Variable Browser.

      I applied the transformation, first at Analog Type - > Current, i've set the points just like u said, but...

      Not sure, but 95% that my sensor is dead, cause the PLC Value reading was oscillating between 0.0078 to 0.0106 or something, the exact same reading is shown when there is nothing wired to the AI1.1/AGND on open contacts.

      I will try to check the pressure sensor alone, ordered another new one, and I will post back the results on a new sensor.

      Thanks a lot for help, will come back to this topic after it arrives.

      posted in Mervis
      R
      r3sist