Advanced Energy Monitor Commands#

Simplicity Commander supports reading and logging current measurement data from the Advanced Energy Monitor (AEM) of the adapter.

Measure Average Current in a Time Window#

The aem measure command measures the average current in a time window. The --windowlength is in milliseconds (ms) and is defined as the duration where current samples will be measured and averaged. The default is 100 ms if no time is given. Ongoing measurements can be terminated by pressing CTRL+C.

Command Line Syntax

$ commander aem measure [--windowlength <time in ms>]

Command Line Input Example

$ commander aem measure --windowlength 200

Command Line Output Example

Averaged over 200 ms:
Current [mA]: 5.359
Power [mW]  : 17.763
Voltage [V] : 3.314
DONE

Log Current Measurements as Time Series Data#

The aem dump command continuously measures the current and logs the measurement data (voltage and current). If --outfile is provided, the data is logged in the specified output file, otherwise the data is streamed to the terminal window. If --duration is provided, the logging will stop after the specified time, otherwise the logging will continue indefinitely. In both cases, the logging may be terminated at any time by pressing CTRL+C. The --noheader option can be passed to omit the column header from being included in the output file. The options described here are also applicable for use with the other options related to the aem dump command, but will be omitted in the next sections for the sake of brevity.

If the --datarate option is provided, the rate of which the current measurements are logged is set to the specified rate. This will collect samples over a time equal to the reciprocal of the provided data rate, and average these samples before storing the data in the output log (terminal or specified output file). The data rate must be equal to or larger than 1 Hz, and also equal to or less than the AEM sampling rate of the adapter in question. If --datarate is not provided, the command will default to the AEM sampling rate of the adapter.

The output file must be of either .txt or .csv format.

Command Line Syntax

$ commander aem dump [--outfile <filename> --datarate <rate in Hz> --duration <time in s> --noheader]

Command Line Input Example

$ commander aem dump --outfile output.csv --duration 10

This command will log AEM measurements for 10 seconds and store the data in 'output.csv', including a column header.

Command Line Output Example

Logging...
Send CTRL+C to abort.
Measurements written to file: 10000
Measurements written to file: 20000
<shortened data for documentation>
Measurements written to file: 90000
Measurements written to file: 100000
Closed file 'output.csv',
100000 measurements written to file.
DONE

Start Logging on Trigger Event#

Trigger parameters can be set up to start logging when either the current is above a certain current threshold (in mA) or below a certain threshold. The --triggerabove and --triggerbelow options can be included to specify the type of triggering event. Only one of these options can be used when issuing this command.

Using the --triggertimeout option, you can specify how long the command should wait for the trigger event before timing out. Additionally, the --pretrigger option may be included to allow for logging of the measurements in the specified time window leading up to the trigger event. If the actual trigger event occurs before the length of the pre-trigger time has passed (after the command was executed), the actual included pre-trigger data will be the data that was collected from the execution of the command until the trigger event has occurred.

Note: Pay attention to the units used with the following options.

Command Line Syntax

$ commander aem dump [--triggerabove <current in mA> --triggerbelow <current in mA> --triggertimeout <timeout in s> --pretrigger <time in ms>]

Command Line Input Example

$ commander aem dump --triggerabove 2 --triggertimeout 10 --pretrigger 250 --datarate 1000

This command logs AEM measurements at a rate of 1000 Hz to the console output (indefinitely), starting from when the measured current is greater than 2 mA (milliampere). Data recorded up to 250 ms (milliseconds) before the actual trigger event will also be logged. If no trigger condition is met, the command will time out after 10 seconds.

Command Line Output Example

Logging...
Send CTRL+C to abort.
Waiting for trigger (current above 2 mA)...
Triggered at timestamp: 155119217 [us], 3.32649 seconds after sampling started.
154869217,1.00552,3.30057
154870217,1.00447,3.30057
154871217,1.00568,3.30057
<shortened data for documentation>
155117217,1.0006,3.3007
155118217,1.00196,3.30029
155119217,4.96464,3.29997
155120217,4.96765,3.29997
155121217,4.96612,3.30016
^C
Sampling was stopped by user.
DONE

Calibrate the Advanced Energy Monitor#

The Advanced Energy Monitor (AEM) can be calibrated using the aem calibrate command.

In order to retain the AEM accuracy, calibration should be performed after changes in the target voltage are applied, or if the temperature of the adapter boards changes.

Note: Target power will be turned off during AEM calibration.

Command Line Syntax

$ commander aem calibrate

Command Line Input Example

$ commander aem calibrate

This command line initiates calibration of the AEM.

Command Line Output Example

Calibrating AEM (target power is off during calibration).
Successfully calibrated AEM.
DONE