Hi, is it possible to generate hardware PWM with RPi, using GPIO12 or GPIO13? I see there are flags for these pins in 0120-00_IO_Flags example, but I want to be sure. Thanks, Stepan
Best posts made by stepan.ozana
-
HW PWM on RPi?
Latest posts made by 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).
-
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 -
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:
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.
-
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 -
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.
-
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")? -
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 -
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.
-
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? -
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