Thursday, March 7, 2013

U-APSD or WWM-PS (802.11e)


Introduction to IEEE 802.11e


In IEEE 802.11e, two types of QoS are identified – prioritized QoS and parameterized QoS. Prioritized QoS is a weak requirement that enforces relative priority between traffic classes. Parameterized QoS, on the other hand, is a strict requirement expressed quantitatively in terms of the QoS parameters.
A new access mechanism (called as HCF – Hybrid Coordination Function) has been defined with EDCA for contention based and HCCA for contention free access methods. Please recall that DCF is contention based while PCF is contention free access methods in 802.11
A few additional mechanisms have been added to improve channel utilization and efficiency. These are “Block Acknowledgement”, “Direct Link Setup”, “Automatic Power Save Delivery” among others.
The 802.11 header has been modified to add a new field to classify the type of traffic. The TID (traffic ID) is used to select a UP (user priority) for prioritized QoS or a TSPEC (traffic specification) for parameterized QoS. TID values between 0 – 7 are considered user priorities and these are identical to the IEEE 802.1D priority tags. TID values between 8 – 16 refer to TSPECs.
A TSPEC between an AP and an STA is negotiated by means of new management commands – ADDTS Request, ADDTS Response and DELTS. After a TSPEC is successfully negotiated, an STA can get a TXOP by one of two ways:
  • Using EDCA, an STA can contend for the medium, and if it acquires the medium can use the medium for TXOP time limit. The STA must observe the TXOP time limit as specified in an IE in beacons.
  • During CP/CFP, an AP can grant an STA a TXOP using the QoS CF-Poll (called as “polled TXOP” in contrast to “EDCA TXOP”). The TXOP limit is specified in the CF-Poll frame. While the spec allows an AP to grant a “polled TXOP” to an STA during either CFP or CP, it is recommended that it not be issued during CFP, but only during CP for reasons of simplicity in implementation.

Wireless Media Extensions (WME)

Wireless Media Extensions (WME), also referred to as WiFi Multimedia (WMM), is an industry driven initiative to ensure that a basic subset of IEEE 802.11e QoS mechanisms are interoperable. As such, WME supports only EDCA but not HCCA. Without HCCA, parametererized QoS can not be supported. As mentioned earlier, prioritized QoS identifies four traffic classes (or Access Categories) with differing priorities. The 8 user priorities of 802.1D map to these 4 ACs. Also, the Atheros code maps TOS fields in IP headers to these 4 ACs.
AC NumberNameDescription
0BEBest effort
1BKBackground
2VIVideo
3VOVoice

Atheros’ MAC uses the following parameters to set QoS priorities. The parameters CWmin, CWmax and AIFS together control the priority of the 4 ACs. The parameter TxOp lets the AP take control of the medium for an extended time so as to transmit data frames in quick succession and this is sometimes referred to as frame bursting.
QoSParameterDefault ValueValid RangeDescription
CWminAC-BE40 - 15Minimum size of contention window
AC-BK4
AC-VI3
AC-VO2
CWmaxAC-BE60 - 15Maximum size of contention window
AC-BK10
AC-VI4
AC-VO3
TxOpAC-BE00 - 8192Transfer opportunity limit in units of 32 microseconds. A value of 0 implies one MPDU.
AC-BK0
AC-VI3008
AC-VO1504
AIFSAC-BE30 - 15Arbitration Inter Frame Space
AC-BK7
AC-VI1
AC-VO1
NoAckPolicy 0 0 - 1 When set, 802.11 ACKs are disabled
U-APSD 1 0 - 1 Unscheduled Automatic Power Save Delivery


U-APSD

UAPSD enables an STA to retrieve unicast QoS traffic buffered in the AP by sending trigger frames. During association/re-association, an STA indicates (in the QoS Info field) which Access Categories are UAPSD enabled. For non-UAPSD enabled ACs, an STA shall continue to use legacy mechanisms, namely PS-Polls, as a means to retrieve the legacy power-save buffered frames.
WMM Power-Save Advertisement
The UAPSD enabled AP advertises its capability by setting the UAPSD (bit 7) of the QoS Info field in either the WMM Information Element or the WMM Parameter Element. This capability is advertised in Beacons, Probe Responses and (Re)Association Responses.
U-APSD enabled STA Association
The QoS Info field in the Association request from STA indicates which ACs shall use the UAPSD mechanism. It also specifies the maximum SP length which indicates the number of buffered frames the AP may send per service period. As WMM/WME does not support parametrized QoS, these parameters can only be negotiated during (re)association time.
STA sets Power Management
An STA sets the PM bit in the frame control field to indicate that it is in power-save mode. The AP will then start to buffer frames of delivery enabled ACs in the UAPSD queue and non-delivery enabled ACs in legacy power-save queue. The AP will not buffer frames for an STA in Active mode, as indicated by a 0 in the PM bit.
STA sends UAPSD Trigger
An STA in power-save mode can send a QoS NULL or QoS Data frame to trigger the AP to send buffered frames. The AP acknowledges the trigger and then follows it up with up to "maxSP" number of frames. The last frame transmitted in the SP will have the EOSP bit set. All transmitted frames will have MORE bit set with the exception of the last frame that has the EOSP set. The last frame will have the MORE bit set only if there are more buffered frames in the delivery enabled queue. If there are no buffered frames on the AP when the trigger is received, the AP will respond with a QoS NULL frame with EOSP set to end the current Service Period.

QoS Commands for Atheros 802.11 based radios

As of now, there is no support for parameterized QoS or HCCA for Atheros based radios. Accordingly, features of prioritized QoS are only described.
Enable WMM:
iwpriv ath0 wmm 1 

Disable WMM:
iwpriv ath0 wmm 0 

Query WMM setting:
iwpriv ath0 get_wmm
Configuring and Querying EDCA Parameter Set
Set CW¬¬min
iwpriv ath0 cwmin  0 
ac = 0, 1, 2, 3
cwmin = 0 - 15

Set CW¬¬max
iwpriv ath0 cwmax  0 
ac = 0, 1, 2, 3
cwmax = 0 - 15

Set TxOp Limit
iwpriv ath0 txoplimit  0 
ac = 0, 1, 2, 3
txop = 0 - 8192

Set AIFS
iwpriv ath0 aifs  0 
ac = 0, 1, 2, 3
aifs = 0 - 15

Query CW¬¬min
iwpriv ath0 get_cwmin  0
ac = 0, 1, 2, 3

Query CW¬¬max
iwpriv ath0 get_cwmax  0
ac = 0, 1, 2, 3

Query TxOp Limit
iwpriv ath0 get_txoplimit  0
ac = 0, 1, 2, 3

Query AIFS
iwpriv ath0 get_aifs  0
ac = 0, 1, 2, 3

Query all WMM Parameters
Wlanconfig ath0 list wme
Configuring Other 802.11e Parameters
Set NoAckPolicy
iwpriv ath0 noackpolicy  0 
ac = 0, 1, 2, 3
enable = 1, disable = 0

Query NoAckPolicy
iwpriv ath0 get_noackpolicy  0
ac = 0, 1, 2, 3

Enable U-APSD
iwpriv ath0 uapsd 1

Disable U-APSD
iwpriv ath0 uapsd 0

Query NoAckPolicy
iwpriv ath0 get_uapsd
Simple Test to Verify QoS The ICMP application “ping” may be used to set TOS in IP headers and may be used to quickly verify QoS functionality. The following command can be issued to send the ICMP packets with appropriate TOS settings. ping –Q –C tos = 0 or 96 (AC-BE), 32 or 64 (AC-BK), 128 or 160 (AC-VI), 192 or 224 (AC-VO)


Thanks to : http://wifi-insider.com/wlan/wmm.htm

Sunday, March 3, 2013

How to Design Solar PV System



What is solar PV system?
Solar photovoltaic system or Solar power system is one of renewable energy system which uses PV modules to convert sunlight into electricity. The electricity generated can be either stored or used directly, fed back into grid line or combined with one or more other electricity generators or more renewable energy source. Solar PV system is very reliable and clean source of electricity that can suit a wide range of applications such as residence, industry, agriculture, livestock, etc.
Major system components
Solar PV system includes different components that should be selected according to your system type, site location and applications. The major components for solar PV system are solar charge controller, inverter, battery bank, auxiliary energy sources and loads (appliances).
  •   PV module – converts sunlight into DC electricity.
  •   Solar charge controller – regulates the voltage and current coming from the PV panels going to
      battery and prevents battery overcharging and prolongs the battery life.
  •   Inverter – converts DC output of PV panels or wind turbine into a clean AC current for AC
      appliances or fed back into grid line.
  •   Battery – stores energy for supplying to electrical appliances when there is a demand.
  •   Load – is electrical appliances that connected to solar PV system such as lights, radio, TV, computer,
      refrigerator, etc.
  •   Auxiliary energy sources - is diesel generator or other renewable energy sources.
Solar PV system sizing
1. Determine power consumption demands
The first step in designing a solar PV system is to find out the total power and energy consumption of all loads that need to be supplied by the solar PV system as follows:
     1.1 Calculate total Watt-hours per day for each appliance used.
           Add the Watt-hours needed for all appliances together to get the total Watt-hours per day which
           must be delivered to the appliances.

     1.2 Calculate total Watt-hours per day needed from the PV modules.
            Multiply the total appliances Watt-hours per day times 1.3 (the energy lost in the system) to get
            the total Watt-hours per day which must be provided by the panels.
2. Size the PV modules
Different size of PV modules will produce different amount of power. To find out the sizing of PV module, the total peak watt produced needs. The peak watt (Wp) produced depends on size of the PV module and climate of site location. We have to consider “panel generation factor” which is different in each site location. For Thailand, the panel generation factor is 3.43. To determine the sizing of PV modules, calculate as follows:
     2.1 Calculate the total Watt-peak rating needed for PV modules
           Divide the total Watt-hours per day needed from the PV modules (from item 1.2) by 3.43 to get   
           the total Watt-peak rating needed for the PV panels needed to operate the appliances.
     2.2 Calculate the number of PV panels for the system
           Divide the answer obtained in item 2.1 by the rated output Watt-peak of the PV modules available
           to you. Increase any fractional part of result to the next highest full number and that will be the
           number of PV modules required.
Result of the calculation is the minimum number of PV panels. If more PV modules are installed, the system will perform better and battery life will be improved. If fewer PV modules are used, the system may not work at all during cloudy periods and battery life will be shortened.

3. Inverter sizing
An inverter is used in the system where AC power output is needed. The input rating of the inverter should never be lower than the total watt of appliances. The inverter must have the same nominal voltage as your battery.
For stand-alone systems, the inverter must be large enough to handle the total amount of Watts you will be using at one time. The inverter size should be 25-30% bigger than total Watts of appliances. In case of appliance type is motor or compressor then inverter size should be minimum 3 times the capacity of those appliances and must be added to the inverter capacity to handle surge current during starting.
For grid tie systems or grid connected systems, the input rating of the inverter should be same as PV array rating to allow for safe and efficient operation.

4. Battery sizing
The battery type recommended for using in solar PV system is deep cycle battery. Deep cycle battery is specifically designed for to be discharged to low energy level and rapid recharged or cycle charged and discharged day after day for years. The battery should be large enough to store sufficient energy to operate the appliances at night and cloudy days. To find out the size of battery, calculate as follows:
     4.1 Calculate total Watt-hours per day used by appliances.
     4.2 Divide the total Watt-hours per day used by 0.85 for battery loss.
     4.3 Divide the answer obtained in item 4.2 by 0.6 for depth of discharge.
     4.4 Divide the answer obtained in item 4.3 by the nominal battery voltage.
     4.5 Multiply the answer obtained in item 4.4 with days of autonomy (the number of days that you
           need the system to operate when there is no power produced by PV panels) to get the required
           Ampere-hour capacity of deep-cycle battery.
Battery Capacity (Ah) = Total Watt-hours per day used by appliances x Days of autonomy
(0.85 x 0.6 x nominal battery voltage)
5. Solar charge controller sizing
The solar charge controller is typically rated against Amperage and Voltage capacities. Select the solar charge controller to match the voltage of PV array and batteries and then identify which type of solar charge controller is right for your application. Make sure that solar charge controller has enough capacity to handle the current from PV array.
For the series charge controller type, the sizing of controller depends on the total PV input current which is delivered to the controller and also depends on PV panel configuration (series or parallel configuration).
According to standard practice, the sizing of solar charge controller is to take the short circuit current (Isc) of the PV array, and multiply it by 1.3
Solar charge controller rating = Total short circuit current of PV array x 1.3
Remark: For MPPT charge controller sizing will be different. (See Basics of MPPT Charge Controller)
Example: A house has the following electrical appliance usage:
  • One 18 Watt fluorescent lamp with electronic ballast used 4 hours per day.
  • One 60 Watt fan used for 2 hours per day.
  • One 75 Watt refrigerator that runs 24 hours per day with compressor run 12 hours and off 12 hours.
The system will be powered by 12 Vdc, 110 Wp PV module.
1. Determine power consumption demands
Total appliance use = (18 W x 4 hours) + (60 W x 2 hours) + (75 W x 24 x 0.5 hours)
 = 1,092 Wh/day
Total PV panels energy needed = 1,092 x 1.3
 = 1,419.6 Wh/day.

2. Size the PV panel
2.1 Total Wp of PV panel capacity
      needed
= 1,419.6 / 3.4
 = 413.9 Wp
2.2  Number of PV panels needed= 413.9 / 110
 = 3.76 modules
                                                              
          Actual requirement = 4 modules
          So this system should be powered by at least 4 modules of 110 Wp PV module.
3. Inverter sizing
    Total Watt of all appliances = 18 + 60 + 75 = 153 W
    For safety, the inverter should be considered 25-30% bigger size.
    The inverter size should be about 190 W or greater.
4. Battery sizing
    Total appliances use = (18 W x 4 hours) + (60 W x 2 hours) + (75 W x 12 hours)
    Nominal battery voltage = 12 V
    Days of autonomy = 3 days
    Battery capacity = [(18 W x 4 hours) + (60 W x 2 hours) + (75 W x 12 hours)] x 3
                                                (0.85 x 0.6 x 12)
    Total Ampere-hours required 535.29 Ah
    So the battery should be rated 12 V 600 Ah for 3 day autonomy.
5. Solar charge controller sizing
    PV module specification
    Pm = 110 Wp
    Vm = 16.7 Vdc
    Im = 6.6 A
    Voc = 20.7 A
    Isc = 7.5 A
    Solar charge controller rating = (4 strings x 7.5 A) x 1.3 = 39 A
    So the solar charge controller should be rated 40 A at 12 V or greater.

-----------------------------------

First, you need to inventory all your loads:
laptop 60W 12 hours 
lamp CFL 20W 6 hours
lamp CFL 20W 6 hours
coffee maker 1400W 0.1hr
internet modem 30W 24 hours
Fridge 350W 6 hours

Once you have a listing of your loads, you total the daily watt hours for each load:
lamp CFL 20W 6 hours = 120wh
tea pot 1400W 0.1hr = 140wh

then you add all the watt hours up for the daily total = 1,220 wh [ or 1.22KWh ] 

Then you need the number of good sun hours in your area pvwatts.org lets use 5 as a average number. Double your consumption : 2440 and divide by sun hours 5 = 488W
488w is the amount of solar PV needed to run your loads for the caculated time.

Then we can figure batteries later.
-----------------------------------

Thanks to :