Solar Validation

Note: there are two solar boards. One has 5 MPPTs and one has 6 MPPTs. On rev 2, one pin (currently PA7) is high on the 6 MPPT version and low on the 5 MPPT version. Rev 2 should automatically detect this, but if you’re validating rev 1, uncomment line 33 in projects/solar/main.c:

// Uncomment to force firmware to detect the 5 or 6 MPPT board. // #define MPPT_COUNT SOLAR_BOARD_5_MPPTS

Then change SOLAR_BOARD_5_MPPTS to SOLAR_BOARD_6_MPPTS if you’re on the 6 MPPT version instead.

Also, if you happen to notice any pattern in the “CR bit” value, tell @Ryan Dancy since I have no idea what it is, the SPV1020 datasheet is a bit sparse on details.

If the sensed values aren’t accurate, please note the values you applied and the values you got (the more data points the better) so the scaling factor can be adjusted.

Action

Expected Result

Actual / Notes

Action

Expected Result

Actual / Notes

1

Compile solar project

No compilation errors

PASS

2

Run all solar unit tests

All unit tests pass

 

3

Connect CAN dongle, open minicom and candump

-

 

4

Flash solar project

On minicom: Hello from solar, initialized with %d MPPTs where %d is the number of MPPTs you expect it to be initialized with. Then,

MPPT 0 input voltage: 18792 mV MPPT 1 input voltage: 18792 mV MPPT 2 input voltage: 18792 mV MPPT 3 input voltage: 18792 mV MPPT 4 input voltage: 18792 mV MPPT 5 input voltage: 18792 mV // only on 6 MPPT MPPT 0 output voltage: unset MPPT 1 output voltage: unset MPPT 2 output voltage: unset MPPT 3 output voltage: unset MPPT 4 output voltage: unset MPPT 5 output voltage: unset // only on 6 MPPT MPPT 0 input current: 7792640 uA MPPT 1 input current: 7792640 uA MPPT 2 input current: 7792640 uA MPPT 3 input current: 7792640 uA MPPT 4 input current: 7792640 uA MPPT 5 input current: 7792640 uA // only on 6 MPPT Total output current: unset Thermistor 0 temperature: 2500 dC Thermistor 1 temperature: 2500 dC Thermistor 2 temperature: 2500 dC Thermistor 3 temperature: 2500 dC Thermistor 4 temperature: 2500 dC Thermistor 5 temperature: 2500 dC // only on 6 MPPT MPPT 0 PWM duty cycle: 500/1000 MPPT 1 PWM duty cycle: 500/1000 MPPT 2 PWM duty cycle: 500/1000 MPPT 3 PWM duty cycle: 500/1000 MPPT 4 PWM duty cycle: 500/1000 MPPT 5 PWM duty cycle: 500/1000 // only on 6 MPPT MPPT 0 CR bit: 0 MPPT 1 CR bit: 0 MPPT 2 CR bit: 0 MPPT 3 CR bit: 0 MPPT 4 CR bit: 0 MPPT 5 CR bit: 0 // only on 6 MPPT

output every second, with the unsets clearing after a couple cycles and reasonable values for the data points. If some MPPTs aren’t connected, there will be more unsets. No Fault raised! logs.

On CAN: messages with IDSYSTEM_CAN_MESSAGE_SOLAR_DATA (0x3B), repeating every second, batched into <=8 message batches with 100ms between batches. First u32 is data point, second u32 is data value. The following are the data points to data value correspondence:

  • 0x00-0x05 should match “MPPT input voltage” values

  • 0x08 should match “Total output current” value

  • 0x10-0x15 should match “Thermistor temperature” values

  • 0x18-0x1D should match “MPPT output voltage” values

  • 0x20-0x25 should match “MPPT PWM duty cycle” values

  • 0x28-0x2D should match “MPPT CR bit” values

No other messages should be tx’d, and messages should only be tx’d if their corresponding value isn’t “unset”.

Otherwise: the relay should be open.

 

5

Send CAN message: SYSTEM_CAN_MESSAGE_SET_RELAY_STATES (0x01), with first u16 (relay mask) 1 << EE_RELAY_ID_BATTERY = 1 and second u16 (relay state) EE_RELAY_STATE_CLOSE << EE_RELAY_ID_BATTERY = 1

(“relay close CAN message”)

Relay closes.

 

6

Send CAN message: SYSTEM_CAN_MESSAGE_SET_RELAY_STATES (0x01), with first u16 (relay mask) 1 and second u16 (relay state) 0 (“relay open CAN message”)

Relay opens.

 

7

Send the relay close CAN message

Relay closes again.

 

8

Vary/measure the MPPTs' input voltages

The corresponding MPPT {n} input voltage value accurately reflects the input voltages.

 

9

Vary/measure the MPPTs' input currents

The corresponding MPPT {n} input current value accurately reflects the input currents.

 

10

Vary/measure the MPPTs' output voltages

The corresponding MPPT {n} output voltage value accurately reflects the output voltage (as sensed by the MCP3427).

 

11

Vary/measure the total output current

The Total output current value accurately reflects the total output current of the MPPTs (as sensed by the MCP3427).

 

12

If you can, vary/measure the MPPTs' PWM duty cycles

The corresponding MPPT {n} PWM duty cycle value accurately reflects the duty cycle.

 

13

Vary/measure the temperature measured by the thermistors in the solar array, or use a potentiometer instead and vary it

The corresponding Thermistor {n} temperature value accurately reflects the temperature, or at least varies with the potentiometer.

 

14

Try to find a pattern in the CR bit values

?? If you find one please note it

 

15

WITH HARDWARE: simulate a negative total output current condition.

On minicom: Fault detected! Fault ID = 5, data = 0x0. CAN message: SYSTEM_CAN_MESSAGE_SOLAR_FAULT (0x3C), first u8 0x05, second u8 0x00. Relay opens.

 

16

Send the relay close CAN message

Relay closes again.

 

17

WITH HARDWARE: simulate an overcurrent condition (>9A) - you can change SOLAR_OUTPUT_OVERCURRENT_THRESHOLD_uA in projects/solar/src/solar_config.c to make this easier

On minicom: Fault detected! Fault ID = 4, data = 0x0. CAN message: SYSTEM_CAN_MESSAGE_SOLAR_FAULT (0x3C), first u8 0x04, second u8 0x00. Relay opens.

 

18

Send the relay close CAN message.

Relay closes again.

 

19

WITH HARDWARE: simulate an overvoltage condition (sum of output voltages > 160V) - you can change SOLAR_OUTPUT_OVERVOLTAGE_THRESHOLD_mV in projects/solar/src/solar_config.c to make this easier

On minicom: Fault detected! Fault ID = 6, data = 0x0. CAN message: SYSTEM_CAN_MESSAGE_SOLAR_FAULT (0x3C), first u8 0x06, second u8 0x00. Relay opens.

 

20

Send the relay close CAN message.

Relay closes again.

 

21

WITH HARDWARE (maybe): simulate an overtemperature condition (temperature on any thermistor > 100°C) - you can change SOLAR_OVERTEMPERATURE_THRESHOLD_dC in projects/solar/src/solar_config.c to make this easier

Where {n} is the index of the thermistor that went overtemperature:

On minicom: Fault detected! Fault ID = 7, data = {n}. CAN message: SYSTEM_CAN_MESSAGE_SOLAR_FAULT (0x3C), first u8 0x07, second u8 {n}. Relay does not open.

 

22

WITH HARDWARE: simulate an overvoltage on the input voltage to an MPPT (input voltage > 40V?).

Where {n} is the index of the MPPT that went overvoltage:

On minicom: Fault detected! Fault ID = 2, data = {n}. CAN message: SYSTEM_CAN_MESSAGE_SOLAR_FAULT (0x3C), first u8 0x02, second u8 {n}. Relay does not open.

 

23

WITH HARDWARE: simulate an overcurrent on the input current to an MPPT (input current > 4.5A?).

Where {n} is the index of the MPPT that went overcurrent, and {bm} is a 4-bit bitmask of the branches that went overcurrent:

On minicom: Fault detected! Fault ID = 1, data = ({n} << 4) | {bm}. CAN message: SYSTEM_CAN_MESSAGE_SOLAR_FAULT (0x3C), first u8 0x01, second u8 ({n} << 4) | {bm}. Relay does not open.

 

24

WITH HARDWARE: simulate an overtemperature on the MPPT (temperature > 130°C?), if it’s safe.

Where {n} is the index of the MPPT that went overtemperature:

On minicom: Fault detected! Fault ID = 3, data = {n}. CAN message: SYSTEM_CAN_MESSAGE_SOLAR_FAULT (0x3C), first u8 0x03, second u8 {n}. Relay does not open.