Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
RepRapFirmware SD
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
RepRapFirmware SD
Commits
ceab9455
Commit
ceab9455
authored
3 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Calibration changes
parent
3dfd829c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
rrf3.x/sys/config.g
+4
-4
4 additions, 4 deletions
rrf3.x/sys/config.g
rrf3.x/sys/home_positions
+4
-4
4 additions, 4 deletions
rrf3.x/sys/home_positions
rrf3.x/sys/make_pre_post_free_edit_config.py
+59
-16
59 additions, 16 deletions
rrf3.x/sys/make_pre_post_free_edit_config.py
with
67 additions
and
24 deletions
rrf3.x/sys/config.g
+
4
−
4
View file @
ceab9455
...
...
@@ -122,10 +122,10 @@ M593 F42.2 ; cancel ringing at 42.2Hz (https://forum.e3d-online.com/threads
; Volcano-tool: X-9 Y39 Z-13.5
; Hemera-tool: X20 Y43.5 Z-6
G10 P0 X25 Y43.5 Z-6
; T0
G10 P1 X25 Y43.
5
Z-
6
; T1
G10 P2 X25 Y43.5 Z-6
; T2
G10 P3 X25 Y43.5 Z-
6
; T3
G10 P0 X25
.00
Y43.5
0
Z-6
.00
; T0
G10 P1 X25
.60
Y43.
80
Z-
5.85
; T1
G10 P2 X25
.55
Y43.
6
5 Z-6
.25
; T2
G10 P3 X25
.50
Y43.
7
5 Z-
5.90
; T3
;M572 D0 S0.2 ; pressure advance T0
;M572 D1 S0.2 ; pressure advance T1
...
...
This diff is collapsed.
Click to expand it.
rrf3.x/sys/home_positions
+
4
−
4
View file @
ceab9455
0: X -12.2 Y 227.4
1: X 77.8 Y 227.4
2: X 211.8 Y 226.9
3: X 301.8 Y 227.4
0: X -12.2 Y 227.4
dX 0.0 dY 0.0 dZ 0
1: X 77.8 Y 227.4
dX 0.6 dY 0.3 dZ 0.15
2: X 211.8 Y 226.9
dX 0.55 dY 0.15 dZ -0.25
3: X 301.8 Y 227.4
dX 0.5 dY 0.25 dZ 0.10
This diff is collapsed.
Click to expand it.
rrf3.x/sys/make_pre_post_free.py
→
rrf3.x/sys/make_pre_post_free
_edit_config
.py
+
59
−
16
View file @
ceab9455
...
...
@@ -68,31 +68,50 @@ M106 P%(fan)d S0
G53 G1 X%(x_final)0.1f Y%(y_safe)0.1f F20000 ; X location at safe Y distance
"""
class
Home
:
class
Tool
:
def
__init__
(
self
,
line
):
m
=
re
.
match
(
'
^([0-9]+)\s*:\s*X\s*([-0-9.]+)\s*Y\s*([-0-9.]+)\s*$
'
,
line
)
m
=
re
.
match
(
'
^([0-9]+)\s*:\s*([^;]*)(?:;.*)?$
'
,
line
)
if
m
:
self
.
tool
=
int
(
m
.
group
(
1
))
self
.
x
=
float
(
m
.
group
(
2
))
self
.
y
=
float
(
m
.
group
(
3
))
self
.
index
=
int
(
m
.
group
(
1
))
values
=
re
.
findall
(
'
([A-Za-z]+)\s*([-+0-9.]+)
'
,
m
.
group
(
2
))
self
.
values
=
{
k
:
float
(
v
)
for
k
,
v
in
values
}
self
.
values
.
update
({
k
.
lower
():
float
(
v
)
for
k
,
v
in
values
})
pass
def
__getattr__
(
self
,
key
):
return
self
.
values
[
key
]
def
__repr__
(
self
):
return
'
Tool(%d, %f, %f)
'
%
(
self
.
index
,
self
.
x
,
self
.
y
)
class
ToolOffset
:
def
__init__
(
self
,
line
):
m
=
re
.
match
(
'
^G10\s*P([0-9]+)\s*([^;]*)(?:;.*)?$
'
,
line
)
if
m
:
self
.
index
=
int
(
m
.
group
(
1
))
values
=
re
.
findall
(
'
([A-Za-z]+)\s*([-+0-9.]+)
'
,
m
.
group
(
2
))
self
.
values
=
{
k
.
lower
():
float
(
v
)
for
k
,
v
in
values
}
pass
def
__getattr__
(
self
,
key
):
return
self
.
values
[
key
]
def
__repr__
(
self
):
return
'
Home
(%d, %f, %f)
'
%
(
self
.
tool
,
self
.
x
,
self
.
y
)
return
'
Tool
(%d, %f, %f)
'
%
(
self
.
index
,
self
.
x
,
self
.
y
)
if
__name__
==
'
__main__
'
:
home
=
{}
for
h
in
[
Home
(
l
)
for
l
in
open
(
'
home_positions
'
)]:
home
[
h
.
tool
]
=
h
tool
=
{}
for
t
in
[
Tool
(
l
)
for
l
in
open
(
'
home_positions
'
)]:
tool
[
t
.
index
]
=
t
pass
for
i
in
range
(
3
):
# Expected if all tools the same:
# 90.0 0.0
# 135.0 0.0
# 90.0 0.0
print
(
home
[
i
+
1
].
x
-
home
[
i
].
x
,
home
[
i
+
1
].
y
-
home
[
i
].
y
)
print
(
tool
[
i
+
1
].
x
-
tool
[
i
].
x
,
tool
[
i
+
1
].
y
-
tool
[
i
].
y
)
pass
for
i
in
range
(
4
):
for
path
,
template
in
((
'
tpre%d.g
'
%
i
,
PRE
),
...
...
@@ -105,14 +124,38 @@ if __name__ == '__main__':
filename
=
os
.
path
.
basename
(
path
),
tool
=
i
,
fan
=
2
+
i
*
2
,
x_final
=
home
[
i
].
x
,
y_final
=
home
[
i
].
y
,
y_safe
=
home
[
i
].
y
-
50
,
y_near
=
home
[
i
].
y
-
15
,
y_work
=
home
[
i
].
y
-
75
x_final
=
tool
[
i
].
x
,
y_final
=
tool
[
i
].
y
,
y_safe
=
tool
[
i
].
y
-
50
,
y_near
=
tool
[
i
].
y
-
15
,
y_work
=
tool
[
i
].
y
-
75
),
file
=
f
)
pass
pass
pass
with
open
(
'
config.g
'
)
as
f
:
config
=
''
tool_offsets
=
False
for
l
in
f
:
tool_offsets
|=
l
.
startswith
(
'
;tool offsets
'
)
if
tool_offsets
and
l
.
startswith
(
'
G10
'
):
o
=
ToolOffset
(
l
)
if
o
.
index
==
0
:
tool0
=
o
pass
l
=
'
G10 P%d X%0.2f Y%0.2f Z%0.2f
\t\t\t\t
; T%d
\n
'
%
(
o
.
index
,
tool0
.
x
+
tool
[
o
.
index
].
dx
,
tool0
.
y
+
tool
[
o
.
index
].
dy
,
tool0
.
z
+
tool
[
o
.
index
].
dz
,
o
.
index
)
pass
config
+=
l
pass
pass
with
open
(
'
config.g
'
,
'
w
'
)
as
f
:
f
.
write
(
config
)
pass
pass
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment