Module: simpleSolarPanel

Executive Summary

This module provides first-order modeling of power generation from an attitude and orbitally coupled solar panel. Specifically, it:

  1. Evaluates the impact of shadowing using an assigned eclipseSimMsg

  2. Computes power generation using a cosine law based on the panel area, efficiency, and attitude

  3. Allows for the panel body-fixed orientation nHat_B, the panel area, and the panel efficiency to be set via setPanelParameters().

  4. Writes out a powerNodeUsageSimMsg describing its power generation.

    Power generation is computed according to SMAD:

    \[W_{out} = W_{base} * C_{eclipse} * C_{panel} * (\hat{n}\cdot \hat{s}) A_{panel}\]

    where \(W_{base}\) is the base power (in \(\mbox{W}/\mbox{m}^2\)) at the spacecraft location from the sun, \(C_{eclipse}\) is the eclipse/penumbra mitigator on the sun’s power (1 corresponds to no shadow, 0 corresponds to eclipse), \(C_{panel}\) represents the panel’s efficiency at converting solar energy into electrical energy, \((\hat{n}\cdot \hat{s})\) represents the alignment between the panel’s normal vector and the spaceraft-sun unit vector, and \(A_{panel}\) represents the panel area in meters squared.

For more information on how to set up and use this module, see the simple power system example: scenarioPowerDemo

Module Assumptions and Limitations

This module only uses the input and output messages of the PowerNodeBase base class. Further, the module does not include any self-shadowing in the solar panel power generation evaluation.

Message Connection Descriptions

The following table lists additional module input messages beyond those specified in Module: powerNodeBase.

Module I/O Messages

Msg Variable Name

Msg Type

Description

sunInMsgName

spicePlanetStateSimMsg

Describes sun position.

stateInMsgName

scPlusStatesSimMsg

Describes spacecraft position, attitude.

sunEclipseInMsgName

eclipseSimMsg

Optional input message. Describes shadow factor due to planetary bodies.

User Guide

This module inherits the user guide from the PowerNodeBase base class. Module specific instructions include:

  • must specify sunInMsgName and stateInMsgName input message names

  • the sunEclipseInMsgName message name is optional. If provided the modules uses the eclipse shadow factor to adjust the power generation if needed.

  • must specify the variables panelArea, panelEfficiency and nHat_B. These there parameters can also be set at the same time through setPanelParameters(nHat_B, panelArea, panelEfficiency)

For more information on how to set up and use this module, see the simple power system example: scenarioPowerDemo


class SimpleSolarPanel : public PowerNodeBase

Public Functions

SimpleSolarPanel()
~SimpleSolarPanel()
void customCrossInit()
bool customReadMessages()
void customReset(uint64_t CurrentClock)

custom solar panel reset function

void setPanelParameters(Eigen::Vector3d nHat_B, double panelArea, double panelEfficiency)

This method allows for solar panel parameters to be set.

Return

void

Parameters
  • nHat_B: The normal vector of the solar panel expressed in the spacecraft body frame.

  • panelArea: the spacecraft panel area in meters squared.

  • panelEfficiency: The efficiency of the solar panel in nondimensional units; typically ranges from 0.1 to 0.5.

Public Members

std::string sunInMsgName

[-] Message name for sun data

std::string stateInMsgName

[-] Message name for spacecraft state

std::string sunEclipseInMsgName

[-] Message name for sun eclipse state message

double panelArea

[m^2] Panel area in meters squared.

double panelEfficiency

[W/W] Panel efficiency in converting solar energy to electrical energy.

Eigen::Vector3d nHat_B

[-] Panel normal unit vector relative to the spacecraft body frame.

BSKLogger bskLogger

BSK Logging

Private Functions

void evaluatePowerModel(PowerNodeUsageSimMsg *powerUsageMsg)

This method computes the power generated by the solar panel and stores it in a PowerNodeUsageSimMsg. This is evaluated in two steps:

  1. Compute the amount of power available at the spacecraft position using the SOLAR_FLUX_EARTH macro, distance factor, and eclipse shadow factor;

  2. Compute how much of that power is captured and converted to power using the projectedArea and panelEfficiency attributes.

    Return

    void

void computeSunData()

This method computes the spacecraft-sun vector, the solar panel’s projected area, and the sunDistanceFactor based on the magnitude of the spacecraft sun vector.

Return

void

Private Members

Eigen::Vector3d sHat_B

[-] Sun direction unit vector relative to the spacecraft body frame.

double projectedArea

[m^2] Area of the panel projected along the sun vector.

double sunDistanceFactor

[-] Scale factor on the base solar power computed using the true s/c-sun distance.

int64_t sunInMsgID

[-] Connect to input time message

int64_t stateInMsgID

[-] Connect to input time message

int64_t sunEclipseInMsgID

[-] Connect to input sun eclipse message

SpicePlanetStateSimMsg sunData

[-] Unused for now, but including it for future

SCPlusStatesSimMsg stateCurrent

[-] Current SSBI-relative state

double shadowFactor

[-] solar eclipse shadow factor from 0 (fully obscured) to 1 (fully visible)