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

Command line option for AC/DC coupling mode #45

Closed
Habakuk2000 opened this issue Dec 18, 2019 · 12 comments
Closed

Command line option for AC/DC coupling mode #45

Habakuk2000 opened this issue Dec 18, 2019 · 12 comments
Labels
Enhancement New feature or request Volunteers wanted NO SUPPORT unless someone wants to help!

Comments

@Habakuk2000
Copy link

Is ist possible to enable the ac/dc coupling without rebuilding the binaries. ex. by an option?

@Ho-Ro Ho-Ro added Enhancement New feature or request Volunteers wanted NO SUPPORT unless someone wants to help! labels Dec 18, 2019
@Ho-Ro
Copy link
Member

Ho-Ro commented Dec 19, 2019

I don't provide this option - technical reason: the const structures in modelDSO6022.cpp, where the behavior is defined, are defined for all possible models before main() starts, so an command line option can't change anything anymore. The appropriate device model is later activated using the USB identifier, which does not provide any indication of AC/DC. The firmware doesn't differentiate either, it just won't switch to AC if it's not defined in the model file.
I keep your suggestion in mind, but follow it with low priority - because it works for me as it is. ;).

@Ho-Ro Ho-Ro changed the title AC/DC coupling mode Command line option for AC/DC coupling mode Dec 24, 2019
@kiwichrish
Copy link

? The 6022 didn't have AC coupling mode?

@Habakuk2000
Copy link
Author

Habakuk2000 commented Jan 25, 2020 via email

@kiwichrish
Copy link

kiwichrish commented Jan 25, 2020

ROFL.. I just use a cap in series with the probe externally when I want AC coupling on mine. :-)

So once the mod is done does the re-compiled version of OpenHantek let you turn the mos relays on/off? Definitely worth doing.. that schematic explains why the damn thing clips some signals as well, depending on V/div setting..

@Ho-Ro
Copy link
Member

Ho-Ro commented Jan 28, 2020

So once the mod is done does the re-compiled version of OpenHantek let you turn the mos relays on/off?

Sure, that's the purpose of my modification.

that schematic explains why the damn thing clips some signals as well, depending on V/div setting.

If you take a closer look at the data sheet of the ADC, you will see another design error - the input voltage of the ADC (Ain=-0.5V..+0.5V, /Ain=0) is far outside the specification (common mode voltage: +0.7V..+1.1V). This may be the reason why the 1st 1000..2000 samples are garbage - I just throw them away during sampling.

image
image

Some more HW info and FW info.

@jm-o
Copy link
Contributor

jm-o commented Feb 5, 2020

Why not just leave AC and DC options always available on gui?

@Ho-Ro
Copy link
Member

Ho-Ro commented Feb 5, 2020

AC coupling requires a hardware modification that the majority of users do not have. The machine should only offer AC coupling if it is also available. Otherwise there will be many irritations and issue reports.

@jm-o
Copy link
Contributor

jm-o commented Feb 5, 2020

Even when choosing DC?
In the source code, it seems that this macro is only used to prevent AC selection.

FYI: As I only have cmake 3.10 (Ubuntu 18.04), I am unable to compile with HANTEK_AC defined. Function add_compile_definitions function has been added in cmake 3.12.

@Habakuk2000
Copy link
Author

@Jim-O:
good idea. leaving the AC/DC coupling mode 'always on' but you have to enable it with a checkbox in the settings menu... that should not lead to irritations.
btw: it took me a few days getting "visual studio", "cmake" and especially "qtcreator" to run. but i am unable to create 'release build' with qtcreator. whatever i do, it always creates 'debug build'. no way. using visual studio, everything works fine.

@Ho-Ro
Copy link
Member

Ho-Ro commented Feb 6, 2020

@Habakuk2000:
No need to worry, the debug overhead is removed latest at (linux) package creation. If you want to run the bare binary you can strip it like I do for testing my linux build:

cd build
make -j4 && strip openhantek/OpenHantek && openhantek/OpenHantek

That's it - for Windows VS should do the task.
BTW: what is your system?

@jm-o:

Even when choosing DC?

What do you mean???
If you select DC, it will measure with DC coupling, but if you would select AC on an unmodified Hantek, the SW will send the "switch-to-AC" command and the Hantek will set the appropriate port bits (without any effect) and will continue to use DC coupling - but the scope screen will tell you "AC coupling".
Many Hantek6022 users are newbies or makers and don't read documentation and will be confused. See the lengthy discussion about probe attenuation (fixed, variable or even at all), I don't need it because I'm used to do the range adaption in my brain since decades :)

Regarding your Ubuntu cmake version, you can change the entry in CMakeList.txt to:

if ( DEFINED HANTEK_AC )
    if(${CMAKE_VERSION} VERSION_LESS "3.12.0") 
        add_definitions( -DHANTEK_AC )
    else()
        add_compile_definitions( HANTEK_AC )
    endif()
endif()

(currently untested as I'm away from my development system)
EDIT: yes, works like expected

@Habakuk2000
Copy link
Author

@Ho-Ro:
My System is Windows 10 Pro

@jm-o
Copy link
Contributor

jm-o commented Feb 6, 2020

What do you mean???
I didn't understand what you meant when you said "Otherwise there will be many irritations and issue reports.".
It wasn't software issues but users issues :-)

An AC checkbox in Settings/Scope, disabled by default, seems to be a good enough solution to keep the user informed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Volunteers wanted NO SUPPORT unless someone wants to help!
Projects
None yet
Development

No branches or pull requests

4 participants