Skip to content
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

Calibration: 1. Saving values in .csv #172

Closed
AKMaily opened this issue Aug 28, 2024 · 12 comments · Fixed by #175
Closed

Calibration: 1. Saving values in .csv #172

AKMaily opened this issue Aug 28, 2024 · 12 comments · Fixed by #175
Assignees
Labels
bug Something isn't working

Comments

@AKMaily
Copy link
Collaborator

AKMaily commented Aug 28, 2024

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.

@AKMaily AKMaily added the bug Something isn't working label Aug 28, 2024
@R-Abbasi
Copy link
Collaborator

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
Copy link
Collaborator Author

AKMaily commented Aug 28, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator Author

AKMaily commented Aug 28, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator Author

AKMaily commented Aug 28, 2024

Did you test this with the version c02ee50 ?

@R-Abbasi
Copy link
Collaborator

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
Copy link
Collaborator Author

AKMaily commented Aug 28, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator Author

AKMaily commented Aug 29, 2024

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
Copy link
Collaborator

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
Copy link
Collaborator

R-Abbasi commented Sep 2, 2024

#175

@R-Abbasi R-Abbasi linked a pull request Sep 2, 2024 that will close this issue
@R-Abbasi R-Abbasi removed a link to a pull request Sep 2, 2024
@R-Abbasi R-Abbasi linked a pull request Sep 2, 2024 that will close this issue
@AKMaily AKMaily closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants