| Power Control  Ina big picture, the power control of 3G(WCDMA/HSPA) , 4G(LTE) and 5G(NR) arealmost same. If you have a good understandings on power control concept andmechnisnm of 3G or 4G, you will not have much difficulties in understanding 5Gpower control.  
 How PRACH Power is determined ?  
 Main part of PRACHpower is defined in 38.213-7.4 as follows and you need to refer to severalother specification for complete understanding of the equation.  
 This equation simplysays i)Calculate P_PRACH,target,f,c + PL_b,f,c ii)Compare the calculated power(P_PRACH,target,f,c + PL_b,f,c) with P_CMAX,f,c iii)If the calculated power(P_PRACH,target,f,c + PL_b,f,c) is greater thanP_CMAX,f,c, use P_CMAX,f,c. If the calculated poewr is lower than P_CMAX,f,c,then use the calculated power. 
 
 
 
 
 
 P-EMAX,c :     determined by p-Max in RRC messageP_PowerClass : specified in     the following table.
 
 <38.101-1 : Table 6.2.1-1: UE Power Class > 
 < 38.101-2 v15.3Table 6.2.1.1-2: UE maximum output power limits for power class 1 > 
 < 38.101-2 v15.3Table 6.2.1.2-2: UE maximum output power limits for power class 2 > 
 < 38.101-2 v15.3Table 6.2.1.2-2: UE maximum output power limits for power class 2 > 
 
 < Determination ofreferenceSignalPower >   
 The description inthis section is largely based on 38.213 - 7.4 
 
 Case 1 : In one ofthe following condition PRACH transmission from a UE     is not in response to a detection of a PDCCH order by the UEPRACH transmission from a UE     is in response to a detection of a PDCCH order by the UE that triggers a     contention based random access procedurePRACH transmission from a UE     is associated with a link recovery procedure where a corresponding index     q_new is associated with a SS/PBCH block
 
 Then, referenceSignalPower is determined by ss-PBCH-BlockPower 
 
 Case 2 : In oneof the following condition PRACH transmission from a UE     is in response to a detection of a PDCCH order by the UE that triggers a     noncontention based random access procedure and depends the DL RS that the     DM-RS of the PDCCH order is quasicollocated.
 
 Then, referenceSignalPower is determined by ss-PBCH-BlockPower 
 
 Case 3 : In oneof the following condition PRACH transmission from a UE     is in response to a detection of a PDCCH order by the UE that triggers a     noncontention based random access procedure and the UE is configured     resources for a periodic CSI-RS reception or the PRACH transmission is     associated with a link recovery procedure where a corresponding index     q_new is associated with a periodic CSI-RS configuration.
 
 Then, referenceSignalPower is determined by ss-PBCH-BlockPower and powerControlOffsetSS ,where powerControlOffsetSS (in RRC) is an offset of CSI-RS transmission powerrelative to SS/PBCH block transmission power.         ifpowerControlOffsetSS is not provided by RRC, UE assumes that this value is 0 dB 
 
 < Determination of PREAMBLE_RECEIVED_TARGET_POWER > 
 PREAMBLE_RECEIVED_TARGET_POWERis determined by following equation (38.321 - 5.1.3) PREAMBLE_RECEIVED_TARGET_POWER =preambleReceivedTargetPower (in RRC)    +DELTA_PREAMBLE     +(PREAMBLE_POWER_RAMPING_COUNTER – 1) × PREAMBLE_POWER_RAMPING_STEP 
 < 38.321 V15.3.0- Table 7.3-1: DELTA_PREAMBLE values for long preamble formats. > 
 
 < 38.321 V15.3.0- Table 7.3-2: DELTA_PREAMBLE values for short preamble formats. > 
 
 
 How msg3 Power is determined ?  
 msg3 Power isdetermined by following equation.  
 
 
 How PUSCH Power is determined ?  
 
 
 
 RRC Parameters involved in Power Control  
 38.331v15.3.0 
 FrequencyInfoUL-SIB ::=          SEQUENCE {     frequencyBandList              MultiFrequencyBandListNR-SIB    OPTIONAL,   -- Cond FDD-OrSUL     absoluteFrequencyPointA        ARFCN-ValueNR            OPTIONAL,  -- Cond FDD-OrSUL     scs-SpecificCarrierList        SEQUENCE (SIZE (1..maxSCSs)) OFSCS-SpecificCarrier,     p-Max                          P-Max        OPTIONAL,   -- Need S     frequencyShift7p5khz           ENUMERATED{true}  OPTIONAL,   -- Cond FDD-OrSUL-Optional     ... } 
 ServingCellConfigCommonSIB ::=      SEQUENCE {     supplementaryUplink                UplinkConfigCommonSIB  OPTIONAL,   -- Need R     n-TimingAdvanceOffset              ENUMERATED{ n0, n25560, n39936 }   OPTIONAL, -- Need S     ssb-PositionsInBurst                    SEQUENCE{         inOneGroup                          BITSTRING (SIZE (8)),         groupPresence                       BITSTRING (SIZE (8))                                      OPTIONAL-- Cond Above6GHzOnly     },     ssb-PeriodicityServingCell          ENUMERATED{ms5, ms10, ms20, ms40, ms80, ms160},     tdd-UL-DL-ConfigurationCommon      TDD-UL-DL-ConfigCommon   OPTIONAL, -- Cond TDD     ss-PBCH-BlockPower                 INTEGER(-60..50),     ... } 
 RACH-ConfigGeneric ::=          SEQUENCE {     prach-ConfigurationIndex         INTEGER(0..255),     msg1-FDM                         ENUMERATED{one, two, four, eight},     msg1-FrequencyStart              INTEGER(0..maxNrofPhysicalResourceBlocks-1),     zeroCorrelationZoneConfig        INTEGER(0..15),     preambleReceivedTargetPower      INTEGER(-200..-74),     preambleTransMax                ENUMERATED{n3,n4,n5,n6,n7,n8,n10,n20,n50,n100,n200},     powerRampingStep                 ENUMERATED{dB0, dB2, dB4, dB6},     ra-ResponseWindow                ENUMERATED{sl1, sl2, sl4, sl8, sl10, sl20, sl40, sl80} } 
 NZP-CSI-RS-Resource::= SEQUENCE {     nzp-CSI-RS-ResourceId                NZP-CSI-RS-ResourceId,     resourceMapping                      CSI-RS-ResourceMapping,     powerControlOffset                   INTEGER(-8..15),     powerControlOffsetSS                 ENUMERATED{db-3,db0, db3, db6},     scramblingIDScramblingId,     periodicityAndOffset                 CSI-ResourcePeriodicityAndOffset     qcl-InfoPeriodicCSI-RS               TCI-StateIdOPTIONAL, -- Cond Periodic     ... } 
 
 PUSCH-ConfigCommon::= SEQUENCE {     groupHoppingEnabledTransformPrecoding      ENUMERATED {enabled} OPTIONAL,     pusch-TimeDomainAllocationList             PUSCH-TimeDomainResourceAllocationList     msg3-DeltaPreamble                         INTEGER(-1..6)     p0-NominalWithGrant                        INTEGER(-202..24)     ... } 
 
 PUSCH-Config::= SEQUENCE {     dataScramblingIdentityPUSCH                INTEGER(0..1023) OPTIONAL,     txConfig                                   ENUMERATED{codebook, nonCodebook}      dmrs-UplinkForPUSCH-MappingTypeA           SetupRelease{ DMRS-UplinkConfig }      dmrs-UplinkForPUSCH-MappingTypeB           SetupRelease{ DMRS-UplinkConfig }      frequencyHopping                           ENUMERATED{intraSlot, interSlot}      frequencyHoppingOffsetLists                SEQUENCE(SIZE (1..4)) OF                                                       INTEGER(1.. maxNrofPhysicalResourceBlocks-1)      resourceAllocation                         ENUMERATED{ resourceAllocationType0,                                                             resourceAllocationType1,                                                             dynamicSwitch},     pusch-TimeDomainAllocationList             SetupRelease{                                                           PUSCH-TimeDomainResourceAllocationList                                                 }     pusch-AggregationFactor                    ENUMERATED{ n2, n4, n8 }      mcs-Table                                  ENUMERATED{qam256, qam64LowSE}      mcs-TableTransformPrecoder                 ENUMERATED{qam256, qam64LowSE}      transformPrecoder                        ENUMERATED{enabled, disabled}      codebookSubset                             ENUMERATED{fullyAndPartialAndNonCoherent,                                                             partialAndNonCoherent,                                                             nonCoherent}     maxRank                                    INTEGER(1..4)      rbg-Size                                   ENUMERATED{ config2}      uci-OnPUSCH                                SetupRelease{ UCI-OnPUSCH }      tp-pi2BPSK                                 ENUMERATED{enabled}      ... } 
 
 PUSCH-PowerControl ::=SEQUENCE {    tpc-Accumulation                  ENUMERATED{ disabled } OPTIONAL, -- Need S    msg3-Alpha                        Alpha   OPTIONAL, -- Need S    p0-NominalWithoutGrant            INTEGER(-202..24) OPTIONAL, -- Need M    p0-AlphaSets                      SEQUENCE(SIZE (1..maxNrofP0-PUSCH-AlphaSets))     pathlossReferenceRSToAddModList   SEQUENCE (SIZE (1..maxNrofPUSCH-PathlossReferenceRSs))     pathlossReferenceRSToReleaseList  SEQUENCE (SIZE (1..maxNrofPUSCH-PathlossReferenceRSs))                                                 OF   PUSCH-PathlossReferenceRS-Id OPTIONAL,     twoPUSCH-PC-AdjustmentStates      ENUMERATED {twoStates}   OPTIONAL, -- Need S    deltaMCS                          ENUMERATED{enabled}       OPTIONAL, -- Need S    sri-PUSCH-MappingToAddModList     SEQUENCE (SIZE (1..maxNrofSRI-PUSCH-Mappings))     sri-PUSCH-MappingToReleaseList    SEQUENCE (SIZE (1..maxNrofSRI-PUSCH-Mappings))                                                 OFSRI-PUSCH-PowerControlId OPTIONAL -- Need N } 
 
 P0-PUSCH-AlphaSet ::=SEQUENCE {    p0-PUSCH-AlphaSetId               P0-PUSCH-AlphaSetId,    p0                                INTEGER(-16..15) OPTIONAL, -- Need S    alpha                             AlphaOPTIONAL -- Need S } 
 Alpha ::= ENUMERATED{alpha0, alpha04, alpha05, alpha06, alpha07, alpha08, alpha09, alpha1} 
 P0-PUSCH-AlphaSetId::= INTEGER (0..maxNrofP0-PUSCH-AlphaSets-1) 
 PUSCH-PathlossReferenceRS::= SEQUENCE {    pusch-PathlossReferenceRS-Id      PUSCH-PathlossReferenceRS-Id,    referenceSignalCHOICE {       ssb-Index                      SSB-Index,       csi-RS-Index                   NZP-CSI-RS-ResourceId    } } 
 
 PUSCH-PathlossReferenceRS-Id::= INTEGER (0..maxNrofPUSCH-PathlossReferenceRSs-1) 
 SRI-PUSCH-PowerControl ::=SEQUENCE {    sri-PUSCH-PowerControlId          SRI-PUSCH-PowerControlId,    sri-PUSCH-PathlossReferenceRS-Id  PUSCH-PathlossReferenceRS-Id,    sri-P0-PUSCH-AlphaSetId           P0-PUSCH-AlphaSetId,    sri-PUSCH-ClosedLoopIndex         ENUMERATED { i0, i1 } } 
 SRI-PUSCH-PowerControlId::= INTEGER (0..maxNrofSRI-PUSCH-Mappings-1) 
 BetaOffsets ::= SEQUENCE {    betaOffsetACK-Index1          INTEGER(0..31)OPTIONAL, -- Need S    betaOffsetACK-Index2          INTEGER(0..31)OPTIONAL, -- Need S    betaOffsetACK-Index3          INTEGER(0..31)OPTIONAL, -- Need S    betaOffsetCSI-Part1-Index1    INTEGER(0..31) OPTIONAL, -- Need S    betaOffsetCSI-Part1-Index2    INTEGER(0..31) OPTIONAL, -- Need S    betaOffsetCSI-Part2-Index1    INTEGER(0..31) OPTIONAL, -- Need S    betaOffsetCSI-Part2-Index2    INTEGER(0..31) OPTIONAL -- Need S } 
 
 PUCCH-Config::=        SEQUENCE {     resourceSetToAddModList         SEQUENCE(SIZE (1..maxNrofPUCCH-ResourceSets)) OF                                             PUCCH-ResourceSet             OPTIONAL,   --Need N     resourceSetToReleaseList        SEQUENCE(SIZE (1..maxNrofPUCCH-ResourceSets)) OF                                             PUCCH-ResourceSetId           OPTIONAL,   --Need N     resourceToAddModList            SEQUENCE(SIZE (1..maxNrofPUCCH-Resources)) OF                                               PUCCH-Resource               OPTIONAL,   --Need N     resourceToReleaseList           SEQUENCE(SIZE (1..maxNrofPUCCH-Resources)) OF                                               PUCCH-ResourceId             OPTIONAL,   --Need N     format1                         SetupRelease{ PUCCH-FormatConfig }  OPTIONAL,   -- Need M     format2                         SetupRelease{ PUCCH-FormatConfig }  OPTIONAL,   -- Need M     format3                         SetupRelease{ PUCCH-FormatConfig }  OPTIONAL,   -- Need M     format4                         SetupRelease{ PUCCH-FormatConfig }  OPTIONAL,   -- Need M 
     schedulingRequestResourceToAddModList   SEQUENCE(SIZE (1..maxNrofSR-Resources)) OF                                   SchedulingRequestResourceConfig     OPTIONAL, -- NeedM     schedulingRequestResourceToReleaseList  SEQUENCE(SIZE (1..maxNrofSR-Resources)) OF                                   SchedulingRequestResourceId         OPTIONAL,-- Need M 
     multi-CSI-PUCCH-ResourceList   SEQUENCE(SIZE (1..2)) OF PUCCH-ResourceId  OPTIONAL,-- Need M     dl-DataToUL-ACK                SEQUENCE(SIZE (8)) OF INTEGER (0..15)   OPTIONAL,   --Need M     spatialRelationInfoToAddModList    SEQUENCE(SIZE (1..maxNrofSpatialRelationInfos)) OF                                       PUCCH-SpatialRelationInfo   OPTIONAL,   --Need N     spatialRelationInfoToReleaseList   SEQUENCE(SIZE (1..maxNrofSpatialRelationInfos)) OF                                         PUCCH-SpatialRelationInfoId OPTIONAL,   --Need N 
     ... } 
 
 PUCCH-PowerControl ::=SEQUENCE {    deltaF-PUCCH-f0               INTEGER(-16..15) OPTIONAL, -- Need R    deltaF-PUCCH-f1               INTEGER(-16..15) OPTIONAL, -- Need R    deltaF-PUCCH-f2               INTEGER(-16..15) OPTIONAL, -- Need R    deltaF-PUCCH-f3               INTEGER(-16..15) OPTIONAL, -- Need R    deltaF-PUCCH-f4               INTEGER(-16..15) OPTIONAL, -- Need R    p0-Set                        SEQUENCE(SIZE (1..maxNrofPUCCH-P0-PerSet))     pathlossReferenceRSs          SEQUENCE (SIZE(1..maxNrofPUCCH-PathlossReferenceRSs))     twoPUCCH-PC-AdjustmentStates  ENUMERATED {twoStates} OPTIONAL, -- Need S    ... } 
 P0-PUCCH::= SEQUENCE {    p0-PUCCH-Id                   P0-PUCCH-Id,    p0-PUCCH-Value                INTEGER(-16..15) } 
 P0-PUCCH-Id::= INTEGER (1..8) 
 PUCCH-PathlossReferenceRS ::=SEQUENCE {    pucch-PathlossReferenceRS-Id   PUCCH-PathlossReferenceRS-Id,    referenceSignalCHOICE {       ssb-Index                   SSB-Index,       csi-RS-Index                NZP-CSI-RS-ResourceId    } } 
 |