Optimal offset calculation for cyclic CAN BUS message scheduling

Calculate optimal offset for cyclic CAN bus message scheduling
148 download
Aggiornato 19 feb 2016

Visualizza la licenza

The function calculates optimal (best balanced transmission queue load) transmission offset for a single CAN bus node given a vector of transmitted messages cycle times (in milliseconds) with a given time-quantum granularity (i.e. microcontroller CANBUS task periodic routine).
Please see test_canbus_msg_opt_offset.m for some examples.
The algorithm places next message at the maximum distance from the other allocated messages, within the longest contiguos sequence of time slots with lowest load.
No toolbox required.
% CANBUS_MSG_OPT_OFFSET Calculate optimal offset for cyclic CAN bus message scheduling
%
% [ Offset_ms, Load, MsgAllocation ] = canbus_msg_opt_offset( T_msg_ms, granularity_ms )
% calculates optimal (best balanced transmission queue load) transmission
% offset for a single CAN bus node given a vector of transmitted messages
% cycle times (in milliseconds) with a given time-quantum granularity
% (i.e. microcontroller CANBUS task periodic routine).
%
% INPUT
% T_msg_ms vector of message cyclic times [ms], orderered by
% increasing cycle time and decreasing priority
% granularity_ms resolution of cyclic message handler routine
%
% OUTPUT
% Offset_ms optimal time offset for message in milliseconds,
% same order as T_msg_ms
% Load size of queue at time-quantum
% MsgAllocation matrix visualizing message scheduling
% where MsgAllocation(row,col) is the message index
% as per T_msg_ms input vector transmitted at
% time-quantum "col" and at queue position "row"
%
% Based on paper:
%
% Scheduling messages with offsets on Controller
% Area Network - a major performance boost
% Mathieu Grenier1, Lionel Havet2, Nicolas Navet2
% August 9, 2008
%
% Available at: http://nicolas.navet.eu/publi/offsetsCAN_RTaW.pdf
%

Cita come

Guido Albertin (2025). Optimal offset calculation for cyclic CAN BUS message scheduling (https://it.mathworks.com/matlabcentral/fileexchange/55506-optimal-offset-calculation-for-cyclic-can-bus-message-scheduling), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2014b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0