Panamax MLGenericDevice Driver

From Cinemar Wiki
Jump to: navigation, search

MLGenericDevice Driver


Panamax UPS

Contributed by:
Tom Pate
My Connected Home
Ann Arbor, MI
www.my-connected-home.com
Phone (734) 395-6964 FAX (484) 970-0401


About

This is an MLGenericDevice Driver for 2-way serial communication with the Panamax "MAX Home Cinema Uninterruptible Power Supply" Model M1500-UPS. The Owner's Manual listing all serial communication information is located here: http://www.panamax.com/PDF/Manuals/INS0763_C.pdf

The unit ships with software from Panamax for installation on an HTPC that communicates with the UPS and performs managed shutdown of the HTPC when battery power falls below a specified "Low Battery" threshold. This Panamax software can be used for initial configuration of the UPS, but CANNOT be active simultaneously with MLGD as only one application can own the serial connection on the UPS.

The UPS has 2 banks of AC outlets: 1) Critical Load Outlets, and 2) Non-Critical Outlets.

As an example of programming of this UPS, a typical operation scenario is:

Configuration: 1. Critical components: HTPC (for control), Projector (to allow fans to cool after bulb is shutoff) 2. Less Critical components: Ethernet and Internet switches and modems (retain access to internet) 3. Least Critical components: Everything else on UPS... Amps, Scalar, Audio Distribution System.

Event Sequence: 1. Power Fails; UPS Switches to Battery, notifies HTPC 2. After some period (e.g. 2 minutes) if power does not return, HTPC sends shutdown commands to least critical equipment and to the Projector to shut off bulb (fans continue to run), to preserve battery capacity for critical equipment. Both outlet banks are still powered. 3. When battery capacity falls to the Non-Critical Shutoff Threshold (e.g. 25%), then the UPS will shutoff power to the Non-Critical outlets removing power from all components plugged into that bank. This leaves only devices plugged into the Critical outlets powered. (e.g. projector, which has shut off; and the HTPC.) 4. When battery capacity falls to the "Low Battery" Threshold, UPS sends command to HTPC, and the HTPC starts and completes its managed shutdown process before battery power fails.

Commands Supported by UPS and by MLGD Driver

MLGenericDevice|PmaxUPS~<<command>> e.g. MLGenericDevice|PmaxUPS~UPS_Query_BattSts

Commands: 1. <<UPS_NonCritON>> - Supplies power to "Non Critical Load" bank of AC outlets

    Response from UPS: NCL_OUTLETS_ON<CR> if Main relay is ON; or NCL_OUTLETS_OFF<CR> if Main relay is Off

2. <<UPS_NonCritOFF>> - Removes power from "Non Critical Load" bank of AC outlets

    Response from UPS: NCL_OUTLETS_OFF<CR>

3. <<UPS_BeeperON>> - Enables the alert beeper in the UPS - the beeper will sound when running from battery

    Response from UPS: BEEPISON<CR>

4. <<UPS_BeeperOFF>> - Disables the alert beeper in the UPS

    Response from UPS: BEEPISOFF<CR>

5. <<UPS_SetNCLShutoff>>~<<VAR1>> - Sets "Low Battery Non-Critical Load Shutoff".

             When battery capacity remaining falls to this percent, then NonCritical Load Outlets
             will be powered off.
             Valid values for <<VAR1>> are ASCII: 25, 30, 40, 50, 60 only
    Response from UPS: BTHRESH<SP><<VAR1>><CR> if valid <<VAR1>> was received; else INVALIDCMD<CR>  

6. <<UPS_Query_BattSts>> - Query Battery Charge Level Status

    Response from UPS: <<VAR1>><SP>%BATTERY<CR> where <<VAR1>> is the battery charge percentage in ASCII

7. <<UPS_Query_OutletSts>> - Query the On/Off status of the outlet banks - there will be two responses

    Response from UPS: NCL_OUTLETS_ON<CR> if non-critical outlets are on
                       NCL_OUTLETS_OFF<CR> if non-critical outlets are off
                       CL_OUTLETS_ON<CR> if critical outlets are on
                       CL_OUTLETS_OFF<CR> if critical outlets are off

8. <<UPS_Query_VoltsIn>> - Query the input AC voltage status

    Response from UPS: <<VAR1>><SP>VAC<SP>IN<CR> where <<VAR1>> is the input AC voltage in ASCII

9. <<UPS_Query_VoltsOut>> - Query the output voltage state - there will be multiple responses:

    Response from UPS: <<VAR1>><SP>VAC<SP>OUT<CR> where <<VAR1>> is the output AC voltage in ASCII
                       NORMAL<CR> if the UPS is not in Voltage Regulation or Battery modes
                       BATTERY<CR> if the UPS is in battery mode
                       AVRBOOST1<CR> if the UPS is boosting voltage by 13%
                       AVRBOOST2<CR> if the UPS is boosting voltage by 26%
                       AVRBUCK1<CR> if the UPS is bucking voltage by 11%

10. <<UPS_Query_Load>> - Query the load level as percentage of UPS VA capacity.

    Response from UPS: <<VAR1>><SP>%LOAD<CR> where <<VAR1>> is the load percentage in ASCII

Commands Supported by UPS but not included in MLGD Driver =

These commands (not needed for my use) exceed the 10-Command limit of the Basic Driver

1. Main Power On - Turns on Main relay (critical and non-critical outlets)
2. Main Power Off - Turns off Main Relay (critical and non-critical outlets)
3. Restore Default Settings
4. Identify Equipment - Query model number, firmware number, and revision
5. Help - List all commands and queries

Variables Created

1. UPS_Alert_InputVoltageHigh

 UPS sends when Input Voltage Exceeds High-Level Threshold
 ReturnValue = "Exceeds Failure Threshhold"

2. UPS_Alert_InputVoltageLow

 UPS sends when Input Voltage is Below Low-Level Threshold
 ReturnValue = "Below Failure Threshhold"

3. UPS_Alert_LowBattery

 UPS sends when Battery Capacity falls to low-limit setting
 ReturnValue = "LOW CHARGE"
    MLServeCmd triggered to alert PC to start to close applications and shutdown. 
    MLServeCmd: MLServeCmd.Macro|SetVariable|UPS_Pwr_Alert_Any~ON!UPS.OnBattery.Shutdown.Critical

4. UPS_Battery_Charge_Pct

 UPS responding to command: <<UPS_Query_BattSts>> 
 ReturnValue = "<<VAR1>>" where <<VAR1>> is Percent battery capacity remaining in ASCII

5. UPS_Beeper_Sts

 UPS responding to commands: <<UPS_BeeperON>> <<UPS_BeeperOFF>> 
 ReturnValue = "OFF"
 ReturnValue = "ON"

6. UPS_Load_Pct

 UPS responding to command: <<UPS_Query_Load>> 
 ReturnValue = "<<VAR1>>% Capacity" where <<VAR1>> is Percent UPS capacity in ASCII

7. UPS_NCL_Off_Pct

 UPS responding to command:  <<UPS_SetNCLShutoff>>~<<VAR1>>
 ReturnValue = "<<VAR1>> Percent" where <<VAR1>> is Setting of Percent battery capacity at which
               Non-Critical outlets will be powered off

8. UPS_OutletSts_Critical

 ReturnValue = "OFF"
    UPS sends when Critical Outlets are turned off and in response to command: <<UPS_Query_OutletSts>> 
 ReturnValue = "ON"
    UPS sends when Critical Outlets are turned on and in response to command: <<UPS_Query_OutletSts>> 

9. UPS_OutletSts_NonCritical

 ReturnValue = "OFF"
    UPS sends when NonCritical Outlets are turned off and in response to command: <<UPS_Query_OutletSts>> 
    MLServeCmd triggered to alert PC that noncritical outlets are off (network down)
    MLServeCmd.Macro|UPS.OnBattery.Shutdown.NonCritical
 ReturnValue = "ON"
    UPS sends when NonCritical Outlets are turned on and in response to command: <<UPS_Query_OutletSts>> 

10. UPS_Volts_In

 UPS responding to command: <<UPS_Query_VoltsIn>> 
 ReturnValue = "<<VAR1>> Volts"  where <<VAR1>> is voltage UPS is seeing from Line Input in ASCII

11. UPS_VoltsOut_Status

 UPS sends when Output Voltage STATUS or LEVEL changes and in response to command: <<UPS_Query_VoltsOut>> 
 ReturnValue = "Being Reduced"  (AVRBUCK1)
 ReturnValue = "Being Boosted 13%"  (AVRBOOST1)
 ReturnValue = "Being BOOSTED 26%"  (AVRBOOST2)
 ReturnValue = "ON BATTERY"  (BATTERY)
    MLServeCmd triggered to alert PC that UPS has switched to battery backup (start UPS process) 
 ReturnValue = "Normal"  (NORMAL)
    MLServeCmd triggered to alert PC that UPS status has returned to NORMAL. (move out of UPS process 
               mode resync components powered off, and reset multiple UPS variables to indicate normal mode)

12. UPS_VoltsOut_Voltage

 UPS sends when Output Voltage STATUS changes and in response to command: <<UPS_Query_VoltsOut>> 
 ReturnValue = "<<VAR1>> Volts"

Feature Requests

Bugs