REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login
    1. Home
    2. Jan Reitinger
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 65
    • Best 1
    • Controversial 0
    • Groups 1

    Jan Reitinger

    @Jan Reitinger

    administrators

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

    Jan Reitinger Unfollow Follow
    administrators

    Best posts made by Jan Reitinger

    • RE: RPi internet issues with REXYGEN 3.0

      @MikeyH Hi Mike,
      We found out that there were changes to systemd in Bookworm. On the clean image, there is a problem in DNS after installing DWM. We will adjust the DWM installation accordingly so that everything works on Bookworm and older distributions. We'll let you know when we have a solution.

      Cheers,
      Jan

      posted in REXYGEN Studio
      J
      Jan Reitinger

    Latest posts made by Jan Reitinger

    • RE: Issue with the SAT block

      @stepan-ozana
      The problem is caused by a large value in the parameters tn and tp. The change occurs, but it is very slow. For a faster transition between values, set lower parameter values. For an immediate change, set 0.

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: Issue with the SAT block

      @stepan-ozana Hello,
      thank you for your report.

      Please, what version of REXYGEN are you using? I've tested it now on 3.0.4.17197 and everything seems to work. I'm attaching a printscreen and the project.
      327187a5-26b0-4640-99c3-20348af4e7b4-image.png myproject_exec.mdl myproject_task.mdl

      Best regards,
      Jan

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: Remote parameter setting

      Hello Štěpán,

      Thanks for the detailed summary — that’s really helpful!

      Regarding the first experiment with the SETPS command:
      The reason the CNSTEST1:scv parameter wasn’t updated is due to the SETF parameter of the SETPS block being set to "on". In this configuration, the value is only updated on a rising edge at the SET input.
      To allow the value to be updated continuously, set SETF to "off". This way, the parameter will be updated in each cycle regardless of input transitions.

      As for the issue with setting the CNA:filename parameter:
      The filename specified here is not part of the application on the target device. Instead, the file resides on the host PC, and its contents are imported into the project during compilation.
      That’s why the filename parameter cannot be changed online — it only serves as a reference for the compiler, not as a runtime variable.
      Similarly, updating the nmax parameter isn't possible either, because REXYGEN does not support dynamic arrays — both the size and content of arrays are fixed during compilation.

      As a general rule, parameters that can be modified online via SETP blocks are the same ones you can manually change in Watch mode — in other words, those that are not greyed out in the parameter list. If a parameter is greyed out, it means it’s read-only during runtime and cannot be changed programmatically either.

      8f72a40a-bfcf-4242-832a-7caabc2017e3-image.png

      Cheers,
      Jan

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: EKF example

      @stepan-ozana
      Thanks, that looks great! I'll modify the schema a little more to match the conventions of the other blocks and include it in the installation.

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: EKF example

      @stepan-ozana Thank you for your valuable insights! Your contribution to the collection of examples is greatly appreciated.

      In the original 'EKF.zip' file mentioned at the beginning of this thread, the timing parameters were incorrectly set—my apologies for that. The best way to correct them is by changing the start and stop values in the task1 block to -1, as outlined in the manual. The log message 'CoreWarning GTimer: Period overtime.' appears whenever the task execution exceeds the maximum allowed time, which can be observed in Diagnostics. If this warning appears in the log while the Max time in Diagnostics does not exceed the allocated execution time (20 ms in the case of EKF.zip), it indicates an error.

      We would greatly appreciate any further insights and improvements from your side. I had planned to simulate measurement noise similarly to your approach—by adding white noise to the measurement vector—but I hadn’t considered process noise. For your reference, I’m sharing the updated version of the example, which includes your reference model and the corrected timing parameters.

      Linear system.zip

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: EKF example

      @stepan-ozana
      First of all, thank you very much for adding the reference model. If you agree, I would like to add this model to the example on EKF, which is already part of the daily version of REXYGEN.

      As for the timing. I think the problem may be in the Python block, which takes significantly longer to execute than the native blocks. Try looking in the Diagnostics and at the statistics on the execution of the task.
      17766e3a-d6bf-46ee-9616-28465ebb2c74-image.png

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: EKF example

      EKF - Linear System Model

      This document describes the use of the Extended Kalman Filter (EKF) in the REXYGEN environment for state estimation of a linear system.

      System Description

      The system is described by the following differential equations:

      \begin{aligned}
      \frac{dx(t)}{dt} &= f(x(t), u(t)) + w(t),\\
      y(t) &= h(x(t), u(t)) + v(t),\\
      \hat{x}(t) &\sim \mathcal{N}(x, P),\\
      w(t) &\sim \mathcal{N}(0, Q),\\
      v(t) &\sim \mathcal{N}(0, R).
      \end{aligned}
      

      where:

      • $ x(t) $ is the state vector,
      • $ u(t) $ is the input vector,
      • $ y(t) $ is the output vector,
      • $ w(t) $ is the process noise,
      • $ v(t) $ is the measurement noise,
      • $ \hat{x}(t) $ is the estimated state vector,
      • $ x $ is the mean (expected value),
      • $ P $ is the state estimation covariance matrix,
      • $ Q $ is the process noise covariance matrix,
      • $ R $ is the measurement noise covariance matrix.

      State Model of the System

      The system dynamics are defined by the function $ f(x(t), u(t)) $:

      f(x(t), u(t)) =
      \begin{bmatrix}
      \frac{dx_1(t)}{dt} \\
      \frac{dx_2(t)}{dt} \\
      \frac{dx_3(t)}{dt} \\
      \frac{dx_4(t)}{dt}
      \end{bmatrix}
      =
      \begin{bmatrix}
      -x_1(t) + x_2(t) \\
      -x_2(t) + x_3(t) \\
      -x_3(t) + x_4(t) \\
      -x_4(t) + u_1(t)
      \end{bmatrix}.
      

      Jacobian of the State Function

      The Jacobian $ f(x, u) $ with respect to the state vector $ x $ is given as:

      \frac{df(x(t), u(t))}{dx} =
      \begin{bmatrix}
      -1 & 1 & 0 & 0 \\
      0 & -1 & 1 & 0 \\
      0 & 0 & -1 & 1 \\
      0 & 0 & 0 & -1
      \end{bmatrix}
      

      Output Measurements

      The first set of output measurements (which, in this example, depend linearly on the state variables) for input EKF:nz = 1 is defined as:

      y(t) = h_1(x(t), u(t)) = 
      \begin{bmatrix}
      x_1(t) \\
      2 x_2(t) + 0.5 x_4(t)
      \end{bmatrix},
      

      with the corresponding Jacobian:

      \frac{dh_1(x(t), u(t))}{dt} =
      \begin{bmatrix}
      1 & 0 & 0 & 0 \\
      0 & 2 & 0 & 0.5 \\
      \end{bmatrix}.
      

      The second set of output measurements (for input EKF:nz = 2) is not used.


      The system description is programmed into the REXLANG block.

      This description serves as a basis for implementing the EKF in REXYGEN using the EKF function block. Further details can be found in the official documentation: EKF Block in REXYGEN.

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: EKF example

      @bech Hi,
      here is a Markdown file describing the system, which is implemented in the REXLANG block. To view the equations correctly, copy the file's contents into an online editor, such as this one: https://markdownlivepreview.org

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: EKF example

      @bech Hi,

      I'm sending an example of using EKF for a linear model. Please take a look at the code in the REXLANG block. Unfortunately, I don't have time to document the example in more detail right now. However, I should have time next week, so I'll send an improved version then.

      Best regards,
      Jan
      EKF.zip

      posted in REXYGEN Studio
      J
      Jan Reitinger
    • RE: REXduino - Communication failure between Raspberry PI and Arduino_MEGA

      @mtomek Hello,
      I'm really sorry—I somehow overlooked the fact that you were posting in this old thread. The "Warning 1 1" indicates that the buffer for serial communication between the Master and Slave devices is full:

      #define WARNING_SERIAL 1
      #define WARNING_SERIAL_BUFFER_FULL 1
      

      Have you added any new data communication or changed the communication speed recently? I’d also like to point out that REXduino is a third-party project, and we don’t have direct control over it. I found the explanation for the warning directly in the source code here:
      https://github.com/jaroslavs/REXduino/blob/master/REXduino_slave/REXduino_slave.ino

      Cheers,
      Jan

      posted in General
      J
      Jan Reitinger