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

working hallsensor #55

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
a421cbe
everything working
VR-Schipkowski Oct 5, 2022
0ee5c86
reset hallsensor
VR-Schipkowski Oct 5, 2022
8225296
sending char instead of bin
VR-Schipkowski Oct 6, 2022
b7819c1
fixing hallsensor to use reale Data
VR-Schipkowski Oct 6, 2022
de95d05
WIP: one way textbook aproch but var is quite off
VR-Schipkowski Oct 6, 2022
a9074ff
Using one pass textbook
VR-Schipkowski Oct 12, 2022
4cb8a1f
sending each step
VR-Schipkowski Oct 12, 2022
d53d07f
Sende jede messung zwecks valdierung
VR-Schipkowski Oct 12, 2022
1cdfc0a
adding funktion to set sample size
VR-Schipkowski Nov 3, 2022
05e25fc
removing artefaks
VR-Schipkowski Nov 3, 2022
96d885d
adding julia side to modify sample size
VR-Schipkowski Nov 3, 2022
0e7804d
2pass for hall sensor
VR-Schipkowski Nov 8, 2022
af9bddb
fixing var calculation
VR-Schipkowski Nov 8, 2022
25de8b7
using variable sample size
VR-Schipkowski Nov 8, 2022
04b546b
fixing missing float
VR-Schipkowski Nov 15, 2022
ef8137d
fixing version number
VR-Schipkowski Nov 15, 2022
1e68008
adding tem function
VR-Schipkowski Nov 17, 2022
66174dc
removed bug in sensor and versiun bump
VR-Schipkowski Nov 22, 2022
91ffe05
removing prints
VR-Schipkowski Nov 24, 2022
344662c
Merge branch 'master' into master
VincentR1 Nov 24, 2022
0c4a231
enable timeout
VR-Schipkowski Nov 24, 2022
c48e6b1
fixing timeouts
VR-Schipkowski Nov 29, 2022
0fcd508
removing @info from debugging
VR-Schipkowski Nov 29, 2022
a022084
Keeping it abstract, no direkt access on serial device
VR-Schipkowski Nov 29, 2022
d7ec15b
Added TDesignCube skeleton
nHackel Nov 30, 2022
0ae9dfa
Added inital skeleton for TDesignProtocol
nHackel Nov 30, 2022
c2042e3
More todos
nHackel Nov 30, 2022
8094dfc
appying caliration adding function for raw data
VR-Schipkowski Nov 30, 2022
caa3bb4
Merge branch 'master' of https://github.com/VincentR1/MPIMeasurements.jl
VR-Schipkowski Nov 30, 2022
815f633
comment out code
VR-Schipkowski Nov 30, 2022
0e72254
adding new prameter
VR-Schipkowski Dec 6, 2022
6f85260
commit out unused files
VR-Schipkowski Dec 6, 2022
03f920d
using calibration for variance
VR-Schipkowski Dec 7, 2022
b2104dc
getGaussMeter for Scanner
VR-Schipkowski Dec 7, 2022
bfabb06
Working Cube
VR-Schipkowski Dec 7, 2022
a59aaa0
fixing limits on sample size
VR-Schipkowski Dec 7, 2022
15a38a7
WIP: spliting sending and reciveing
VR-Schipkowski Dec 7, 2022
6fd67b4
cube uses splitted send recive
VR-Schipkowski Dec 7, 2022
c204ff5
fixing calibration
VR-Schipkowski Jan 16, 2023
38f3ba3
closing diveces when loading another fails
VR-Schipkowski Jan 16, 2023
de339e5
adding documentation
VR-Schipkowski Jan 17, 2023
47e1844
updating doku
VR-Schipkowski Jan 18, 2023
c50999e
Added TODOs
nHackel Jan 23, 2023
9c8c992
reducing waittime in sensor
VR-Schipkowski Jan 23, 2023
d1629a1
WIP: Merge branch 'master' of https://github.com/VincentR1/MPIMeasure…
VR-Schipkowski Jan 23, 2023
4278f8a
fixing calibration and removing varianz from calibrated getXYZValues
VR-Schipkowski Jan 26, 2023
af01e31
added comment to varianze
VR-Schipkowski Jan 26, 2023
af3387b
renaming new to updatedSampleSize
VR-Schipkowski Jan 26, 2023
0b8dbf8
Updated SEnsor software to 3.0 removing position fixing varianz to n-…
VR-Schipkowski Jan 30, 2023
23041ad
removing comment on set sample size, as the value only set if in vali…
VR-Schipkowski Jan 30, 2023
9d1dba4
adding missing ends
VR-Schipkowski Jan 30, 2023
8596f08
using lock correct in recive and trigger
VR-Schipkowski Jan 31, 2023
455d6d6
renaming recive to receive
VR-Schipkowski Jan 31, 2023
fda38ff
renaming send to query Comand
VR-Schipkowski Jan 31, 2023
bd9bbcc
Adding send and recive to Arduino.jl and using it in Gaussmeter
VR-Schipkowski Jan 31, 2023
3fd3248
parsing delay
VR-Schipkowski Jan 31, 2023
c601e91
fixing spelling wrong variable names spelling
VR-Schipkowski Jan 31, 2023
ea4c2d5
bias has to be subtrakted not added due to new calibration
VR-Schipkowski Jan 31, 2023
ebdf450
Applying bias correction on raw data
VR-Schipkowski Mar 15, 2023
2196206
WIP not testet
VR-Schipkowski Apr 6, 2023
e9b2a32
fixing fast mode
VR-Schipkowski Apr 12, 2023
9fceb77
changed positon to position in design
VR-Schipkowski Apr 14, 2023
e20fcbd
Merge branch 'MagneticParticleImaging:master' into master
VincentR1 May 16, 2023
9009745
adding positions
VR-Schipkowski May 31, 2023
08670ec
fixing hallsensor to singlepass
VR-Schipkowski Jun 2, 2023
54e223e
remove fast mode
VR-Schipkowski Jun 2, 2023
29d3bbf
Merge branch 'singlepass'
VR-Schipkowski Jun 2, 2023
a38431f
sorting by position id
VR-Schipkowski Jun 6, 2023
e9fdc37
WIP PRotikol
VR-Schipkowski Jun 6, 2023
b075fd6
adding missing update for mean approximation
VR-Schipkowski Jun 14, 2023
18c2f0d
fixing wrong transformation of transformation
VR-Schipkowski Jun 14, 2023
6ec6bee
Begin to work on protocol, adding a dummy cube for testing
VR-Schipkowski Jun 14, 2023
ca92a96
switching abstrackt functino
VR-Schipkowski Jun 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Using one pass textbook
VR-Schipkowski committed Oct 12, 2022
commit a9074ff93c644ba4744f13ef2801675bfbbe332c
61 changes: 29 additions & 32 deletions Devices/Arduino/HallSensor/HallSensor.ino
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

// Tlv493d Opject
Tle493d_w2b6 sensor = Tle493d_w2b6(Tle493d::MASTERCONTROLLEDMODE);
int sample_size= 30;
int sample_size= 500;
// Communication
#define INPUT_BUFFER_SIZE 3000
char input_buffer[INPUT_BUFFER_SIZE];
@@ -139,7 +139,8 @@ int getData(char*) {

// TODO perform measurement

int32_t mX=0,mY=0,mZ=0,sX=0,sY=0,sZ=0,x=0,y=0,z=0;
int32_t sumX=0,sumY=0,sumZ=0,sumXX=0,sumYY=0,sumZZ=0,x=0,y=0,z=0;
float varX=0, varY = 0, varZ=0, meanX =0, meanY =0, meanZ =0;
for (int i =0 ;i< sample_size ; i++){
sensor.updateData();
start = millis();
@@ -148,44 +149,40 @@ int getData(char*) {
y = sensor.getRawY();
z = sensor.getRawZ();

mX+=x;
mY+=y;
mZ+=z;

Serial.print(x);
Serial.print(",");
sumX+=x;
sumY+=y;
sumZ+=z;

sX += x*x;
sY += y*y;
sZ += z*z;
sumXX += x*x;
sumYY += y*y;
sumZZ += z*z;

end = millis();
if (end - start < measDelay) {
delay(measDelay-(end - start));
}
}


//sX -= mX*mX/sample_size;
sY -= mY*mY/sample_size;
sZ -= mZ*mZ/sample_size;

mX = mX/sample_size;
mY = mY/sample_size;
mZ = mZ/sample_size;

Serial.print(mX);
//Serial.print(",");
//Serial.print(mY);
//Serial.print(",");
//Serial.print(mZ);
meanX = (float)sumX/sample_size;
varX = (float) sumXX- (meanX*meanX)*sample_size;
varX = varX/(sample_size-1);
meanY = (float)sumY/sample_size;
varY = (float) sumYY- (meanY*meanY)*sample_size;
varY = varY/(sample_size-1);
meanZ = (float)sumX/sample_size;
varZ = (float) sumZZ- (meanZ*meanZ)*sample_size;
varZ = varZ/(sample_size-1);

Serial.print(meanX,7);
Serial.print(",");
Serial.print(meanY,7);
Serial.print(",");
Serial.print(meanZ,7);
Serial.print(",");
Serial.print(varX,7);
Serial.print(",");
Serial.print(varY,7);
Serial.print(",");
Serial.print(sX);
//Serial.print(",");
//Serial.print(sY);
//Serial.print(",");
//Serial.print(sZ);
//Serial.print(",");
Serial.print(varZ,7);
Serial.print("#");
Serial.flush();
}
2 changes: 1 addition & 1 deletion src/Devices/GaussMeter/ArduinoGaussMeter.jl
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ end

function getXYZValues(gauss::ArduinoGaussMeter)
data_strings = split(sendCommand(gauss.ard, "DATA"), ",")
data = [parse(Int16,str) for str in data_strings]
data = [parse(Float32,str) for str in data_strings]
return data
end

1 change: 1 addition & 0 deletions src/Devices/Utils/SerialDevices/SerialDevice.jl
Original file line number Diff line number Diff line change
@@ -178,6 +178,7 @@ function query(sd::SerialDevice,cmd)
sp_flush(sd.sp, SP_BUF_INPUT)
return out
finally
sp_flush(sd.sp, SP_BUF_INPUT)
unlock(sd.sdLock)
end
end