REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login
    1. Home
    2. stepan.ozana
    3. Posts
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 24
    • Posts 55
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by stepan.ozana

    • RE: How to run a compiled .rex model from command line for fast repeated cost-function evaluation

      @cechurat
      Yes, sure. Sorry I forgot to upload previously.

      kanal2_od_000645.csv

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: How to run a compiled .rex model from command line for fast repeated cost-function evaluation

      @cechurat Hi Tomas,

      Thank you for your valuable comments.

      I tried running:

      "c:\Program Files\REX Controls\REXYGEN 3.0.5.17331\Bin\RexCore.exe" -z exec.file=myproject_exec.rex -z simulation.enabled=1 -z simulation.tickmin=0 -z simulation.steps=20000 -z simulation.start=0

      I do not think it was successful, because it did not do anything. At the very least, it was supposed to create f.txt via the SILO block.

      I believe there may be something wrong with this REXYGEN project, because whenever I try Local Simulation within REXYGEN Studio, it reports a RexCore crash; please see the screenshot in the bottom-right corner. As a consequence, the application freezes and I have to kill the RexCore process manually.

      In Real Time mode, it seems to run normally: it shows trends and creates f.txt via the SILO block. There is also a minor issue with overtime in diagnostics, probably related to the PYTHON blocks. I am not sure whether this issue is critical enough to cause RexCore to crash in Local Simulation mode.

      However, I believe this is a separate issue and is not directly related to the original topic of running Local Simulation mode in general.

      Below you will find the project version needed to reproduce the issue.

      Best regards,
      Stepan

      Project:
      FC_Compact_Rezerovar_REXYGEN_V2.zip

      34fcdd70-0f22-45e8-bede-df44198e4d9c-image.png

      posted in REXYGEN Studio
      S
      stepan.ozana
    • How to run a compiled .rex model from command line for fast repeated cost-function evaluation

      Hi,
      I have the following use case.

      My REXYGEN model contains blocks with tunable parameters. One of the model outputs represents the value of interest, for example a cost function.

      I would like to run the compiled model (*.rex) from the command line as fast as possible, ideally offline rather than in real time. For each run, I need to:

      • provide a specific set of parameter values,
      • execute one full evaluation of the model,
      • obtain the resulting value of the selected output.

      More specifically, I want to call the model repeatedly from an external environment such as Python or Julia in order to tune the parameters and minimize the cost function.

      Could you please advise what is the recommended workflow for this in REXYGEN?

      In particular, I would like to know:

      • whether this can be done with the compiled .rex model directly,
      • how to pass parameter values from an external program,
      • how to read back the value of a selected output,
      • and whether Local Simulation mode is the right approach for this kind of fast offline repeated evaluation, for example with a fixed number of simulation steps or counter ticks.
        Is this workflow supported, and if so, what is the simplest way to implement it?
        Thanks Stepan
      posted in REXYGEN Studio
      S
      stepan.ozana
    • Vector demultiplexer VTOR+Python processing

      Hi,
      I'd like to ask why outputs of VTOR1 shows all zeros. Both Python blocks share the same python script.
      It seems like the issue is connected to sources of u0,u1,u2.
      Source project: ex.zip
      8ff11fa1-937b-4c2a-bf6f-5cb181f64647-image.png

      Best regards, Stepan

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: Issue with the SAT block

      @Jan-Reitinger Thanks for explanation! I promise I will study the documentation in more details next time. However, still I have some remarks here.

      Regarding SAT documentation:
      "The maximal rate at which the active limits may vary is given by time constants tp (positive slope) and tn (negative slope)."
      This statement is ambigous for me.
      If we say maximal rate of the signal is affected by some parameter rate_max, then from technical point of view, higher
      rate_max means higher allowable rate (1st derivative), thus indicating being close to immediate changes of the signal.
      So if rate_max reaches infinity, immediate changes are allowed.

      Then we should say the maximal rate at which the active limits may vary is given by INVERSE OF time constants tp,
      and rate_max = 1/tp, meaning that the meaning of logic in choice of parameters tp and tn is actually inverse.

      This is actually declared in the documentation of RLIM block as the steepest rise per second, and should be also repeated for for documentation of SAT to keep documentation consistent.

      I tried series connection of CNR and RLIM, and changing CNR on the fly. If tp=0.1, then maximal slope is 10, and the new value of CNR is
      reached in 0.1s, following linear ramp signal. This is OK, and similar functionality works for SAT block.

      Also, reading "time constants tp and tn" may indicate presence of some dynamics like first-order system 1/(tp*s+1) or 1/(tn*s+1), because this technical term is ususally used
      when talking about dynamic systems. It would be much better to simply use "parameters tp and tn" instead to make things clear.

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: Remote parameter setting

      @Jan-Reitinger I am thankful that you made this clear !

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: Issue with the SAT block

      @Jan-Reitinger

      Thanks. I tried both 3.00.2 rev. 16743 and 3.04 17159. Check out the video recording:

      https://drive.google.com/file/d/1-A4vBMiOb91N9w5tX6H8bUDGmSjGPXCG/view?usp=sharing

      posted in REXYGEN Studio
      S
      stepan.ozana
    • Issue with the SAT block

      Hi,
      I am facing some troubles with the SAT block.
      It should respect either variable limits or fixed limits, based on HLD signal.
      However, in my project, only inner fixed limits (+0.75 , -0.75) are considered no matter if HLD is on or off.
      3097a4d8-4da6-48f9-9e20-eccb1c47f56c-image.png
      de7acc7b-b4bd-4835-8038-e4affeb2b21d-image.png

      posted in REXYGEN Studio
      S
      stepan.ozana
    • Remote parameter setting

      Hello,

      I am encountering issues with remote parameter setting. My initial goal was to assign a specific filename to the CNA block so that I could specify the data file before running my project. After several unsuccessful attempts, I investigated further and discovered additional issues.

      Below is a summary of the four experiments I conducted:

      1. Remote Parameter Setting via SETPS for the CNS Block

      I attempted to change the scv parameter of the testing CNS block using the SETPS command.

      The parameter did not update as expected; it remained unchanged.

      1. Remote Parameter Setting via SETPX for the CNS Block

      Repeating the same experiment, this time I used the SETPX command to change the scv parameter.

      This approach worked correctly—the scv parameter was successfully updated.

      Since both experiments target the same parameter in the same block, SETPS and SETPX should ideally produce equivalent results.

      1. Remote Parameter Setting via SETPX for the CNA Block

      I attempted to set a specific filename for the CNA block to allow pre-specification of the data file.

      First, I tried to change the filename parameter, but this was unsuccessful.

      I also tried updating the nmax parameter, but that too did not work.

      1. Remote Parameter Setting via SETPX for the CNR Block

      As a control test, I changed the ycn parameter of the testing CNR block using SETPX.

      This operation executed without any issues.

      The REXYGEN project is attached for further review.

      cdb282fb-6b91-497f-9257-bb7206ba5c7f-image.png

      myproject_exec.mdl myproject_task.mdl

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: EKF example

      @Jan-Reitinger Nice. Just one small remark: There's no need to use a two-dimensional input here—even formally. You can define a system with a one-dimensional input, a certain number of states, and possibly a different number of outputs. Instead of using u(t)=[sin(2πt);0] you can simply write u=u1=sin(2πt).

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: EKF example

      @Jan-Reitinger I suggest having both "reference model" suffering from noises and "reference exact model" for comparison of EKF efficiency and performance.
      Please take a look at my suggestions and let me know your opinion. It seems to work. Maybe it needs a bit tuning in terms of Q,R, versus noise generators. Also, I am fighting with alignment of free text within boxes.
      Here is my update:
      linear-system_v2.zip

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: EKF example

      @Jan-Reitinger Sure! I'm glad to have contributed to the collection of examples. Regarding the timing issue, I may have used the wrong terminology. I don’t observe 'Overtime' in the Task Diagnostics, but I do see 'CoreWarning GTimer: Period overtime.' in the System log.

      This issue occurs in the original 'EKF.zip' mentioned at the beginning of this thread—at least on my PC. It may function correctly on other machines. It may be due to using Windows instead of Linux. I will tes it on Linux.

      Here is the screenshot:
      gtimer_overtime.png

      Moreover:
      I just realized that the current version of the example is not fully correct because it lacks process noise and measurement noise. It seems that process noise should be implemented within the block currently referred to as the 'Reference Exact Model,' which would no longer be 'exact.' Measurement noise can be simply introduced as an added signal to the model's output.

      I will try to incorporate these modifications in the next few days. I plan to create a 'Reference Model' that mimics the real process while accounting for both types of noise. Once I have refined the example to meet my expectations, I will get back to you.

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: EKF example

      @Jan-Reitinger I upgraded your example. Now it uses exact reference model both for verification and emulating output measurements to be used as input to the estimator.

      However, there is some timing issue here. I use tick=0.02, ntick0=4. It means period of the task is 80 ms. If I go lower with that, I receive overtime in diagnostics. This is odd, because it means that computational load is too high.
      It should be much less than that.
      Here is my current version:
      EKF_John.zip

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: Exchanging data between tasks

      @stepan-ozana Regarding "Update - second part of the problem": In the meantime, I conducted a simple test of my idea using CallExt(".Taskname.blockname"), and it seems to work. If anyone is interested, I can share the test results here.

      .test_on_demand_running.zip

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: Exchanging data between tasks

      Update - second part of the problem : I am also wondering if slower task can be run "on-demand" - asynchrounously, from the faster task. Is there any similar mechanism like for the general blocks inside some tasks that can be halted (marked as red-crossed blocks) and run at specific times using REXLANG with CallExt(".blockname"). Or is it possible to use the entire connection string in CallExt? Such as
      CallExt(".Taskname.blockname")?

      posted in REXYGEN Studio
      S
      stepan.ozana
    • Exchanging data between tasks

      Hi,

      I’m wondering if there’s a way to exchange data asynchronously between tasks. Specifically, I have two tasks: one running faster and another running significantly slower. The slower task performs a computational process that varies in execution time within known rough limits, which is why I’ve set its period slightly oversized.

      My goal is to pass the results from the slower task back to the faster task as soon as the computation is complete, rather than waiting for the next cycle of the slower task.

      Is there a recommended approach for achieving this?

      Thanks,
      Stepan

      posted in REXYGEN Studio
      S
      stepan.ozana
    • RE: EPC timing, elapsed time

      @stepan-ozana Little update: Under Linux, using RPi, it behaves much better. BUSY signal stays ON for 2 task periods.

      posted in General
      S
      stepan.ozana
    • EPC timing, elapsed time

      Hi, I have a question related to the EPC block.
      Let's suppose I have an external program to be called and executed by EPC block. I used example "\0202-11_EPC_Generic_Linux_Script" , made some modifications and made it run under windows, using epc_script.bat where windows syntax is given to run particular external program (*.EXE file).
      I was wondering how much time is spent on execution so I concentrated on analysis of BUSY output of EPC block.
      It seems like BUSY signal is ON for quite a long time.
      Then I made a special extreme variant where epc_script.bat is completely empty so that it does not do anything when launched.
      In my executive I used tick=0.01, ntick0=2. However, BUSY signal stays ON for 250-300 miliseconds each time EPC runs the script which does nothing (also, ifns and ofns are empty).
      Is it OK? Which activities occure during this time?

      posted in General
      S
      stepan.ozana
    • RE: Modbus Tcp/IP communication Rpi(Rexygen)<->PC(Matlab)

      @Jan-Reitinger I share my solution if anyone is interested. It shows writing and reading uint16 and double values over the Modbus TcpIP between some REXYGEN target hosting the Modbus server on the client (slave) side and Matlab running on PC.
      example_ModbusTcpIP_Comm_RpiToPC.zip

      posted in Communication (RS232
      S
      stepan.ozana
    • RE: Modbus Tcp/IP communication Rpi(Rexygen)<->PC(Matlab)

      @Jan-Reitinger UPDATE:
      Now I'm able to read and write uint16 numbers, and I will focus on doubles.
      I still have some doubts about this solution, for example where the modbus server is actually running or by which machine is the modbus server created (Matlab's modbus command seems to connect somee server and not to create any, and RPi hosts the slave part).

      posted in Communication (RS232
      S
      stepan.ozana