Lo scintillatore tascabile Mirion-MGP PDS100G

Avatar utente
eliocor
Senior
Messaggi: 430
Iscritto il: 10/10/2015, 23:28
Località: Europe
Contatta:

Re: Lo scintillatore tascabile Mirion-MGP PDS100G

Messaggio da eliocor » 12/06/2017, 4:43

BTW, today I completely reverse engineered the communication protocol of the PDS-100G(N).
I wrote some python scripts to test it: attached to this message is the output of one 137Cs (TG77) 1024 points / 150seconds spectrum*, automatically created by my utility (no human intervention).
There are lots of things to do before the completition of a decent application, but this looks promising!

I have also added another file (chart_x2.xlsx) with two acquisitions:
- blue line is some radium (old WWII airplane dial), 90k pulses (237 seconds)
- red line is some 137Cs (TG77), 90k pulses (606 seconds)
Acquisitions are not calibrated, but it seems to me that they are rather spot on, even if I discovered some shift due to temperature: this is not a problem because temperature is memorized during spectrum acquisition and it will not be so difficult to correct for the shift.

*) the spectrum was not calibrated but you can play with the two values 'Gain' and 'Offset'. Once done you can set those two calibration values in the PDS-100G parameters.
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.


٩(•̮̮̃•̃)۶ - Excusatio non petita, accusatio manifesta


BOPOH
Messaggi: 13
Iscritto il: 10/05/2017, 22:07
Località: Ukraine

Re: Lo scintillatore tascabile Mirion-MGP PDS100G

Messaggio da BOPOH » 12/06/2017, 11:35

eliocor ha scritto:BTW, today I completely reverse engineered the communication protocol of the PDS-100G(N).
WOW!!! :shock:
I was spying on PDS100 <-> PDSMass communications, but don't undertood all.
I found some limitations in spectrum transfer protocol:
- indicated acquisition time <= 999sec (PDS can collect spectrum longer if we select "continue" after first 999 seconds, but transferred spectrum indicates 999seconds)
- channel counters are 16bit so max value is 65335. I don't try to overflow it (it is not hard with Am231-based smoke detector plus several 999seconds interval)



Avatar utente
eliocor
Senior
Messaggi: 430
Iscritto il: 10/10/2015, 23:28
Località: Europe
Contatta:

Re: Lo scintillatore tascabile Mirion-MGP PDS100G

Messaggio da eliocor » 12/06/2017, 16:27

BOPOH ha scritto:I found some limitations in spectrum transfer protocol:
- indicated acquisition time <= 999sec (PDS can collect spectrum longer if we select "continue" after first 999 seconds, but transferred spectrum indicates 999seconds)
- channel counters are 16bit so max value is 65335. I don't try to overflow it (it is not hard with Am231-based smoke detector plus several 999seconds interval)
You are correct, but please take care that the PDS-100G is not a "rea'l" instrument, so it can occur in some problems during a long term spectrum survey, especially drift/shift due to temperature.

During the reverse engineering phase I got only some doubts about some fields in '15' packet:
R15.png
They are/were never used by PDSmass

Do you know their meaning?

BTW, except for those fields, everything else was identified in all packets.
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.


٩(•̮̮̃•̃)۶ - Excusatio non petita, accusatio manifesta

BOPOH
Messaggi: 13
Iscritto il: 10/05/2017, 22:07
Località: Ukraine

Re: Lo scintillatore tascabile Mirion-MGP PDS100G

Messaggio da BOPOH » 12/06/2017, 21:55

eliocor ha scritto:You are correct, but please take care that the PDS-100G is not a "rea'l" instrument, so it can occur in some problems during a long term spectrum survey, especially drift/shift due to temperature.
999seconds < 17minutes isn't loooooong time ;) But we need to know the limitations and range of applicability of the instruments used to draw the correct conclusions from the measured quantities.
During the reverse engineering phase I got only some doubts about some fields in '15' packet:
My PDS eats too many energy then BT connected, so I interested only in "connect - grab spectrum - disconnect'. So I interested only in reverse engineering only spectrum transmission (G22000/G22002) and memory cleaning (S22000).

R22 format:
OFFSET,LEN DESCR
+0,1 0x02
+1,3: 'R22'
+4,8: PDS serial NUM, with leading spaces
+12,3: gain * 100 ('184' -> 1.84)
+15,3: offset
+18,3: temperature C
+21,3: acquisition time (sec)
+24,5: dose rate mSv/h
+29,3: ??? '000'
+32,12 time/date HHMMSSddmmyy
+44,4: channelsNUM
+48,3: PDS_specrum_memory_ID
+51,2*channelsNUM: channel counts



Avatar utente
eliocor
Senior
Messaggi: 430
Iscritto il: 10/10/2015, 23:28
Località: Europe
Contatta:

Re: Lo scintillatore tascabile Mirion-MGP PDS100G

Messaggio da eliocor » 12/06/2017, 22:30

here the results of my analysis of '22' packet:
R22.png
If you are able to install Python and some of its libraries*, in few days I will publish a small program which will exactly do what you need (will create a .XLSX file like the ones I have posted).


*) it is a very easy operation
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.


٩(•̮̮̃•̃)۶ - Excusatio non petita, accusatio manifesta


Avatar utente
eliocor
Senior
Messaggi: 430
Iscritto il: 10/10/2015, 23:28
Località: Europe
Contatta:

Re: Lo scintillatore tascabile Mirion-MGP PDS100G

Messaggio da eliocor » 14/06/2017, 9:17

Here it is the first draft for a PDS-100G spectra downloader: it was written in python and at this date it is a very rough utility... Try it at your own risk! ;)
Some quick instructions:
  • - create the following directory: "C:\PDS"
    - download the 'spectrum.zip' file and decompress it in "C:\PDS"

    - go to [External Link Removed for Guests]" onclick="window.open(this.href);return false; and download the Python installer v2.7.13
    - install it
    - press [Next] until you'll reach the 'Customize Python 2.7.13' window
    - in the feature list, ENABLE the 'Add python.exe to Path' option
    - press [Next] or [OK] until setup has been terminated
    - once done, open a command prompt window: press the 'Windows' key, followed by 'r' and digit 'cmd' followed by [OK]
    - in the command prompt window digit:
    pip install pyserial
    pip install xlsxwriter

    - you are done with the Python installation/configuration! (not to be repeated again)
if you have closed the command prompt window, reopen it (Win-R/cmd/[OK]), otherwise return to the command prompt window:
  • - digit:
    cd c:\pds
    - now you can run the program: to see a small reminder of the available options, digit:
    python spectrum.py -h
    - you will get the following message:

Codice: [Local Link Removed for Guests]

usage: spectrum.py [-h] [--version] [-v] [-k] [-d] [-l] [-e] [-p PORT]
                   [-s SPEED] [-t TIMEOUT] [-o OUTPUT] [-m MAGNIFY]
                   [-r ROTATION]

download spectra files from MGP PDS-100G(N) and write .XLSX file

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -v, --verbose
  -k, --kill            after retrieving, delete spectra from PDS-100G
  -d, --delete          delete spectra from PDS-100G
  -l, --last            save only last spectrum taken
  -e, --endian          change endianness of spectrum data
  -p PORT, --port PORT  serial port name
  -s SPEED, --speed SPEED
                        serial port speed [default: 115200]
  -t TIMEOUT, --timeout TIMEOUT
                        serial port timeout (ms) [default: 200]
  -o OUTPUT, --output OUTPUT
                        output file(s) name
  -m MAGNIFY, --magnify MAGNIFY
                        graph size (magnification), [default 3.0]
  -r ROTATION, --rotation ROTATION
                        graph X label rotation (degrees), [default -75]
  • - the most important parameter is the Bluetooh serial port: on my PC is COM4, so to run the spectrum.py program I will have to use:
    python spectrum.py -p com4
    or (it is exactly the same)
    python spectrum.py --port com4
    if used on linux it could be:
    python spectrum.py --port /dev/stty01

    in general the '-t' and '-s' and '-e' parameters should not be modified.
    At this date, the '-k' and '-d' parameters are not enabled: spectra files will NOT be deleted from the PDS-100G device!

    the default output file name is: SerialNumber.xlsx ; it can be renamed using the '-o' option. eg:
    python spectrum.py --port com4 -o foo.xlsx

    You can also modify some graphical properties of the graph in the Excel file: size of it (I use a 4K monitor, so the x3 magnification (default) is OK...) maybe you can use a different value, the same is for the X axis label rotation: it can be changed; eg:
    python spectrum.py --port com4 -m 2.1 --rotation 30

    Once run, the program will wait for the Bluetooth pairing of the PDS-100G, printing every some seconds the string:
    Waiting for Bluetooth connection.... (press <Ctrl-C> to exit)

    As an example, this is the output of a download session between my PC and the PDS-100G device:

    C:\PDS>python spectrum.py --port com4
    Waiting for Bluetooth connection.... (press <Ctrl-C> to exit)
    Waiting for Bluetooth connection.... (press <Ctrl-C> to exit)
    Waiting for Bluetooth connection.... (press <Ctrl-C> to exit)
    serial port [com4] opened at 115200 baud
    Serial number: A11xxx
    Serial number: A11xxx
    Got spectrum #4: creating excel worksheet...
    Got spectrum #3: creating excel worksheet...
    Got spectrum #2: creating excel worksheet...
    Got spectrum #1: creating excel worksheet...

    [ A11xxx.xlsx] file created.

    You can see the contents of the attached .XLSX fie: the 4 spectra files were stored in 4 different worksheets called 'SpectrumXX'
I would be grateful if you will test the python script with your PDS-100G just to see if it works even for you.

_ Elio.

______________________________________________________________________________________
Veloce traduzione in italiano (fare riferimento al testo in inglese che ha la formattazione del testo)
:
Ho scritto un programmino in Python che permette lo scaricamento degli spettri acquisiti con un PDS-100G, i quali vengono visualizzati creando un file Excel con dati e grafico (vedi allegato).
Seguono istruzioni e maggiori dettagli su come installare/usare tale programmino:
- creare una directory C:\PDS in cui scompattare il file .zip qui presente
- andare sul sito di Python e scaricare la versione 2.7.13
- installarla, assicurandosi (una volta arrivati alla finestra "Customize Python 2.7.13" che il campo "Add python.exe to Path" sia abilitato.
- terminare l'installazione
- aprire un prompt di comandi (finestra DOS) digitando [Windows-R] seguito da 'CMD' e dare invio
- installare i due moduli Python richiesti dal programma digitando i comandi:
pip install pyserial
pip install xlsxwriter
- l'installazione di Python è terminata.

- da finestra di comandi digitare (posizionarsi nella directory in cui è stato scompattato il file spectrum.zip):
CD C:\PSD
per avere un "aiuto" su come utilizzare il programma, digitare:
python spectrum.py -h
che stamperà il testo riportato più sopra.
Per eseguire il programma bisogna ALMENO sapere quale è la porta seriale/Bluetooth a cui fa il 'pair' il PDS-100G. Ad esempio nel mio PC è COM4, quindi per far partire il programma dovrò digitare:
python spectrum.py -p com4
oppure (è esattamente la stessa cosa):
python spectrum.py --port com4
Se fossi sotto linux (il programma funziona anche lì) il comando potrebbe essere:
python spectrum.py --port /dev/stty04

I parametri '-t', '-e' e '-s' di norma non dovrebbero venire richiesti.
Al momento i parametri '-k' e '-d' , usati per cancellare gli spettri dal PDS-100G non sono attivi.

il nome standard del file Excel è [Numerodiseriedeldispositivo.xlsx] ma può venire modificato usando il parametro '-o', ad esempio se volessi generare un file di nome pippo.xlsx dovrei digitare:
python spectrum.py --port com4 -o pippo.xlsx
oppure (è esattamente la stessa cosa):
python spectrum.py --p com4 -output pippo.xlsx
oppure (è esattamente la stessa cosa):
python spectrum.py --p com4 -o pippo.xlsx

Esistono anche delle opzioin per modificare i grafici generati da Excel: dimensioni del grafico e rotazione delle etichette sull'asse X. Sul mio PC la scalatura standard del grafico è 3x, ma è anche vero che uso un monitor 4x (3840x2160), per cui su altri PC potrebbe essere più pratico ridurlo un po' (ad esempio a 1.5x); anche le etichette di testo saranno create orizzontali (0 gradi) invece che lo standard (-70 gradi):

python spectrum.py --port com4 -magnify 1.5 --rotation 0

Una volta fatto partire il programma, esso rimarrà in attesa del pairing tra il PDS-100G ed il PC, stampando ogni qualche secondo la stringa:
Waiting for Bluetooth connection.... (press <Ctrl-C> to exit)

riporto per completezza ciò che stampa una intera seesione del programma di acquisizione (nel PDS-100G ci sono 4 spettri):

C:\PDS>python spectrum.py --port com4
Waiting for Bluetooth connection.... (press <Ctrl-C> to exit)
Waiting for Bluetooth connection.... (press <Ctrl-C> to exit)
Waiting for Bluetooth connection.... (press <Ctrl-C> to exit)
serial port [com4] opened at 115200 baud
Serial number: A11xxx
Serial number: A11xxx
Got spectrum #4: creating excel worksheet...
Got spectrum #3: creating excel worksheet...
Got spectrum #2: creating excel worksheet...
Got spectrum #1: creating excel worksheet...

[ A11xxx.xlsx] file created.

è sufficiente aprire il file [A11xxxx.xlsx] per farsi una idea dei grafici che genera: ogni spettro è in una pagina separata del foglio elettronico (tab in basso)
______________________________________________________________________________________
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.
Ultima modifica di eliocor il 14/06/2017, 13:27, modificato 2 volte in totale.


٩(•̮̮̃•̃)۶ - Excusatio non petita, accusatio manifesta

Avatar utente
Enotria
Senior
Messaggi: 283
Iscritto il: 08/10/2015, 17:15
Località: Ferrara
Contatta:

Re: Lo scintillatore tascabile Mirion-MGP PDS100G

Messaggio da Enotria » 14/06/2017, 12:40

.

E' un vero peccato che un argomento così interessante come questo sia precluso a chi, come me, non conosce l'inglese.

Neppure è valida l'opportunità di utilizzare i vari Traslate su questi argomenti così marcatamente scientifici, perché alle volte saltano fuori delle affermazioni assolutamente ridicole.

Comprendo ed apprezzo la volontà di mettere a loro agio i nostri ospiti stranieri, ma ciò non dovrebbe avvenire a scapito dei locali, anche se colpevoli di ignoranza della lingua inglese.

Se non è troppo fastidio, suggerisco a chi ben conosce l'inglese, tanto da saper rispondere direttamente in questa lingua, di aggiungere in coda la traduzione in italiano, in modo da rendere maggiormente usufruibile a chiunque la discussione.


[attachment=0]147.gif[/attachment]
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.


Andrea

URL: [External Link Removed for Guests]

Ogni oggetto ha la sua storia,
. . . io non vendo oggetti,
. . . . . . io racconto storie. (Enotria)

Avatar utente
eliocor
Senior
Messaggi: 430
Iscritto il: 10/10/2015, 23:28
Località: Europe
Contatta:

Re: Lo scintillatore tascabile Mirion-MGP PDS100G

Messaggio da eliocor » 14/06/2017, 13:21

Spero di averti soddisfatto: ho aggiunto anche una parvenza di traduzione al mio messaggio....
Nelle prossime risposte vedrò di aggiungere anche il testo in lingua madre


٩(•̮̮̃•̃)۶ - Excusatio non petita, accusatio manifesta

Rispondi

Torna a “Strumenti Tascabili”