Difference between revisions of "Jetson/Jetson TK1 Power"

From eLinux.org
Jump to: navigation, search
(Direct connection to a rechargeable battery pack: Some minor battery voltage updates)
(Powering the Jetson TK1 board with a battery: Moved the MyzharBot example to this page instead of in the tutorial)
Line 97: Line 97:
 
A voltage regulator can produce a stable 12V DC voltage from a higher voltage, thus allows some battery options:
 
A voltage regulator can produce a stable 12V DC voltage from a higher voltage, thus allows some battery options:
 
* '''Lead-Acid (car battery)''': A car or motor-cycle or SLA battery is roughly 12V but the actual voltage can reach upto 14.4V. So if you want to plug the [[Jetson TK1]] into your car battery then it is highly recommended to use a 12V voltage regulator to ensure the voltage to the board will not be too high. You should also use a fuse to ensure nothing catches on fire if there is a short-circuit! You could even use a 24V truck battery if your voltage regulator allows it. A small 40Ah car battery would power [[Jetson TK1]] roughly 5 days of moderate use (0.8 efficiency * 12V * 40Ah / 3W).
 
* '''Lead-Acid (car battery)''': A car or motor-cycle or SLA battery is roughly 12V but the actual voltage can reach upto 14.4V. So if you want to plug the [[Jetson TK1]] into your car battery then it is highly recommended to use a 12V voltage regulator to ensure the voltage to the board will not be too high. You should also use a fuse to ensure nothing catches on fire if there is a short-circuit! You could even use a 24V truck battery if your voltage regulator allows it. A small 40Ah car battery would power [[Jetson TK1]] roughly 5 days of moderate use (0.8 efficiency * 12V * 40Ah / 3W).
 +
* '''Li-Ion or Li-Po 4S battery pack''': A voltage regulator can allow you to use any higher voltage battery that you might already happen to have available, such as a 14.8V 4S LiPo battery pack or anything higher.
 +
 +
{| class="wikitable"
 +
|-
 +
| [[File:MyzharBot-1.jpg|250px|thumbnail|left|MyzharBot, the crawler robot]] The [http://myzharbot.robot-home.it MyzharBot crawler robot] is powered by a [http://www.hobbyking.com/hobbyking/store/__9516__Turnigy_5000mAh_4S_30C_Lipo_Pack.html Turnigy 5000mAh 4S 30C Lipo Pack] battery (varying between 16.8V for a full charge to 12.8V at warning voltage). The battery powers motors directly while the [[Jetson TK1]] & microcontroller logic are powered by a [http://www.mini-box.com/DCDC-USB USB-programmable DC-DC converter] (normally used for automotive applications).
 +
|| [[File:USB DC-DC.jpg|200px|thumbnail|center|Programmable DC-DC converter]]
 +
|| [[File:USB_DC-DC_enclosure.jpg|200px|thumbnail|center|Programmable DC-DC enclosure]]
 +
|}
  
 
=== DC-DC step-up converter with a single-cell battery ===
 
=== DC-DC step-up converter with a single-cell battery ===
 
A DC-DC step-up converter can convert a low voltage into a stable 12V DC thus allows using a single-cell battery. Some suitable step-up converters range from a [http://www.pololu.com/product/2117 20W step-up converter for $4] (that might be enough for some use cases but not others) to a [http://www.pololu.com/product/2568 60W step-up converter for $14] (that is always able to push [[Jetson TK1]] to its full limits). Both of these step-up converters will work from a single LiIon/LiPo battery cell or a few AA batteries or a 5V USB portable charger. (Note that most USB portable chargers can only produce 5W to 10W, so are unlikely to power the whole [[Jetson TK1]] board unless if you replace the fan, don't run intensive code, and disable many ports).
 
A DC-DC step-up converter can convert a low voltage into a stable 12V DC thus allows using a single-cell battery. Some suitable step-up converters range from a [http://www.pololu.com/product/2117 20W step-up converter for $4] (that might be enough for some use cases but not others) to a [http://www.pololu.com/product/2568 60W step-up converter for $14] (that is always able to push [[Jetson TK1]] to its full limits). Both of these step-up converters will work from a single LiIon/LiPo battery cell or a few AA batteries or a 5V USB portable charger. (Note that most USB portable chargers can only produce 5W to 10W, so are unlikely to power the whole [[Jetson TK1]] board unless if you replace the fan, don't run intensive code, and disable many ports).

Revision as of 14:23, 25 June 2014

Typical power draw of Jetson TK1

The Tegra K1 SOC in Jetson TK1 is aimed at tablets and thus typically uses between 0.6W to 3W of power during normal use and rarely uses more than 4W, but is able to reach 15W if you manage to push the CPU, GPU, camera ISP's and codec hardware to their limits. Meanwhile, the rest of the Jetson TK1 board uses between 1.5W to 45W depending on what you plug into it (through USB, mini-PCIe, SATA, SD-card, HDMI, audio, GPIO, expansion port, etc). The absolute max power draw of Jetson TK1 if you push everything to the limit and use every port including SATA and PCIe is 58W (4.8A @ 12V). So a 10W to 15W power supply is enough for powering Jetson TK1 in most cases, but a 60W power supply will ensure you always have enough power in all cases.

Here are some measurements of the total power draw for the whole Jetson TK1 board (when running on 12V and without any power reduction customizations):

Operation Total Jetson TK1 power
booting up ~3.6W (for ~2 minutes of booting)
using the command-line through ethernet ~1.6W (starts at 2.3W but gradually ramps down over ~10 minutes)
running a disk-intensive search command 1.6W - 4.7W
using the graphical Unity desktop ~2.2W (if controlled through ethernet, or ~3.2W if you plug in a USB keyboard & mouse)

As you can see from this table, the whole Jetson TK1 board including CPU & GPU and fan uses a total of 1.6W when you aren't really doing anything, while a graphical desktop adds roughly 0.6W for the HDMI port & GPU-accelerated desktop effects, and the eMMC disk can use about 5 Watts of additional power. As mentioned above, the Tegra SOC typically uses between 0.6W to 3W during normal use, but can potentially use much more than this in extreme cases. More detailed power measurements during different loads are shown in the Power draw during computer vision tasks section, where you can see the power draw when the CPU & GPU are pushed to their limit.

Replacing the fan with a heatsink

Warning: removal of the fan+heatsink will void the warranty.

The Jetson TK1 board comes with a large 12V fan+heatsink combo (using 0.4W of power) attached to the SOC, to ensure the board is always safe to touch by humans even when running the CPU & GPU at max performance for long durations. But some users may want to remove the fan and replace it with a passive heatsink, either to reduce power or increase dust-resistance or simply to get rid of the fan noise. The fan+heatsink is clearly much larger than it needs to be, so it can be replaced by a small fan or large heatsink without a reduction in performance or safety.

The Tegra K1 SOC is designed for tablets that use a small heatsink or heatspreader plate, thus clearly it doesn't require a large fan. But tablets aren't expected to run at full performance for long periods, and you also can't touch the SOC of a tablet with your bare fingers, so NVIDIA decided to use a large surplus fan for Jetson TK1. If you wish to replace the fan with a heatsink, take into account that if you will be pushing the SOC to its limits for long durations, the SOC might be using upto 10W - 15W of power that you must dissipate with a large heatsink and/or external fan and/or attaching a heatspreader to the metal case of your overall device, otherwise the internal Tegra thermal management may reduce the performance to ensure it won't overheat.

It hasn't been tested by NVIDIA, but rough estimatations suggest that a 1.5" x 1.5" x 0.8" Aluminium heatsink (such as an Aluminium Malico MBH33002 or Copper Malico CMBA054949 north-bridge heatsink) would allow pushing Tegra K1 to its limits for long durations while not getting hot enough for the SOC to reduce the performance or burn human skin.

Controlling the performance or power draw

Note: Debugfs and non-upstream sysfs nodes aren't guaranteed to remain unchanged in future releases.

Tegra K1 is designed for mobile use-cases and thus contains a significant number of power reduction systems to control when parts of the hardware should run faster or slower or be turned off, based on runtime use. This is good for most use cases but you might want to force a lower or higher performance of some parts of the hardware such as to run benchmarks of the peak performance or enforce lower power draw.

How to run a command with root privileges temporarily or on every bootup

There are various commands listed below that you can run to reduce or increase the performance or power draw, and they must be executed with root privileges. To execute some of the commands with root privileges just until you reboot your device, you can simply run "su" to login as root user, run the commands, then run "exit" to return to regular user, eg:

sudo su
    (enter your password, typically "ubuntu" by default)
    # Run a command that requires root privileges
    echo Hello > /TEST.txt
    exit

To execute commands automatically on every bootup, you can put your commands into the "/etc/rc.local" bootup script. For example, run this on your board:

sudo nano /etc/rc.local

Then add this near the bottom of the file but before the "exit" line:

# Disable USB auto-suspend, since it disconnects some devices such as webcams on Jetson TK1.
echo -1 > /sys/module/usbcore/parameters/autosuspend 

Save the file by hitting Ctrl+X then Y then Enter, then reboot the device:

sudo reboot

Reducing power if display isn't required

Turning off the HDMI port can slightly reduce the power usage of the board. Run this as root:

echo -1 > /sys/kernel/debug/tegra_hdmi/hotplug
echo 4 > /sys/class/graphics/fb0/blank

Restricting to low-power core only

Restricting the CPU to the low-power companion core can significantly reduce peak power (if running on a power-limited battery pack, for example). The 5th companion core in Tegra K1 is still a Cortex-A15 core with NEON and 32KB L1 cache and 512KB L2 private cache, but obviously at lower performance than the 4 main cores. To use just the low-power core, run this as root:

echo 0 > /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
echo LP > /sys/kernel/cluster/active

Maximizing CPU performance

Likewise, one may want to disable CPU scaling and force the 4 main cores to full performance:

echo 0 > /sys/devices/system/cpu/cpuquiet/tegra_cpuquiet/enable
echo 1 > /sys/devices/system/cpu/cpu0/online
echo 1 > /sys/devices/system/cpu/cpu1/online
echo 1 > /sys/devices/system/cpu/cpu2/online
echo 1 > /sys/devices/system/cpu/cpu3/online
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Controlling GPU performance

To manually control the clock frequencies of the GPU, first determine the rates supported (listed by sysfs in kHz):

 cat /sys/kernel/debug/clock/gbus/possible_rates
 72000 108000 180000 252000 324000 396000 468000 540000 612000 648000 684000 708000 756000 804000 852000 (kHz)

Then set a rate (eg. the maximum of 852000kHz), specified in Hz:

 echo 852000000 > /sys/kernel/debug/clock/override.gbus/rate
 echo 1 > /sys/kernel/debug/clock/override.gbus/state

Finally verify the rate:

 cat /sys/kernel/debug/clock/gbus/rate
 852000

The gbus sysfs nodes control the GPU's core clock. To control the GPU's memory clock, substitute emc for gbus.

Powering the Jetson TK1 board with a battery

The Jetson TK1 accepts a standard 2.1mm DC barrel plug and is rated for 12V DC input, but will actually work with any input voltage between 9.5V to 13.5V. Note that SATA disks require a fairly precise 12V, so you shouldn't be using voltages at those ranges if you will use SATA hard drives. It is known that the Jetson TK1 board won't turn on at less than 9.5V and it will likely be damaged at 16V or above. It may also be possible to power the Jetson TK1 board somewhere in the 13.5V to 16V range but NVIDIA has not tested this.

Since Jetson TK1 needs a voltage between 9.5V to 13.5V, there are several options for powering the Jetson TK1 by batteries:

Direct connection to a rechargeable battery pack

A battery pack made of several battery cells in series to have roughly 12V can power the Jetson TK1 board directly without a step-up or step-down converter. However the voltage output of a battery varies quite a lot when it is fully charged compared to fully drained, so you need to make sure the voltage will always be within the recommended voltage range. Several battery options are:

  • Lithium Ion or Lithium Polymer: Any large 3S rechargeable Lithium battery pack (3 x Li-Ion or Li-Po cells in series) can power a Jetson TK1. Because a Li-Ion/Li-Po "3.7V" rechargeable battery is usually near 3.7V on average but actually gives 4.2V when charged and around 3.3V when discharged. (The battery is likely to be damaged whenever it falls below 3.0V per cell). Thus an "11.1V" battery made from 3 Li-Ion/Li-Po cells gives 9.9V - 12.6V. An example of a 3S battery pack is Turnigy 3S 2200mA for $8.50 giving roughly 6 hours of moderate use (0.8 efficiency * 2.2Ah * 11.1V / 3W), and battery chargers include the popular Turnigy Accucell-6 for $23.
  • Nickel-Cadmium or Nickel-Metal-Hydride: 10 x rechargeable NiCad or NiMh AA or AAA batteries can power a Jetson TK1. Because a NiCad or NiMh AA "1.2V" rechargeable battery gives about 1.35V when fully charged and drops to about 1.0V when consumed. Thus 10 NiCad/NiMh cells gives 10V - 13.5V. Decent NiMh batteries are rated at 1800mAh - 2400 mAh, thus 10 x AA rechargeables should last roughly 6 hours of moderate use (0.8 efficiency * 2.0Ah * 12V / 3W). Note that a non-rechargeable AA battery gives ~1.5V per cell whereas a rechargeable AA gives ~1.2V per cell, so if you want to use non-rechargeable consumable batteries for some reason then you should use 8 x AA instead of 10 x rechargeable AA batteries.

Step-down voltage regulator

A voltage regulator can produce a stable 12V DC voltage from a higher voltage, thus allows some battery options:

  • Lead-Acid (car battery): A car or motor-cycle or SLA battery is roughly 12V but the actual voltage can reach upto 14.4V. So if you want to plug the Jetson TK1 into your car battery then it is highly recommended to use a 12V voltage regulator to ensure the voltage to the board will not be too high. You should also use a fuse to ensure nothing catches on fire if there is a short-circuit! You could even use a 24V truck battery if your voltage regulator allows it. A small 40Ah car battery would power Jetson TK1 roughly 5 days of moderate use (0.8 efficiency * 12V * 40Ah / 3W).
  • Li-Ion or Li-Po 4S battery pack: A voltage regulator can allow you to use any higher voltage battery that you might already happen to have available, such as a 14.8V 4S LiPo battery pack or anything higher.
MyzharBot, the crawler robot
The MyzharBot crawler robot is powered by a Turnigy 5000mAh 4S 30C Lipo Pack battery (varying between 16.8V for a full charge to 12.8V at warning voltage). The battery powers motors directly while the Jetson TK1 & microcontroller logic are powered by a USB-programmable DC-DC converter (normally used for automotive applications).
Programmable DC-DC converter
Programmable DC-DC enclosure

DC-DC step-up converter with a single-cell battery

A DC-DC step-up converter can convert a low voltage into a stable 12V DC thus allows using a single-cell battery. Some suitable step-up converters range from a 20W step-up converter for $4 (that might be enough for some use cases but not others) to a 60W step-up converter for $14 (that is always able to push Jetson TK1 to its full limits). Both of these step-up converters will work from a single LiIon/LiPo battery cell or a few AA batteries or a 5V USB portable charger. (Note that most USB portable chargers can only produce 5W to 10W, so are unlikely to power the whole Jetson TK1 board unless if you replace the fan, don't run intensive code, and disable many ports).