Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
999f41dd
Commit
999f41dd
authored
Sep 18, 2014
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugging adjustment of motors
parent
81b73514
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
FocusingField.java
src/main/java/FocusingField.java
+19
-5
No files found.
src/main/java/FocusingField.java
View file @
999f41dd
...
@@ -4906,15 +4906,16 @@ public boolean LevenbergMarquardt(
...
@@ -4906,15 +4906,16 @@ public boolean LevenbergMarquardt(
// }
// }
if
(
this
.
debugLevel
>
0
){
if
(
this
.
debugLevel
>
0
){
System
.
out
.
println
(
"Current linearized motor positions
:"
);
System
.
out
.
println
(
"Current linearized motor positions
, center="
+(
0.25
*
zm
[
0
]+
0.25
*
zm
[
1
]+
0.5
*
zm
[
2
])
);
for
(
int
i
=
0
;
i
<
zm
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
zm
.
length
;
i
++)
{
System
.
out
.
println
(
i
+
": "
+
zm
[
i
]+
" um"
);
System
.
out
.
println
(
i
+
": "
+
zm
[
i
]+
" um"
);
}
}
System
.
out
.
println
(
"Checking back to motor positions:"
);
double
[]
rzm
=
new
double
[
3
];
double
[]
rzm
=
new
double
[
3
];
for
(
int
i
=
0
;
i
<
zm
.
length
;
i
++)
zm
[
i
]=
fieldFitting
.
mechanicalFocusingModel
.
zmToM
(
zm
[
i
],
i
);
for
(
int
i
=
0
;
i
<
zm
.
length
;
i
++)
rzm
[
i
]=
fieldFitting
.
mechanicalFocusingModel
.
zmToM
(
zm
[
i
],
i
);
System
.
out
.
println
(
"Checking back to motor positions, center="
+(
0.25
*
rzm
[
0
]+
0.25
*
rzm
[
1
]+
0.5
*
rzm
[
2
])+
"steps (current="
+(
0.25
*
measurement
.
motors
[
0
]+
0.25
*
measurement
.
motors
[
1
]+
0.5
*
measurement
.
motors
[
2
])+
" steps)"
);
for
(
int
i
=
0
;
i
<
zm
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
zm
.
length
;
i
++)
{
System
.
out
.
println
(
i
+
": "
+
rzm
[
i
]+
"
um (was "
+
measurement
.
motors
[
i
]
);
System
.
out
.
println
(
i
+
": "
+
rzm
[
i
]+
"
steps (was "
+
measurement
.
motors
[
i
]+
" steps)"
);
}
}
}
}
double
[]
dm
=
getAdjustedMotors
(
double
[]
dm
=
getAdjustedMotors
(
...
@@ -4968,6 +4969,13 @@ public boolean LevenbergMarquardt(
...
@@ -4968,6 +4969,13 @@ public boolean LevenbergMarquardt(
targetTiltY
);
targetTiltY
);
if
(
zM
==
null
)
return
null
;
// not yet used
if
(
zM
==
null
)
return
null
;
// not yet used
if
(!
motorSteps
)
return
zM
;
if
(!
motorSteps
)
return
zM
;
if
(
debugLevel
>
0
){
System
.
out
.
println
(
"getAdjustedMotors(): Suggested linearized motor positions, center="
+(
0.25
*
zM
[
0
]+
0.25
*
zM
[
1
]+
0.5
*
zM
[
2
]));
for
(
int
i
=
0
;
i
<
zM
.
length
;
i
++)
{
System
.
out
.
println
(
i
+
": "
+
zM
[
i
]+
" um"
);
}
}
// if (debugLevel>0) System.out.println("Suggested motor linearized positions: "+IJ.d2s(zM[0],2)+":"+IJ.d2s(zM[1],2)+":"+IJ.d2s(zM[2],2));
// if (debugLevel>0) System.out.println("Suggested motor linearized positions: "+IJ.d2s(zM[0],2)+":"+IJ.d2s(zM[1],2)+":"+IJ.d2s(zM[2],2));
double
[]
dm
=
new
double
[
zM
.
length
];
double
[]
dm
=
new
double
[
zM
.
length
];
for
(
int
index
=
0
;
index
<
dm
.
length
;
index
++){
for
(
int
index
=
0
;
index
<
dm
.
length
;
index
++){
...
@@ -4975,6 +4983,12 @@ public boolean LevenbergMarquardt(
...
@@ -4975,6 +4983,12 @@ public boolean LevenbergMarquardt(
zM
[
index
],
zM
[
index
],
index
);
index
);
}
}
if
(
debugLevel
>
0
){
System
.
out
.
println
(
"getAdjustedMotors(): Suggested motor positions, center="
+(
0.25
*
dm
[
0
]+
0.25
*
dm
[
1
]+
0.5
*
dm
[
2
]));
for
(
int
i
=
0
;
i
<
dm
.
length
;
i
++)
{
System
.
out
.
println
(
i
+
": "
+
dm
[
i
]+
" steps"
);
}
}
return
dm
;
return
dm
;
}
}
...
@@ -7216,7 +7230,7 @@ public boolean LevenbergMarquardt(
...
@@ -7216,7 +7230,7 @@ public boolean LevenbergMarquardt(
break
;
break
;
}
}
m
=
zm
/
kM
;
// without thread sin/cos
m
=
zm
/
kM
;
// without thread sin/cos
double
eps
=
0.1
;
double
eps
=
0.
00000
1
;
int
maxRetries
=
100
;
int
maxRetries
=
100
;
// aM=(m + getValue(MECH_PAR.sM3)*p2pi*Math.sin(m/p2pi) + getValue(MECH_PAR.cM3)*p2pi*Math.cos(m/p2pi));
// aM=(m + getValue(MECH_PAR.sM3)*p2pi*Math.sin(m/p2pi) + getValue(MECH_PAR.cM3)*p2pi*Math.cos(m/p2pi));
// double dzM1_dm1=kM1*(1.0+getValue(MECH_PAR.sM1)*Math.cos(m1/p2pi)-getValue(MECH_PAR.cM1)*Math.sin(m1/p2pi));
// double dzM1_dm1=kM1*(1.0+getValue(MECH_PAR.sM1)*Math.cos(m1/p2pi)-getValue(MECH_PAR.cM1)*Math.sin(m1/p2pi));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment