kopia lustrzana https://github.com/Schildkroet/GRBL-Advanced
Added hard reset; Backlash bug fixes
rodzic
242137a130
commit
f22724e2e0
|
@ -297,6 +297,7 @@ void USART2_IRQHandler(void)
|
|||
switch(c)
|
||||
{
|
||||
case CMD_RESET: MC_Reset(); break; // Call motion control reset routine.
|
||||
case CMD_RESET_HARD: NVIC_SystemReset(); // Perform hard reset
|
||||
case CMD_STATUS_REPORT: System_SetExecStateFlag(EXEC_STATUS_REPORT);break;
|
||||
case CMD_CYCLE_START: System_SetExecStateFlag(EXEC_CYCLE_START); break; // Set as true
|
||||
case CMD_FEED_HOLD: System_SetExecStateFlag(EXEC_FEED_HOLD); break; // Set as true
|
||||
|
|
|
@ -11,6 +11,7 @@ Grbl-Advanced includes full acceleration management with look ahead. That means
|
|||
|
||||
***
|
||||
|
||||
### Extras:
|
||||
#### Backlash Compensation:
|
||||
Backlash compensation enabled by default. You can switch it off in Config.h.
|
||||
Edit defaults.h to your needs.
|
||||
|
@ -22,6 +23,10 @@ Edit defaults.h to your needs.
|
|||
#### Canned Drill Cycles (G81-G83):
|
||||
Added Canned Drill Cycles G81-G83 as experimental features. They are roughly tested and seem to work, but may contain still errors. Use at own risk!
|
||||
|
||||
#### Hard Reset
|
||||
0x19 (CTRL-Y): Perform a hard reset.
|
||||
|
||||
***
|
||||
|
||||
### Build Environment:
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
// g-code programs, maybe selected for interface programs.
|
||||
// NOTE: If changed, manually update help message in report.c.
|
||||
#define CMD_RESET 0x18 // ctrl-x.
|
||||
#define CMD_RESET_HARD 0x19 // ctrl-y.
|
||||
#define CMD_STATUS_REPORT '?'
|
||||
#define CMD_CYCLE_START '~'
|
||||
#define CMD_FEED_HOLD '!'
|
||||
|
|
|
@ -45,13 +45,19 @@ static uint8_t dir_negative[N_AXIS] = {DIR_NEGATIV};
|
|||
|
||||
void MC_Init(void)
|
||||
{
|
||||
int32_t current_position[N_AXIS] = {0};
|
||||
|
||||
for(uint8_t i = 0; i < N_AXIS; i++)
|
||||
{
|
||||
dir_negative[i] = DIR_NEGATIV ^ (settings.homing_dir_mask & (1<<i));
|
||||
}
|
||||
|
||||
MC_SyncBacklashPosition();
|
||||
}
|
||||
|
||||
|
||||
void MC_SyncBacklashPosition(void)
|
||||
{
|
||||
int32_t current_position[N_AXIS] = {0};
|
||||
|
||||
// Copy current state of the system position variable
|
||||
memcpy(current_position, sys_position, sizeof(sys_position));
|
||||
|
||||
|
@ -465,6 +471,7 @@ uint8_t MC_ProbeCycle(float *target, Planner_LineData_t *pl_data, uint8_t parser
|
|||
Stepper_Reset(); // Reset step segment buffer.
|
||||
Planner_Reset(); // Reset planner buffer. Zero planner positions. Ensure probing motion is cleared.
|
||||
Planner_SyncPosition(); // Sync planner position to current machine position.
|
||||
MC_SyncBacklashPosition();
|
||||
|
||||
#ifdef MESSAGE_PROBE_COORDINATES
|
||||
// All done! Output the probe position as message.
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
|
||||
void MC_Init(void);
|
||||
|
||||
void MC_SyncBacklashPosition(void);
|
||||
|
||||
|
||||
// Execute linear motion in absolute millimeter coordinates. Feed rate given in millimeters/second
|
||||
// unless invert_feed_rate is true. Then the feed_rate means that the motion should be completed in
|
||||
|
|
|
@ -237,6 +237,9 @@ void Stepper_WakeUp(void)
|
|||
GPIO_ResetBits(GPIO_ENABLE_PORT, GPIO_ENABLE_PIN);
|
||||
}
|
||||
|
||||
// Give steppers some time to wake up
|
||||
Delay_ms(10);
|
||||
|
||||
// Initialize stepper output bits to ensure first ISR call does not step.
|
||||
//st.step_outbits = step_port_invert_mask;
|
||||
st.step_outbits = 0;
|
||||
|
|
Ładowanie…
Reference in New Issue