Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
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
Service Desk
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
Jonas Leder
marlin-anet-a8
Commits
aa65fe22
Commit
aa65fe22
authored
12 years ago
by
Erik van der Zalm
Browse files
Options
Downloads
Patches
Plain Diff
decoupled axes sucessfully at least on pure x or y jog
parent
b67dacdc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Marlin/Configuration.h
+7
-3
7 additions, 3 deletions
Marlin/Configuration.h
Marlin/stepper.cpp
+108
-22
108 additions, 22 deletions
Marlin/stepper.cpp
with
115 additions
and
25 deletions
Marlin/Configuration.h
+
7
−
3
View file @
aa65fe22
...
...
@@ -35,6 +35,10 @@
#define MOTHERBOARD 7
#endif
/// Comment out the following line to enable normal kinematics
#define COREXY
//===========================================================================
//=============================Thermal Settings ============================
//===========================================================================
...
...
@@ -168,7 +172,7 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
#define DISABLE_E false // For all extruders
#define INVERT_X_DIR true // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR
fals
e // for Mendel set to true, for Orca set to false
#define INVERT_Y_DIR
tru
e // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true // for Mendel set to false, for Orca set to true
#define INVERT_E0_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false // for direct drive extruder v9 set to true, for geared extruder set to false
...
...
@@ -180,8 +184,8 @@ const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of th
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1
#define min_software_endstops
tru
e //If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops
tru
e //If true, axis won't move to coordinates greater than the defined lengths below.
#define min_software_endstops
fals
e //If true, axis won't move to coordinates less than HOME_POS.
#define max_software_endstops
fals
e //If true, axis won't move to coordinates greater than the defined lengths below.
#define X_MAX_LENGTH 205
#define Y_MAX_LENGTH 205
#define Z_MAX_LENGTH 200
...
...
This diff is collapsed.
Click to expand it.
Marlin/stepper.cpp
+
108
−
22
View file @
aa65fe22
...
...
@@ -214,6 +214,12 @@ void st_wake_up() {
ENABLE_STEPPER_DRIVER_INTERRUPT
();
}
void
step_wait
(){
for
(
int8_t
i
=
0
;
i
<
6
;
i
++
){
}
}
FORCE_INLINE
unsigned
short
calc_timer
(
unsigned
short
step_rate
)
{
unsigned
short
timer
;
if
(
step_rate
>
MAX_STEP_FREQUENCY
)
step_rate
=
MAX_STEP_FREQUENCY
;
...
...
@@ -317,8 +323,10 @@ ISR(TIMER1_COMPA_vect)
out_bits
=
current_block
->
direction_bits
;
// Set direction en check limit switches
if
((
out_bits
&
(
1
<<
X_AXIS
))
!=
0
)
{
// -direction
WRITE
(
X_DIR_PIN
,
INVERT_X_DIR
);
if
((
out_bits
&
(
1
<<
X_AXIS
))
!=
0
)
{
// stepping along -X axis
#if !defined COREXY //NOT COREXY
WRITE
(
X_DIR_PIN
,
INVERT_X_DIR
);
#endif
count_direction
[
X_AXIS
]
=-
1
;
CHECK_ENDSTOPS
{
...
...
@@ -333,8 +341,11 @@ ISR(TIMER1_COMPA_vect)
#endif
}
}
else
{
// +direction
WRITE
(
X_DIR_PIN
,
!
INVERT_X_DIR
);
else
{
// +direction
#if !defined COREXY //NOT COREXY
WRITE
(
X_DIR_PIN
,
!
INVERT_X_DIR
);
#endif
count_direction
[
X_AXIS
]
=
1
;
CHECK_ENDSTOPS
{
...
...
@@ -351,7 +362,9 @@ ISR(TIMER1_COMPA_vect)
}
if
((
out_bits
&
(
1
<<
Y_AXIS
))
!=
0
)
{
// -direction
WRITE
(
Y_DIR_PIN
,
INVERT_Y_DIR
);
#if !defined COREXY //NOT COREXY
WRITE
(
Y_DIR_PIN
,
INVERT_Y_DIR
);
#endif
count_direction
[
Y_AXIS
]
=-
1
;
CHECK_ENDSTOPS
{
...
...
@@ -367,7 +380,9 @@ ISR(TIMER1_COMPA_vect)
}
}
else
{
// +direction
WRITE
(
Y_DIR_PIN
,
!
INVERT_Y_DIR
);
#if !defined COREXY //NOT COREXY
WRITE
(
Y_DIR_PIN
,
!
INVERT_Y_DIR
);
#endif
count_direction
[
Y_AXIS
]
=
1
;
CHECK_ENDSTOPS
{
...
...
@@ -382,7 +397,28 @@ ISR(TIMER1_COMPA_vect)
#endif
}
}
#ifdef COREXY //coreXY kinematics defined
if
((
current_block
->
steps_x
>=
current_block
->
steps_y
)
&&
((
out_bits
&
(
1
<<
X_AXIS
))
==
0
)){
//+X is major axis
WRITE
(
X_DIR_PIN
,
!
INVERT_X_DIR
);
WRITE
(
Y_DIR_PIN
,
!
INVERT_Y_DIR
);
}
if
((
current_block
->
steps_x
>=
current_block
->
steps_y
)
&&
((
out_bits
&
(
1
<<
X_AXIS
))
!=
0
)){
//-X is major axis
WRITE
(
X_DIR_PIN
,
INVERT_X_DIR
);
WRITE
(
Y_DIR_PIN
,
INVERT_Y_DIR
);
}
if
((
current_block
->
steps_y
>
current_block
->
steps_x
)
&&
((
out_bits
&
(
1
<<
Y_AXIS
))
==
0
)){
//+Y is major axis
WRITE
(
X_DIR_PIN
,
!
INVERT_X_DIR
);
WRITE
(
Y_DIR_PIN
,
INVERT_Y_DIR
);
}
if
((
current_block
->
steps_y
>
current_block
->
steps_x
)
&&
((
out_bits
&
(
1
<<
Y_AXIS
))
!=
0
)){
//-Y is major axis
WRITE
(
X_DIR_PIN
,
INVERT_X_DIR
);
WRITE
(
Y_DIR_PIN
,
!
INVERT_Y_DIR
);
}
#endif //coreXY
if
((
out_bits
&
(
1
<<
Z_AXIS
))
!=
0
)
{
// -direction
WRITE
(
Z_DIR_PIN
,
INVERT_Z_DIR
);
count_direction
[
Z_AXIS
]
=-
1
;
...
...
@@ -446,23 +482,73 @@ ISR(TIMER1_COMPA_vect)
}
}
#endif //ADVANCE
counter_x
+=
current_block
->
steps_x
;
if
(
counter_x
>
0
)
{
WRITE
(
X_STEP_PIN
,
HIGH
);
counter_x
-=
current_block
->
step_event_count
;
WRITE
(
X_STEP_PIN
,
LOW
);
count_position
[
X_AXIS
]
+=
count_direction
[
X_AXIS
];
}
counter_y
+=
current_block
->
steps_y
;
if
(
counter_y
>
0
)
{
WRITE
(
Y_STEP_PIN
,
HIGH
);
counter_y
-=
current_block
->
step_event_count
;
WRITE
(
Y_STEP_PIN
,
LOW
);
count_position
[
Y_AXIS
]
+=
count_direction
[
Y_AXIS
];
}
#if !defined COREXY
counter_x
+=
current_block
->
steps_x
;
if
(
counter_x
>
0
)
{
WRITE
(
X_STEP_PIN
,
HIGH
);
counter_x
-=
current_block
->
step_event_count
;
WRITE
(
X_STEP_PIN
,
LOW
);
count_position
[
X_AXIS
]
+=
count_direction
[
X_AXIS
];
}
counter_y
+=
current_block
->
steps_y
;
if
(
counter_y
>
0
)
{
WRITE
(
Y_STEP_PIN
,
HIGH
);
WRITE
(
Y_STEP_PIN
,
LOW
);
}
#endif
#ifdef COREXY
counter_x
+=
current_block
->
steps_x
;
counter_y
+=
current_block
->
steps_y
;
if
((
counter_x
>
0
)
&&!
(
counter_y
>
0
)){
//X step only
WRITE
(
X_STEP_PIN
,
HIGH
);
WRITE
(
Y_STEP_PIN
,
HIGH
);
counter_x
-=
current_block
->
step_event_count
;
WRITE
(
X_STEP_PIN
,
LOW
);
WRITE
(
Y_STEP_PIN
,
LOW
);
count_position
[
X_AXIS
]
+=
count_direction
[
X_AXIS
];
}
if
(
!
(
counter_x
>
0
)
&&
(
counter_y
>
0
)){
//Y step only
WRITE
(
X_STEP_PIN
,
HIGH
);
WRITE
(
Y_STEP_PIN
,
HIGH
);
counter_y
-=
current_block
->
step_event_count
;
WRITE
(
X_STEP_PIN
,
LOW
);
WRITE
(
Y_STEP_PIN
,
LOW
);
count_position
[
Y_AXIS
]
+=
count_direction
[
Y_AXIS
];
}
if
((
counter_x
>
0
)
&&
(
counter_y
>
0
)){
//step in both axes
if
(((
out_bits
&
(
1
<<
X_AXIS
))
==
0
)
^
((
out_bits
&
(
1
<<
Y_AXIS
))
==
0
)){
//X and Y in different directions
WRITE
(
Y_STEP_PIN
,
HIGH
);
counter_x
-=
current_block
->
step_event_count
;
WRITE
(
Y_STEP_PIN
,
LOW
);
step_wait
();
count_position
[
X_AXIS
]
+=
count_direction
[
X_AXIS
];
count_position
[
Y_AXIS
]
+=
count_direction
[
Y_AXIS
];
WRITE
(
Y_STEP_PIN
,
HIGH
);
counter_y
-=
current_block
->
step_event_count
;
WRITE
(
Y_STEP_PIN
,
LOW
);
}
else
{
//X and Y in same direction
WRITE
(
X_STEP_PIN
,
HIGH
);
counter_x
-=
current_block
->
step_event_count
;
WRITE
(
X_STEP_PIN
,
LOW
)
;
step_wait
();
count_position
[
X_AXIS
]
+=
count_direction
[
X_AXIS
];
count_position
[
Y_AXIS
]
+=
count_direction
[
Y_AXIS
];
WRITE
(
X_STEP_PIN
,
HIGH
);
counter_y
-=
current_block
->
step_event_count
;
WRITE
(
X_STEP_PIN
,
LOW
);
}
}
#endif //corexy
counter_z
+=
current_block
->
steps_z
;
if
(
counter_z
>
0
)
{
WRITE
(
Z_STEP_PIN
,
HIGH
);
...
...
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