Tweeted twitter.com/StackArduino/status/869837887239589888
2 added 345 characters in body
source | link

I am performing a control analysis on an Arduino board.
As such, I want to minimize the board cycle duration.
(Faster board = faster controller).

Introduction:

I use Mathworks Matlab/Simulink to program the board.
I created a model in Simulink,
and embedded this model into my Arduino Mega 2650.

The model includes an Arduino Serial Transmit block.
I am therefore able to use Matlab software on my PC to request
serial transmission from the Arduino board to Matlab.

The Arduino Mega 2650 has the following serial constraints:

  • Maximum output buffer: 64 [byte]
  • Maximum baud frequency: ~115,000 [bit/s]

Problem:

To perform my control analysis,
I want to minimize the board cycle duration, and
I want to read several signals simultaneously.

The time it takes to read all signals sent
(as dictated by the baud rate)
is the primary obstacle in reducing my board cycle duration.

Requested Information:

Is it possible to reduce the board cycle duration
without reducing the duration in which
the serial transmission must be completed.

For example,
what if I run my board at 0.001 [s],
but I can only send all of my signals in 0.010 [s], what will happen during my reads?

If I read every 0.001 [s], obviously I will not receive all of the data,
as this is not feasible in the time that I am allotting.
My concern is regarding what will happen if I read every 0.010 [s]:

  1. Will the startpassing of the nextseveral board cyclecycles before the read completes affect the serial output bufferread?
  2. Is there a method to lock the serial output buffer while reading
    (such that the data does not change midread)?
  3. How long does it typically take to refill the serial output buffer with the next set of data?

Conclusion:

Ultimately, I would like to run the board as fast as possible,
since I believe that this could significantly improve my controller's performance,
despite not being able to read these additional cycles.

I am performing a control analysis on an Arduino board.
As such, I want to minimize the board cycle duration.
(Faster board = faster controller).

Introduction:

I use Mathworks Matlab/Simulink to program the board.
I created a model in Simulink,
and embedded this model into my Arduino Mega 2650.

The model includes an Arduino Serial Transmit block.
I am therefore able to use Matlab software on my PC to request
serial transmission from the Arduino board to Matlab.

The Arduino Mega 2650 has the following serial constraints:

  • Maximum output buffer: 64 [byte]
  • Maximum baud frequency: ~115,000 [bit/s]

Problem:

To perform my control analysis,
I want to minimize the board cycle duration, and
I want to read several signals simultaneously.

The time it takes to read all signals sent
(as dictated by the baud rate)
is the primary obstacle in reducing my board cycle duration.

Requested Information:

Is it possible to reduce the board cycle duration
without reducing the duration in which
the serial transmission must be completed.

For example,
what if I run my board at 0.001 [s],
but I can only send all of my signals in 0.010 [s], what will happen?

If I read every 0.001 [s], obviously I will not receive all of the data.
My concern is regarding what will happen if I read every 0.010 [s]:

  1. Will the start of the next board cycle affect the serial output buffer?
  2. Is there a method to lock the serial output buffer while reading?
  3. How long does it typically take to refill the serial output buffer with the next set of data?

I am performing a control analysis on an Arduino board.
As such, I want to minimize the board cycle duration.
(Faster board = faster controller).

Introduction:

I use Mathworks Matlab/Simulink to program the board.
I created a model in Simulink,
and embedded this model into my Arduino Mega 2650.

The model includes an Arduino Serial Transmit block.
I am therefore able to use Matlab software on my PC to request
serial transmission from the Arduino board to Matlab.

The Arduino Mega 2650 has the following serial constraints:

  • Maximum output buffer: 64 [byte]
  • Maximum baud frequency: ~115,000 [bit/s]

Problem:

To perform my control analysis,
I want to minimize the board cycle duration, and
I want to read several signals simultaneously.

The time it takes to read all signals sent
(as dictated by the baud rate)
is the primary obstacle in reducing my board cycle duration.

Requested Information:

Is it possible to reduce the board cycle duration
without reducing the duration in which
the serial transmission must be completed.

For example,
what if I run my board at 0.001 [s],
but I can only send all of my signals in 0.010 [s], what will happen during my reads?

If I read every 0.001 [s], obviously I will not receive all of the data,
as this is not feasible in the time that I am allotting.
My concern is regarding what will happen if I read every 0.010 [s]:

  1. Will the passing of several board cycles before the read completes affect the read?
  2. Is there a method to lock the serial output buffer while reading
    (such that the data does not change midread)?
  3. How long does it typically take to refill the serial output buffer with the next set of data?

Conclusion:

Ultimately, I would like to run the board as fast as possible,
since I believe that this could significantly improve my controller's performance,
despite not being able to read these additional cycles.

1
source | link

Arduino Mega 2650 + Matlab/Simulink - Serial decimation

I am performing a control analysis on an Arduino board.
As such, I want to minimize the board cycle duration.
(Faster board = faster controller).

Introduction:

I use Mathworks Matlab/Simulink to program the board.
I created a model in Simulink,
and embedded this model into my Arduino Mega 2650.

The model includes an Arduino Serial Transmit block.
I am therefore able to use Matlab software on my PC to request
serial transmission from the Arduino board to Matlab.

The Arduino Mega 2650 has the following serial constraints:

  • Maximum output buffer: 64 [byte]
  • Maximum baud frequency: ~115,000 [bit/s]

Problem:

To perform my control analysis,
I want to minimize the board cycle duration, and
I want to read several signals simultaneously.

The time it takes to read all signals sent
(as dictated by the baud rate)
is the primary obstacle in reducing my board cycle duration.

Requested Information:

Is it possible to reduce the board cycle duration
without reducing the duration in which
the serial transmission must be completed.

For example,
what if I run my board at 0.001 [s],
but I can only send all of my signals in 0.010 [s], what will happen?

If I read every 0.001 [s], obviously I will not receive all of the data.
My concern is regarding what will happen if I read every 0.010 [s]:

  1. Will the start of the next board cycle affect the serial output buffer?
  2. Is there a method to lock the serial output buffer while reading?
  3. How long does it typically take to refill the serial output buffer with the next set of data?