RPICT Minimum Output Rate: Difference between revisions

From lechacal
Jump to navigation Jump to search
No edit summary
Line 27: Line 27:


Where
Where
* Ntasks is the number of channel of the number of node the mcu has to compute.
* Ntasks is the number of channels or the number of node the mcu has to compute.
* Ncycle is the number of cycles used to compute the RMS value.
* Ncycle is the number of cycles used to compute the RMS value.
* Frequency is the expected frequency of the signal. (This is usually 50 or 60Hz).
* Frequency is the expected frequency of the signal. (This is usually 50 or 60Hz).
= How to achieve lower output rate?=
= Getting away from the problem entirely=
The issue with duplicate values might not always be a problem for some application. This might probably not affect your application down the line. You would need to decide if that's the case or not. However in general we would recommend setting the appropriate output rate for best results.
A way to get around the issue is to use the full output firmware. The output method here is very different as each channel is given in serial as soon as it has finished computing.<br>
Please to this guide below for more details about this.
[[RPICT Full Output Firmware]]

Revision as of 20:10, 10 November 2023

Why is there a minimum output rate?

The micro-controller performs task once after the other. It must complete the sampling of all configured channels before sending another serial output out.

The example below show the task scheduling where 3 channels are computed. The output rate must be larger than the time it takes to sample all channels.

What happen if the output rate is too low

If a low output rate is set the microcontroller will respect what is configured and output serial data at the given rate. The output stream will show duplicate values in subsequent output.

Take a look at the example below with a RPICT8 card sampled at 2 seconds where the minimum output rate is 3.2 seconds.
Some of the duplicated values are circled in red.

In this case because the micro-controller is not able to sample all channels it outputs the result in memory twice for some of them.

Calculating the minimum output rate

The minimum output rate is given by

Where

  • Ntasks is the number of channels or the number of node the mcu has to compute.
  • Ncycle is the number of cycles used to compute the RMS value.
  • Frequency is the expected frequency of the signal. (This is usually 50 or 60Hz).

How to achieve lower output rate?

Getting away from the problem entirely

The issue with duplicate values might not always be a problem for some application. This might probably not affect your application down the line. You would need to decide if that's the case or not. However in general we would recommend setting the appropriate output rate for best results.

A way to get around the issue is to use the full output firmware. The output method here is very different as each channel is given in serial as soon as it has finished computing.
Please to this guide below for more details about this.

RPICT Full Output Firmware