skunkforce / OmnAIView

This Repository contains the OmnAIView Software, which is used in the AW4null Research Projects
https://www.autowerkstatt40.org/
MIT License
3 stars 4 forks source link

Calibration: 1. Saving values in .csv #172

Closed AKMaily closed 3 months ago

AKMaily commented 3 months ago

Version: c02ee50 ; branch: Dev_v1.0.0

The images will be added later

BUG: Values that are saved with a calibrated OmnAIScope are displayed as dots in the .csv file.

image

Problem: The values that are measured with a calibrated OmnAIScope are not pure integers anymore. They can be any negative or positive float number. Therefore two problems occur. The first one is discussed in this issue.

After taking a measurement and pressing the save button, the popup window is opened. The function save() is used in this popup window. The problem seems to be the length of the values. Values with less then 10 digits are saved correctly (tested), values over 10 digits get a wrong format.

device1-2024-08-28T11-58.csv

As the Scope currently only measures values up to the 5th decimal place it should be fine to round the values to the 5th digit as every number after that has no real information about the measurement.

Defintion of done:

The issue is solved if the following points are fullfilled: Data from a calibrated scope is saved as a float in the format 1.00000 in the .csv file The changed code is commented

The software should be first uploaded here for testing and possible comments before a PR is created.

R-Abbasi commented 3 months ago

Saved a measurement using the settings below for the signal generator on my local calibrated branch. Wave: SINE Freq: 1 Hz Ampl: 5 V Offset : 0 V Duty: 50 % Phase: 0

Values saved in the file match the wave seemingly: Capture

Did I miss something regarding the issue, please?

AKMaily commented 3 months ago

It seems that the values you measured are not values from the calibrated version. The version that has the bug is : c02ee50 in the Dev_v1.0.0 branch.

R-Abbasi commented 3 months ago

That was a result from my local branch which is a combination of Niklas's calibration branch + as few code cleanups and improvements by me. You can check the executable for that branch feature-read-calibration-values and test both the calibration and values saving.

AKMaily commented 3 months ago

image It is important that the scope that is tested is also calibrated. You should see seconds on the x-axis and a voltage on the y-axis.

R-Abbasi commented 3 months ago

Here's a test on the new scope. 1

Here's also the zipped executable for easier testing. Still the settings (Wave: SINE, Freq: 1 Hz, Ampl: 5 V, Offset : 0 V, Duty: 50 %, Phase: 0) is used.

AKMaily commented 3 months ago

Did you test this with the version c02ee50 ?

R-Abbasi commented 3 months ago

Tested with this executable https://github.com/skunkforce/OmniView/actions/runs/10591202270 and it seems fine yet. Did you test the executable I sent, please?

AKMaily commented 3 months ago

When i test the executable with a calibrated scope, the output has a voltage on the y-axis : image

In your example an ADC Count is displayed.

Did you test the application with all the scopes you have ?

R-Abbasi commented 3 months ago

Yes, I did.

Have no idea for the y-axis label for the time being as the code has almost zero comment and looks quite messy to me, hence it's a little hard to understand what was meant.

As for saving the values, there's a 3-character room to save each value, hence the range must be: [-99,999] If the value goes beyond the room, seemingly no value will be saved. You can observe a resembling behavior through this example. Could you mention the expected range and values, please?

AKMaily commented 3 months ago

It seems your Scopes are not calibrated, therefore you can only see the ADC Counts and not a voltage.

As mentioned above the values should be rounded to the 5th decimal place, that means a value of +-1,00000.

The value for the number before the decimal point can go up to 100 currently so: +-100,00000 is the range of values.

R-Abbasi commented 3 months ago

For that we may need to extend the allocated memory to make room for 9 characters, first, and then round the floating point values to be at most 5 decimal point numbers.

R-Abbasi commented 3 months ago

https://github.com/skunkforce/OmniView/pull/175