VuS Power Configuration

From Seamonster

Jump to: navigation, search

Gen 3.2

Gen 3.1

Microcontroller-related

Other Microserver-Related


Contents

Introduction

The Vexcel Microserver (VuS) has multiple power supplies that are controlled (directly) by a microcontroller and (indirectly) by the Single Board Computer (SBC). This page describes how to configure these power supplies.


General Plan

The SBC runs a program called 'Agent' that can control power configuration. The Agent is run automatically when during boot the script file
/etc/init.d/Agent
executes .


WARNING!!! If you are modifying Agent behavior on an operational microserver: Disable the Agent program after logging in to prevent it from shutting the system down before you are through. Please see Microserver Quick Reference for more information.


The very short /etc/init.d/Agent script file includes an 'Agent' command with command line arguments (see the Gen 3.2 Agent page). These command line arguments are as follows:


 
# Agent a b c d e f g h i

where

a = modeAwake
b = modeRadio
c = powerOnSignal
d = radioOnMinutes
e = offsetHours
f = radioHourModulus
g = preRadioLeadMinutes
h = preAwakeLeadMinutes 
i = awakeOnMinutes


Notice that if only some of these sequential argument are supplied, say a, b, c and d only, then the remaining values will be assigned a default value. The argument we are concerned with here is argument c, which is the powerOnSignal. This is a number from 0 to 255.


Agent has an internal variable powerOnSignal which corresponds to command line argument c. Considered as 8 bits, from MSB 7 to LSB 0, each bit corresponds to a power supply toggle switch. These power supplies are described on the Gen 3.2 SBC Operations page, and for reference are copied here:


 
    128   Bit 7: 12 Internal
     64   Bit 6: 3p3 Internal 
     32   Bit 5: 5 External 
     16   Bit 4: 12 External 
      8   Bit 3: 3p3 External 
      4   Bit 2: AMP  
      2   Bit 1: WET 
      1   Bit 0: GPS 


During operation the Agent program (running on the SBC) will issue a power-on request to the microcontroller (running on the Power Conditioning Subsystem board). This request passes the value of powerOnSignal as the control value to the microcontroller. Hence to specify the system's "power on state" one simply edits /etc/init.d/Agent and changes the third command line argument to the appropriate value for powerOnSignal.


Example: Driving an External 12 Volt Device

Suppose that an external device (say a camera) requires 12 volts and will be on only when the VuS SBC is on. Connector JP53 on the VuS enclosure provides four pins (Click on the photo of the connectors here to see connector JP53) which act as 3 power supplies. One of these 4 pins is Ground and the other three are 12, 5, and 3.3 volts. These correspond to 3p3 External, 12 External, and 5 External supplies, or bits 3, 4, and 5 in the above table.


To enable the 12 volt supply we note that 12 External is Bit 4 (with decimal value 16). In addition to turning this power supply on we also wish to enable the Wifi AMP (Bit 2, value 4) and the 12 volt Internal supply (Bit 7, value 128) to power an internal WiFi Router. Finally we wish to power up the internal GPS board (Bit 0, value 1). In total then we want a powerOnSignal = 1 + 4 + 16 + 128 = 149.


The /etc/init.d/Agent file is edited so that the third command line argument reads '149'. The VuS is rebooted (again: see Microserver Quick Reference on how to do this) and the new power configuration is verified.


Making on-the-fly power changes

It is conceivable that during an "operational interval" you may wish to change the power state. This is beyond the scope of this page for the moment, but we do offer two comments on how to go about doing this.


First: Changing the power state during an operational interval should be done only by the Agent program. The reason for this is simply that other power-modification processes would potentially compete with the Agent resulting in non-desirable behavior. If the Agent program does not currently accommodate on-the-fly power state changes, then it can be modified to do so. The Agent runs a polling loop until it is time to shut down, so a check could be inserted in that polling loop for a new power setting. In this way the Agent would always "know" what the power state is supposed to be.


Second: If the Agent is going to modify the power state, the best practice is to first read the current power state through a query to the microcontroller, and then set the new state that modifies only the changed bits, keeping the others stable. The system should then make a smooth transition to the new power state without blinking or turning off any supplies that are supposed to remain on.

Personal tools