Difference between revisions of "TS-4100 Supercapacitors"

From Technologic Systems Manuals
Jump to: navigation, search
(Added charge level note)
(Added clarifications from 7553v2)
 
Line 3: Line 3:
 
[[File:Supercaps_4100_revB.png|600px]]
 
[[File:Supercaps_4100_revB.png|600px]]
  
The supercapacitor charge and discharge are monitored by the microcontroller on the TS-4100. A charge cycle is initiated automatically at startup by [[#U-Boot|U-Boot]], and can be disabled via a jumper setting on the baseboard. U-Boot can also be configured to load the kernel and FDT, but delay starting them until the supercapacitors are at a specified charge level. This can allow for a guaranteed available amount of reserve power in the case of external power being disconnected once the kernel starts booting.
+
The supercapacitor charge and discharge are monitored by the microcontroller on the TS-4100. A charge cycle is initiated automatically at startup by [[#U-Boot|U-Boot]], and can be disabled via a jumper setting on the baseboard. Once a charge cycle is started, the microcontroller will fully charge the supercapacitors and keep them topped off until charging is explicitly disabled. U-Boot can also be configured to load the kernel and FDT, but delay starting them until the supercapacitors are at a specified charge level. This can allow for a guaranteed available amount of reserve power in the case of external power being disconnected once the kernel starts booting.
  
 
Manual enabling and disabling of charging can be handled in U-Boot or Linux userspace:
 
Manual enabling and disabling of charging can be handled in U-Boot or Linux userspace:
Line 20: Line 20:
 
'''U-Boot Settings'''
 
'''U-Boot Settings'''
  
When the "No Charge" jumper is removed from the baseboard, U-Boot will automatically start charging the supercapacitors at startup. It is also possible to to configure U-Boot to delay booting Linux until the capacitors are at a certain charge level. This is automatically manged with the [[#U-Boot_Environment|environment variable]] "chrg_pct". If the baseboard supports TS-SILO and the "No Charge" jumper is not set, then U-Boot will begin charging, load the kernel and FDT, and then delay executing them until the supercapacitors are charged to a level equal to or greater than the value of chrg_pct. Additionally, if the environment variable "chrg_verb" is set to 1, then U-Boot will print out the current charge level once every second.
+
When the "No Charge" jumper is removed from the baseboard, U-Boot will automatically start charging the supercapacitors at startup. It is also possible to to configure U-Boot to delay booting Linux until the capacitors are at a certain charge level. This is automatically manged with the [[#U-Boot_Environment|environment variable]] "chrg_pct". If the baseboard supports TS-SILO and the "No Charge" jumper is not set, then U-Boot will begin charging, load the kernel and FDT, and then delay executing them until the supercapacitors are charged to a level equal to or greater than the value of chrg_pct. Additionally, if the environment variable "chrg_verb" is set to 1, then U-Boot will print out the current charge level once every second. If the "No Charge" jumper is set, then U-Boot will not enable charging automatically.
  
Our monitor script, "/usr/local/bin/tssilomon", will issue a reboot if the external power is removed and the supercapacitor charge drops below a set threshold. This threshold can be tuned. Since a reboot is issued, when U-Boot starts up again it will wait for a valid power input before attempting to load any data from media to reduce power loss during media access. Once external power is restored, U-Boot will continue booting as it would normally. If the supercapacitors charge falls below the valid input threshold before power is restored, the TS-4100 microcontroller will cut power to the CPU and peripherals which will be resumed when external power is restored.
+
Note that once charging is started, the supercapacitors will continue to be charged and managed by the microcontroller. In other words, once "chrg_pct" is reached and U-Boot boots the kernel, the supercapacitors will still continue to charge to 100% and remain topped off unless explicitly disabled.
  
We recommend a chrg_pct value of 60. 60% is enough of a charge level in most applications to be able to boot up fully, have our background monitor script detect that external power has been removed, and shut down the system with about 10 seconds of remaining power to handle any potential variances. We strongly recommend testing in a final application to ensure a safe process.
+
Our monitor script, "/usr/local/bin/tssilomon", will issue a reboot if the external power is removed and the supercapacitor charge drops below a set threshold. This threshold can be tuned to lower values to allow the system to continue to operate during short power loss events where the system is briefly supported by the supercapacitors. When tuning this value, we strongly recommend testing in final application to ensure enough power is available for a complete shutdown cycle in the case of a longer power loss event.
 +
 
 +
Since a reboot is issued by the script if power is lost, when U-Boot starts up again it will wait for a valid power input before attempting to load any data from media to reduce power loss during media access. Once external power is restored, U-Boot will continue booting as it would normally. If the supercapacitors charge falls below the valid input threshold before power is restored, the TS-4100 microcontroller will cut power to the CPU and peripherals which will be resumed when external power is restored.
 +
 
 +
We recommend a "chrg_pct" value of 60. 60% is enough of a charge level in most applications to be able to boot up fully, have our background monitor script detect that external power has been removed, and shut down the system with about 10 seconds of remaining power to handle any potential variances. We strongly recommend testing in a final application to ensure a safe process. Note that the supercapacitors may be at 0% for a large period of time while charging.  The 0% charge level is any charge level that is unable to sustain the device if power is removed at that point in time.
  
 
An example of this process:
 
An example of this process:

Latest revision as of 15:19, 27 November 2019

This device can optionally support our TS-SILO technology. This consists of a charge and feedback monitor in the supervisory microcontroller on the TS-4100, a dedicated charging circuit on the TS-4100, and a pair of 2.7 V, 25 F supercapacitors in series on a TS-4100 baseboard. This full application provides up to 60 seconds of back up power if external power is removed from the device. Additionally, a notification of power failure is asserted on a CPU GPIO pin when external power has fallen below a valid input level. Monitoring this signal can be used to initiate a proper shutdown and ensure that all data is flushed from cache to disk, and all disks are unmounted properly.

Supercaps 4100 revB.png

The supercapacitor charge and discharge are monitored by the microcontroller on the TS-4100. A charge cycle is initiated automatically at startup by U-Boot, and can be disabled via a jumper setting on the baseboard. Once a charge cycle is started, the microcontroller will fully charge the supercapacitors and keep them topped off until charging is explicitly disabled. U-Boot can also be configured to load the kernel and FDT, but delay starting them until the supercapacitors are at a specified charge level. This can allow for a guaranteed available amount of reserve power in the case of external power being disconnected once the kernel starts booting.

Manual enabling and disabling of charging can be handled in U-Boot or Linux userspace:

# Enable the supercapacitor charging cycle in U-Boot or Linux userspace
tsmicroctl -e
 
# Disable the supercapacitor charging cycle in U-Boot or Linux userspace
tsmicroctl -d
 
# Get current charge level information from Linux userspace tools
tsmicroctl --info


U-Boot Settings

When the "No Charge" jumper is removed from the baseboard, U-Boot will automatically start charging the supercapacitors at startup. It is also possible to to configure U-Boot to delay booting Linux until the capacitors are at a certain charge level. This is automatically manged with the environment variable "chrg_pct". If the baseboard supports TS-SILO and the "No Charge" jumper is not set, then U-Boot will begin charging, load the kernel and FDT, and then delay executing them until the supercapacitors are charged to a level equal to or greater than the value of chrg_pct. Additionally, if the environment variable "chrg_verb" is set to 1, then U-Boot will print out the current charge level once every second. If the "No Charge" jumper is set, then U-Boot will not enable charging automatically.

Note that once charging is started, the supercapacitors will continue to be charged and managed by the microcontroller. In other words, once "chrg_pct" is reached and U-Boot boots the kernel, the supercapacitors will still continue to charge to 100% and remain topped off unless explicitly disabled.

Our monitor script, "/usr/local/bin/tssilomon", will issue a reboot if the external power is removed and the supercapacitor charge drops below a set threshold. This threshold can be tuned to lower values to allow the system to continue to operate during short power loss events where the system is briefly supported by the supercapacitors. When tuning this value, we strongly recommend testing in final application to ensure enough power is available for a complete shutdown cycle in the case of a longer power loss event.

Since a reboot is issued by the script if power is lost, when U-Boot starts up again it will wait for a valid power input before attempting to load any data from media to reduce power loss during media access. Once external power is restored, U-Boot will continue booting as it would normally. If the supercapacitors charge falls below the valid input threshold before power is restored, the TS-4100 microcontroller will cut power to the CPU and peripherals which will be resumed when external power is restored.

We recommend a "chrg_pct" value of 60. 60% is enough of a charge level in most applications to be able to boot up fully, have our background monitor script detect that external power has been removed, and shut down the system with about 10 seconds of remaining power to handle any potential variances. We strongly recommend testing in a final application to ensure a safe process. Note that the supercapacitors may be at 0% for a large period of time while charging. The 0% charge level is any charge level that is unable to sustain the device if power is removed at that point in time.

An example of this process:

# From the U-Boot shell
env set chrg_pct 60
env set chrg_verb 1
env save
 
# Now, boot unit without stopping at U-Boot prompt
U-Boot 2016.03-00372-g92371f4445 (Jul 16 2019 - 12:01:04 -0700)
 
CPU:   Freescale i.MX6UL rev1.1 at 396 MHz
...
Booting from the SD card ...
...
Waiting until SuperCaps are charged to 60%
0%
...
55%
57%
59%
60%
...
Starting kernel ...
Note: The maximum achievable charge of the supercapacitors is dependent on input voltage of the 5 VDC power input. It may not be possible for a specific application to see 100% supercapacitor charge. Setting "chrg_pct" to a value higher than is achievable will cause an infinite wait state.