Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
2e0f61c2
Commit
2e0f61c2
authored
May 08, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ADVANCED_LPC
parent
17f9b771
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
38 deletions
+18
-38
Configuration_Feature.h
MK/Configuration_Feature.h
+0
-23
stepper.cpp
MK/module/motion/stepper.cpp
+18
-15
No files found.
MK/Configuration_Feature.h
View file @
2e0f61c2
...
@@ -50,7 +50,6 @@
...
@@ -50,7 +50,6 @@
* - Filament diameter sensor
* - Filament diameter sensor
* - Filament Runout sensor
* - Filament Runout sensor
* - Power consumption sensor
* - Power consumption sensor
* - RFID card sensor
* ADDON FEATURES:
* ADDON FEATURES:
* - EEPROM
* - EEPROM
* - SDCARD
* - SDCARD
...
@@ -1048,28 +1047,6 @@
...
@@ -1048,28 +1047,6 @@
/**************************************************************************
*********************** RIFD module card reader **************************
**************************************************************************
* *
* Support RFID module card reader width UART interface. *
* This module mount chip MFRC522 designed to communicate with *
* ISO/IEC 14443 A/MIFARE cards and transponders without additional *
* active circuitry *
* *
* New command for this system is: *
* M522 T<extruder> R<read> or W<write> *
* *
* Define if you used and Serial used. *
* *
**************************************************************************/
//#define RFID_MODULE
#define RFID_SERIAL 1
/**************************************************************************/
//===========================================================================
//===========================================================================
//============================= ADDON FEATURES ==============================
//============================= ADDON FEATURES ==============================
//===========================================================================
//===========================================================================
...
...
MK/module/motion/stepper.cpp
View file @
2e0f61c2
...
@@ -89,6 +89,7 @@ volatile long endstops_stepsTotal, endstops_stepsDone;
...
@@ -89,6 +89,7 @@ volatile long endstops_stepsTotal, endstops_stepsDone;
#elif ENABLED(ADVANCE_LPC)
#elif ENABLED(ADVANCE_LPC)
int
extruder_advance_k
=
ADVANCE_LPC_K
;
int
extruder_advance_k
=
ADVANCE_LPC_K
;
volatile
int
e_steps
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
0
);
volatile
int
e_steps
[
EXTRUDERS
]
=
ARRAY_BY_EXTRUDERS
(
0
);
volatile
unsigned
char
eISR_Rate
=
200
;
// Keep the ISR at a low rate until needed
static
int
final_estep_rate
;
static
int
final_estep_rate
;
static
int
current_estep_rate
[
EXTRUDERS
];
// Actual extruder speed [steps/s]
static
int
current_estep_rate
[
EXTRUDERS
];
// Actual extruder speed [steps/s]
static
int
current_adv_steps
[
EXTRUDERS
];
static
int
current_adv_steps
[
EXTRUDERS
];
...
@@ -559,9 +560,14 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -559,9 +560,14 @@ ISR(TIMER1_COMPA_vect) {
step_events_completed
++
;
step_events_completed
++
;
if
(
step_events_completed
>=
current_block
->
step_event_count
)
break
;
if
(
step_events_completed
>=
current_block
->
step_event_count
)
break
;
}
}
#if ENABLED(ADVANCE_LPC)
// If we have esteps to execute, fire the next ISR "now"
if
(
e_steps
[
current_block
->
active_driver
])
OCR0A
=
TCNT0
+
2
;
#endif
// Calculate new timer value
// Calculate new timer value
unsigned
short
timer
;
unsigned
short
timer
,
step_rate
;
unsigned
short
step_rate
;
if
(
step_events_completed
<=
(
unsigned
long
)
current_block
->
accelerate_until
)
{
if
(
step_events_completed
<=
(
unsigned
long
)
current_block
->
accelerate_until
)
{
MultiU24X32toH16
(
acc_step_rate
,
acceleration_time
,
current_block
->
acceleration_rate
);
MultiU24X32toH16
(
acc_step_rate
,
acceleration_time
,
current_block
->
acceleration_rate
);
...
@@ -595,6 +601,9 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -595,6 +601,9 @@ ISR(TIMER1_COMPA_vect) {
current_estep_rate
[
current_block
->
active_driver
]
=
((
unsigned
long
)
acc_step_rate
*
current_block
->
e_speed_multiplier8
)
>>
8
;
current_estep_rate
[
current_block
->
active_driver
]
=
((
unsigned
long
)
acc_step_rate
*
current_block
->
e_speed_multiplier8
)
>>
8
;
#endif
#endif
#if ENABLED(ADVANCE) || ENABLED(ADVANCE_LPC)
eISR_Rate
=
(
timer
>>
2
)
/
e_steps
[
current_block
->
active_driver
];
#endif
}
}
else
if
(
step_events_completed
>
(
unsigned
long
)
current_block
->
decelerate_after
)
{
else
if
(
step_events_completed
>
(
unsigned
long
)
current_block
->
decelerate_after
)
{
MultiU24X32toH16
(
step_rate
,
deceleration_time
,
current_block
->
acceleration_rate
);
MultiU24X32toH16
(
step_rate
,
deceleration_time
,
current_block
->
acceleration_rate
);
...
@@ -632,12 +641,18 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -632,12 +641,18 @@ ISR(TIMER1_COMPA_vect) {
if
(
current_block
->
use_advance_lead
)
if
(
current_block
->
use_advance_lead
)
current_estep_rate
[
current_block
->
active_driver
]
=
((
unsigned
long
)
step_rate
*
current_block
->
e_speed_multiplier8
)
>>
8
;
current_estep_rate
[
current_block
->
active_driver
]
=
((
unsigned
long
)
step_rate
*
current_block
->
e_speed_multiplier8
)
>>
8
;
#endif
#endif
#if ENABLED(ADVANCE) || ENABLED(ADVANCE_LPC)
eISR_Rate
=
(
timer
>>
2
)
/
e_steps
[
current_block
->
active_driver
];
#endif
}
}
else
{
else
{
#if ENABLED(ADVANCE_LPC)
#if ENABLED(ADVANCE_LPC)
if
(
current_block
->
use_advance_lead
)
if
(
current_block
->
use_advance_lead
)
current_estep_rate
[
current_block
->
active_driver
]
=
final_estep_rate
;
current_estep_rate
[
current_block
->
active_driver
]
=
final_estep_rate
;
eISR_Rate
=
(
OCR1A_nominal
>>
2
)
/
e_steps
[
current_block
->
active_driver
];
#endif
#endif
OCR1A
=
OCR1A_nominal
;
OCR1A
=
OCR1A_nominal
;
// ensure we're running at the correct step rate, even if we just came off an acceleration
// ensure we're running at the correct step rate, even if we just came off an acceleration
step_loops
=
step_loops_nominal
;
step_loops
=
step_loops_nominal
;
...
@@ -659,19 +674,7 @@ ISR(TIMER1_COMPA_vect) {
...
@@ -659,19 +674,7 @@ ISR(TIMER1_COMPA_vect) {
// Timer 0 is shared with millies
// Timer 0 is shared with millies
ISR
(
TIMER0_COMPA_vect
)
{
ISR
(
TIMER0_COMPA_vect
)
{
byte
maxesteps
=
0
;
old_OCR0A
+=
eISR_Rate
;
for
(
unsigned
char
i
=
0
;
i
<
EXTRUDERS
;
i
++
)
if
(
abs
(
e_steps
[
i
])
>
maxesteps
)
maxesteps
=
abs
(
e_steps
[
i
]);
if
(
maxesteps
>
3
)
old_OCR0A
+=
13
;
// ~19kHz (250000/13 = 19230 Hz)
else
if
(
maxesteps
>
2
)
old_OCR0A
+=
17
;
// ~15kHz (250000/17 = 14705 Hz)
else
if
(
maxesteps
>
1
)
old_OCR0A
+=
26
;
// ~10kHz (250000/26 = 9615 Hz)
else
old_OCR0A
+=
52
;
// ~5kHz (250000/52 = 4807 Hz)
OCR0A
=
old_OCR0A
;
OCR0A
=
old_OCR0A
;
#define STEP_E_ONCE(INDEX) \
#define STEP_E_ONCE(INDEX) \
...
...
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