如何使用Cooja计算总能耗 [英] How to calculate total energy consumption using Cooja

查看:281
本文介绍了如何使用Cooja计算总能耗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用无线传感器网络电缆来评估其在我的工作中的性能.我想测量等待时间和总能耗,以找到每个节点中的剩余能量.所以我的问题是我有一些tx rx cpu cpu_idle值,我不怎么用它们来计算我需要的值.我找到了一些进行计算的规则,但我不完全了解如何在我的情况下应用它.

I'm working with wireless sensor network lead to evaluate its performance in my work. I want to measure the latency and total energy consumption to find the remaining energy in each node. So my problem is that I have some values of tx rx cpu cpu_idle and I don't how to use them to calculate what I need. I found some rules that take the calculation but i don't understand exactly how to apply it in my case.

在通信中消耗的能量:

Energy consumed in communication:

CPU消耗的能量:

32768是什么意思,为什么我们使用这个数字?是标准值吗?

What is the meaning of 32768, and why do we use this number? Is it a standard value?

推荐答案

powertrace输出以计时器刻度显示.

The powertrace output is printed in timer ticks.

  • tx-无线电已处于发送模式的滴答声数(ENERGEST_TYPE_TRANSMIT)
  • rx-收音机一直处于接收模式(ENERGEST_TYPE_LISTEN)的滴答声次数
  • cpu-CPU处于活动模式的滴答数(ENERGEST_TYPE_CPU)
  • cpu_idle-CPU处于空闲模式的滴答数(ENERGEST_TYPE_LPM)
  • tx - the number of ticks the radio has been in transmit mode (ENERGEST_TYPE_TRANSMIT)
  • rx - the number of ticks the radio has been in receive mode (ENERGEST_TYPE_LISTEN)
  • cpu - the number of ticks the CPU has been in active mode (ENERGEST_TYPE_CPU)
  • cpu_idle - the number of ticks the CPU has been in idle mode (ENERGEST_TYPE_LPM)

txrx对中的元素是排他的,cpuidle也是如此-系统永远不能同时处于两种模式.但是,其他组合也是可能的:例如,它可以同时在cputx中. cpuidle之和是系统的总正常运行时间.

The elements of the pair tx and rx are exclusive, as are cpu and idle - the system can never be in both modes at the same time. However, other combinations are possible: it can be in cpu and in tx at the same time, for example. The sum of cpu and idle is the total uptime of the system.

滴答计时器的持续时间与平台有关,并定义为RTIMER_ARCH_SECOND常量.每秒32768次滴答声是该常数的典型值-这是方程式中数字的来源.例如:

The duration of timer a tick is platform-dependent and defined as the RTIMER_ARCH_SECOND constant. 32768 ticks per second is a typical value of this constant - that's where the number in your equation comes from. For example:

ticks_in_tx_mode = energest_type_time(ENERGEST_TYPE_TRANSMIT);
seconds_in_tx_mode = ticks_in_tx_mode / RTIMER_ARCH_SECOND;

要计算平均电流(以毫安 mA 表示),请将txrxcpu_idle,该模式下的相应电流消耗为 mA (从节点的数据表中获取值),将其求和,然后除以RTIMER_ARCH_SECOND:

To compute the average current consumption (in milliamperes, mA), multiply each of tx, rx, cpu, cpu_idle with the respective current consumption in that mode in mA (obtain the values from the datasheet of the node), sum them up, and divide by RTIMER_ARCH_SECOND:

current = (tx * current_tx_mode + rx * current_rx_mode + \
          cpu * current_cpu + cpu_idle * current_idle) / RTIMER_ARCH_SECOND

要计算电量(以 millicoulumbs mC 表示),请将平均电流消耗乘以测量持续时间(节点的正常运行时间)在几秒钟内:

To compute the charge (in millicoulumbs, mC), multiply the average current consumption with the duration of the measurement (node's uptime) in seconds:

charge = current * (cpu + cpu_idle) / RTIMER_ARCH_SECOND

要计算功率(以 milliwats mW 表示),将平均电流消耗与系统电压相乘,例如3如果使用两节AA电池供电,则为伏特:

To compute the power (in milliwats, mW) multiply the average current consumption with the voltage of the system, for exampe, 3 volts if powered from a pair of AA batteries:

power = current * voltage

最后,要计算能耗(以 millijoules mJ 表示),将功率乘以持续时间(以秒为单位)或将电荷乘以与系统的电压:

Finally, to compute the energy consumption (in millijoules, mJ), multiply the power with the duration in seconds or multiply the charge with the voltage of the system:

energy = charge * voltage

上面的第一个公式计算通信的能耗;第二个:用于计算.

The first formula above computes the energy consumption for communications; the second one: for computation.

网站可能是有助于分解数字.

This site might be helpful to break down the numbers.

这篇关于如何使用Cooja计算总能耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆