Abraxas3d / pluto-msk-application

C-code application for the PLUTO MSK implementation
1 stars 0 forks source link

New Gain Representation #9

Open Abraxas3d opened 3 days ago

Abraxas3d commented 3 days ago

Attempting to represent newly calculated Kp and Ki: Kp = 2.8374e-04 Ki = 1.1468e-05

  1. Rebooted PLUTO SDR with updated firmware.
  2. Updated the register include file msk_top_regs.h
  3. Modified test code and updated the repository (msk_rx_init.c)

Using the higher resolution registers described in https://github.com/OpenResearchInstitute/pluto_msk/blob/main/rdl/msk_top_regs.md

Third line below is percent error, F1 accumulator, F2 accumulator, proportional config register, integral config register

(1) Total PRBS_BIT_COUNT:   (0x0012b65c@0050)
(1) Total PRBS_ERROR_COUNT: (0x00095fdd@0054)
(1) 50.0 -7999798 -27431568 0x2012984f 0x2000c067

Getting 50% error with no successes at all yet, but suspect I'm not representing the numbers correctly yet.

For example, we take Kp and divide by (1/2^32) and get how many times our calculated Kp can be divided by the resolution of the representation (in this case, 32 bit resolution). This scaled number is rounded and then converted to hex for display. We use the hex number in the gain multiplier field and 32 in the gain divisor field.

This should divide the hex value by (1/2^32).

Someone check to make sure I am representing the numbers correctly? :thinking:

Abraxas3d commented 3 days ago

Tried effective resolution of 24 bits next:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 100 (or more) buckets of bits on the bus. (1) Total PRBS_BIT_COUNT: (0x0011e614@0050) (1) Total PRBS_ERROR_COUNT: (0x0008f230@0054) (1) 50.0 -32438223 -110673764 0x18001298 0x180000c0 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

mwishek commented 3 days ago

Kp = 2.8374e-04 P-gain = 2.8374e-04 * 2^32 = 1218654 decimal = 0x12985E

For Ki = 1.1468e-05 I-gain = 1.1468e-05 * 2^32 = 49254 dec = 0xC067

For both P and I gains, the divisor/right-shift should be set to 32.

Abraxas3d commented 3 days ago

100 (or more) buckets of bits on the bus. (1) Total PRBS_BIT_COUNT: (0x001208a5@0050) (1) Total PRBS_ERROR_COUNT: (0x0009030c@0054) (1) 50.0 -30929385 -104185517 0x2012985e 0x2000c067

will send file to The Paul for processing in a bit! :grin: