-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSU datavector parser #55
Comments
`RetVal eps_settings_set(uint8_t cc, uint8_t reg, uint8_t val)
}` It seems that internal registers of PSU can be changed by two byte TX message (register index, value) |
`void eps_settings_read_all(uint8_t cc)
}` I would try to take a closer look into PEGASUS EPS functions in order to understand how it was implemented there It looks like this line 386 already works as a parser data stored in received bytearray is recorded directly into structure that is meant to keep this data. it is seen that RX size is 24 and number of bytes within the structure is indeed 24 + 1 (data_valid, whic seems to be not used) |
Some notes about the 'data_valid' variable. During design of PEGASUS there was an effort made to get a 'secure data layer' somehow. The idea was that most stuff was available in a redundant way (2x I2C buses to EPU, 2x STACIES as comm interface, ....). You can find this everywhere in this code. E.g. when reading values (of this 'layer') there is always a related 'valid bit' somewhere. But as this design was not thought through very well (especially what a higher layer should really do with that additional information ....) and it was completely untested at the time I entered the project, we decided to abandon it at this stage! |
yea, this was a 'strange' conversion to 'fixed format' to have floats in 16bit values, to compress them for beacon and so on.... I would leave this for one discussion point for tomorrow. This (datatypes valid to be used!) has to be decided on a general level. Exactly this kind of confusion was triggering the famous ARIANE crash (as far as I can remember this ) :-) |
q2_13 Does it mean that : So it can store [4] values as integer part and [8192] values as floating part ? uq3_13 means that : 3bits are used to encode integer So it can store [8] values as integer part and [8192] values as floating part, only positive numbers to store current int16 ---> +/-[0,1,2,3].999 A to store voltage uint16_t [0,1,2,3,4,5,6,7].999 V Temperature : [0-127].[0-99] C Is that how it is supposed to work !?!?!?!??!?!??!???!?!?!? |
Lets take it in reverse order :
Those two MSB, LBS uint8_t would represent how the value is stored in PSU datavector[1] ,datavector[2] 2 things left to do :
|
ok, I never dived that deep into this 'fixed_xx' binary formats of EPS. I do not know what the exact intention of this format was ('Ease of use', 'compact bitwise format', 'avoid usage of float library functions', ....) I think we should/could ask the original EPU developer about this intentions and then we can decide together with Andi (@AndiHilftnix ?) what to do with this values in the CLIMB context - and define the Climb PSU Interface definition. |
Based on pegasys repo <style> </style>
|
I made general skeleton for PSU datavector parser c4c80a3
using the same method that I applied to parsing data from thruster registers.
PSU subsustem currently does not provide any real data! Only fake rubbish bytes.
PSU datavector is uint8_t array of bytes.
But values that are "encoded" by that datavector are not uint8_t !
Example from "Communication_Procedure_OBC_to_PSU_V2.doc" at https://github.com/DominicRichter/CLIMB_PSU
Something called "Edge temperature" is assembled out of two uint8_t bytes (low, high) into uint16_t value.
Temperature should in the end be represented as (270.5K) double unit measured in [K]
To obtain real physical value from datavector representation there should be something like CONVERSION_FACTOR
VALUE_UINT16 = (received_data[1] <<8 )| received_data[0];
double REAL_VALUE= VALUE_UINT16_t / CONVERSION_FACTOR
Example 1 :
We want to store 270.5 K as 2705
Which is hex 0x0A91
and can be represented with two bytes 0x0A and 0x91
Example 2 :
we obtain and asseble hex 0x0A91 out of received_data[0] , received_data[1] (which are two bytes in datavector)
store it as VALUE_UINT16 = 2705
now to obtain :
ACTUAL_VALUE = 2705 /100 = 270.5
where CONVERSION_FACTOR = 100
Those conversion factors have to be documented by PSU designers !!!
The text was updated successfully, but these errors were encountered: