Kalman Filter - Data Triggering when available

1 view (last 30 days)
Hi,
I have a kalman filter implemented in simulink. The filter is tested in a simulation environment works pretty well.
Now i have sensor data from different sensors. Since sensors have different sampling rate, i want to find a way to apply the correction step only when data exist. Have anyone did something similar?
I saw triggering subsystem blocks but I have never applied such thing. Ill be greatful if anyone can help out.

Accepted Answer

Umar
Umar on 14 Feb 2025

Hi @Hussein,

I don’t have Simulink installed on my system, only have access to Matlab mobile. After reviewing your comments, I did some research to resolve your issue. You can utilize Triggered Subsystem blocks in Simulink to handle the varying sampling rates of your sensor data and to control when the Kalman filter's correction step executes. Please click the following link for more guidance on this block.

https://www.mathworks.com/help/simulink/slref/triggeredsubsystem.html

Here’s a structured approach to implement this:

1. Understanding Triggered Subsystems: A Triggered Subsystem is designed to execute whenever it receives a specific trigger signal. This is particularly useful in your case, where you want to ensure that the Kalman filter only performs updates when new sensor data is available.The trigger signal can be derived from your sensor inputs; for instance, you can set it high (or true) when new data arrives.

2. Implementation Steps: Create a Triggered Subsystem: In Simulink, drag a Triggered Subsystem block into your model. You can find this block under `Simulink > Ports & Subsystems`.Configure Trigger Input: Connect the output of your sensor data processing (which indicates new data availability) to the trigger input of the subsystem. This input should be a Boolean signal that becomes true when new data arrives.Inside the Subsystem: Place your Kalman filter implementation inside this triggered subsystem. Ensure that it processes data only when triggered.Connect Sensor Outputs: If you have multiple sensors, you may need to combine their outputs or use separate triggered subsystems for each sensor depending on how you want to process the data.

3. Example Configuration:For instance, if Sensor 1 has a sampling rate of 100 Hz and Sensor 2 has a sampling rate of 50 Hz, you could set up two separate triggered subsystems:Subsystem 1 triggers on Sensor 1's output.Subsystem 2 triggers on Sensor 2's output.Each subsystem would then contain its own instance of the Kalman filter that updates its state based on the respective sensor's data.

4. Additional Considerations: Ensure that your Kalman filter is designed to handle cases where it might not receive updates for some time (e.g., implementing prediction steps when no new measurements are available).You may also consider adding logic to handle cases where multiple sensors provide conflicting information.

5. Testing and Validation: After implementing the triggered subsystems, thoroughly test your model by simulating different scenarios where sensors provide data at varying intervals. Monitor the behavior of your Kalman filter to confirm that it correctly updates its state only when new data is available.

Hope this helps.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!