346 Commits (2af62a5d8df132a241cb112d59930724f05fb110)

Author SHA1 Message Date
Sebastianv650 50059690e0 Allow UART ISRs inside the stepper ISR
If the stepper ISR takes too long, chars are lost which leads to serial
communication errors like "Line number not +1" or "Wrong checksum". In
worst case, the printer can even do crazy moves.

With this changes, UART interrupts are handled inside the stepper ISR.
This way, no chars should be lost.
8 years ago
AnHardt 88b38eafd8 Endstop interrupt refinement
At the start of a move, check if the endstops are already triggered.
The 'change' interrupts will not see a change if already triggered.
8 years ago
Scott Lahteine eb120e518c Followup to new endstop interrupts feature
- Fix typos, verbiage
- Fix naming of `setup_endstop_interrupts`
- Some formatting, indentation, spacing
8 years ago
Scott Lahteine 98600e1433 Minor stepper cleanup 8 years ago
AnHardt f3eee02596 Introduce endstop interrupts
If ENDSTOP_INTERRUPTS_FEATURE is enabled this tries to set up interrupt routines
for all used endstop pins. If this worked without errors, `endstops.update()` is called
only if one of the endstops changed its state.

The new interrupt routines do not really check the endstops and react upon them. All what they
do, is to set a flag if it makes sense to call the endstop test we are used to.

This can be used on:
* ARM (DUE) based boards - all pins can raise interrupts,
* RAMPS - all 6 endstop pins plus some other on EXT-2 can raise interrupts,
* RAMPS based boards - as long the designers did not change the pins for the endstops or at least left enough,
* all boards, if there are enough pins that can raise interrupts, and you are willing/able to swap with pins dedicated to other purpose.
8 years ago
Sebastianv650 cdc18f8c22 Remove useless line from stepper ISR
The flag is already set inside planner.get_current_block(). Doing it
twice isn't making it better..
8 years ago
Scott Lahteine 1864b282c5 Implement reversed CORE options 8 years ago
Scott Lahteine 00662b8635 Minor babystep cleanup patches 8 years ago
Scott Lahteine b23d255491 Move macros above Stepper::babystep 8 years ago
Scott Lahteine cc57d46158 Fix set_position for CoreYZ 8 years ago
Sebastianv650 f9bea7968f BugFix for incorrect E-speed calculation
The extrusion speed was wrong due to a not high enough precision of
esteps to XY steps, therefore now the target float values are used to
calculate the ratio between XY movement and extrusion speed.
The e_speed_multiplier8 was replaced by an absolute multiplier called
abs_adv_steps_multiplier8, therefore one multiplication and bitshift can
be saved inside the stepper ISR. Due to this, also extruder_advance_k is
better suited inside the planner and not the stepper files any more.
8 years ago
Scott Lahteine 43df9ace4e Merge pull request #5110 from thinkyhead/rc_z2_min_allowed
Support Z2 min in M119 report
8 years ago
Scott Lahteine 75dbb71dd7 Replace block.busy with a block.flag bit 8 years ago
Scott Lahteine 8cebd2a7db Arrange Z2 min before Z2 max 8 years ago
Scott Lahteine 083d41a2c2 Remove redundant estep rate code from LIN_ADVANCE
As noted by https://github.com/MarlinFirmware/Marlin/pull/4971#issuecomment-252503295
8 years ago
Scott Lahteine 2cb5df8a56 Merge pull request #4984 from esenapaj/Small-fix-for-PR-#4980
Small fix for the PR #4980 (LIN_ADVANCE bug fix and optimization)
8 years ago
Scott Lahteine f8199b2cc1 Merge pull request #4982 from thinkyhead/rc_abl_bugfix
Fix planner with kinematics, delta ABL
8 years ago
esenapaj cfb5c24bc9 Small fix for the PR #4980 (LIN_ADVANCE bug fix and optimization)
・Fix a comment about timer
8 years ago
Scott Lahteine c5cac486f5 Use a, b, c instead of lx, ly, lz 8 years ago
Scott Lahteine 3752d9aca8 Fix timer comments 8 years ago
Sebastianv650 a448cedbc5 LIN_ADVANCE bug fix and optimization
.) long to int: Extruder stalls at 10kHz / 20kHz step limits with long.
.) Take the delta_adv_steps calculation out of the step_loops loop. Wasted calculation performance if done inside.
.) >> 2 replaced by 3: Is divide by 8. Reason: Timer 0 runs at 16/8=2MHz, Timer 1 at 16/64=0.25MHz. ==> 2/0.25=8.
8 years ago
esenapaj f8df88f271 Move routine of direction signal of ADVANCE and LIN_ADVANCE from Stepper::isr() to Stepper::advance_isr() 8 years ago
Scott Lahteine ecf7cdde65 Augment planner/stepper getters/setters 8 years ago
Scott Lahteine 5fff8d148b Clean up digital pots and microsteps 8 years ago
Scott Lahteine cb48292338 Use fastio for literal pins 8 years ago
Scott Lahteine eabff30e75 Improve MINIMUM_STEPPER_PULSE 8 years ago
Scott Lahteine cc639d7d9c Less indentation in Stepper::isr 8 years ago
Scott Lahteine 7dec8071b2 Always synchronize in Stepper::set_position 8 years ago
esenapaj 954563d603 Adjust spacing 8 years ago
esenapaj 7e9576dc5b Extend the e_steps[] from int to long for allowing more than 32,767 E steps
Probably needed for long straight lines when using high microstepping
8 years ago
esenapaj b04ed8f9c3 Fix inverted stepper signal of ADVANCED and LIN_ADVANCED 8 years ago
esenapaj 8692748ecd Fix broken direction signal of ADVANCED and LIN_ADVANCED
Remove a setting proccess of E direction in advance_isr()
8 years ago
Scott Lahteine edfaf1c582 Stepper::report_positions patch 8 years ago
Scott Lahteine 6f71bd7372 Merge pull request #4754 from thinkyhead/rc_mixing_regression
Unify counter_m and counter_M
8 years ago
Scott Lahteine 9bf78ef465 Fix capitalization of counter_m 8 years ago
Scott Lahteine 42b5616327 Try bool for direction instead of long 8 years ago
Scott Lahteine d07a913f21 Tweak to stepper advance e_steps update 8 years ago
Scott Lahteine 426f662586 Apply MINIMUM_STEPPER_PULSE in stepper advance_isr 8 years ago
Scott Lahteine 8c7ee4599e Optimize stepper advance_isr 8 years ago
Scott Lahteine 9725bcd099 Minor "optimizations" in stepper ISR 8 years ago
Scott Lahteine 4ec3d1ea58 Add some commentary to stepper ISR 8 years ago
Scott Lahteine d9bcc7bb45 Set a bool when a stepper block is done 8 years ago
Scott Lahteine 08f717e5f7 Use bit-size typedefs for some stepper vars 8 years ago
Scott Lahteine 759234af60 MINIMUM_STEPPER_PULSE option 8 years ago
Scott Lahteine a28e15399f Patch stepper.cpp to allow omitting steppers 8 years ago
Scott Lahteine 2f223b8c79 Use ABC and XYZ for "3" 8 years ago
Scott Lahteine d8f2876753 Replace some float division with multiplication 8 years ago
Scott Lahteine f8b5749235 Replace division in planner with multiplication 8 years ago
Scott Lahteine 176b9627c7 Some cleanup ahead of BLTOUCH support 8 years ago
Scott Lahteine 05da02f0a2 Implement MIXING_EXTRUDER and SWITCHING_EXTRUDER 8 years ago
Scott Lahteine 4b4a582c4f X_DUAL_STEPPER_DRIVERS implementation 8 years ago
Scott Lahteine bd491818d6 Reduce storage requirements for strings, make some PGM 9 years ago
Scott Lahteine 61f34eec03 Merge pull request #4125 from jbrazio/bugfix/planner-warning
Fixes some compiler warnings
9 years ago
João Brázio 664232140d
Fixes somes compiler warnings 9 years ago
Sebastianv650 0c5192b288 Patch LIN_ADVANCE timing issue
Also the extruder stepper ISR has to keep an eye on step_loops count.
9 years ago
Scott Lahteine 8d8180e028 Parse M905 args in Marlin_main.cpp 9 years ago
Scott Lahteine 2b340f5acb patch LIN_ADVANCE to use code_value_float 9 years ago
Scott Lahteine aad9c0ed8d Apply updated ISR timing code 9 years ago
Scott Lahteine 506d78b2f8 Run the advance_isr faster instead of doing multiple e-steps per interrupt 9 years ago
Scott Lahteine 6d62a4ffc8 Patch LIN_ADVANCE for style and forward-compatibility 9 years ago
Sebastianv650 fb8e880734 Add LIN_ADVANCE 9 years ago
Scott Lahteine 72c6f2923f axis_steps_per_unit => axis_steps_per_mm 9 years ago
Scott Lahteine e2a8961635 Use e_steps[EXTRUDERS] instead of e_steps[4] 9 years ago
Scott Lahteine 668d50f68e Keep Stepper encapsulation, use static data and methods 9 years ago
Scott Lahteine 5172d4ba40 COREYZ stepper, planner, endstop, babysteps 9 years ago
Scott Lahteine 07c9a11c3c Automatically set X2 stepper pins 9 years ago
Scott Lahteine 15fc93d742 Cleanup and consolidate probe conditionals for clarity 9 years ago
Scott Lahteine 6398d497b3 Ultimate followup to Stepper/Planner patch
- Search all symbols and apply prefixes where needed
- Encapsulate some private methods
- Inline some setters
- Make `microstep_mode` a public method
9 years ago
Scott Lahteine 96f51f400f Planner singleton class 9 years ago
Scott Lahteine 5e4e535ce8 Stepper and Endstops as singleton objects 9 years ago
João Brázio bcf1e027bb
Fix the redeclaration of _ENDSTOP_HIT 9 years ago
Scott Lahteine 7c16e774ca Show all endstops on LCD in checkHitEndstops 9 years ago
Scott Lahteine 3e5312f116 CORE support for st_set_position & plan_set_position 9 years ago
Scott Lahteine e087a99a10 Some cleanup of st_get_pos functions 9 years ago
Scott Lahteine dc19b69697 No casting needed for SERIAL_ECHOPAIR 9 years ago
esenapaj 7950b5268a Use SBI macro 9 years ago
Scott Lahteine 5d8036e554 Code cleanup around MOTOR_CURRENT_PWM options 9 years ago
Scott Lahteine 0da744b7b0 Further cleanup of comments, partial Doxygen-style
Following up on #3231
9 years ago
jbrazio 5e5d250832 Added gplv3 header to all Marlin files 9 years ago
Scott Lahteine af32a7d5d6 M120/M121 also set endstops non-homing state 9 years ago
Scott Lahteine c5857f96c8 Merge pull request #3182 from thinkyhead/rcbugfix_printrboard_revf
Add support for Printrboard RevF
9 years ago
Scott Lahteine 59483221d5 Move stepper DAC to a separate file 9 years ago
Scott Lahteine 5d0570cea0 Make digitalPotWrite depend on HAS_DIGIPOTSS 9 years ago
Stephanie 6843b78f99 Add support for Printrboard RevF
The PrintrBoard Rev F utilizes a mcp4728 DAC to set motor current. Printrbot's implementation utilizes 2 new M-codes to set and write the DAC settings to the DAC EEPROM: `M909` (Read DAC) and `M910` (Write DAC). `M907` is re-used to set value, `M908` for direct control.

The Pins file for the RevF board is included.
9 years ago
AnHardt 3f45a1acf9 Check probes only when deployed
Aim: Test probes in update_endstops only when activated

Changes:
Configurations
 Add define for FIX_MOUNTED_PROBE to handle the situation where formerly ENDSTOPS_ONLY_FOR_HOMING had to be set, or lowering the nozzle below Z_PROBE_OFFSET_FROM_EXTRUDER could give an "endstop hit" message.
 Add define for Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN to indicate a common situation, that we have a probe but it is connected to an endstop pin
 Add some comments
 Shift some entries to have related things together.

Conditionals.h
 We have a probe (HAS_Z_MIN_PROBE) if one of the pins is defined AND one of the probes is defined.

SanityCheck.h
 Add some tests if the probe is connected and if we have defined a probe.

stepper.cpp
 Changes to test the probe only when it is deployed (z_probe_is_active).
 Test update_endstops() when the probe is deployed.

MarlinMain.cpp
 a. set and reset z_probe_is_active in deploy_z_probe(), stow_z_probe() and dock_sled()
 b. set and reset z_probe_is_active in the case a z-servo is moved to a defined position. The only remaining unhandled servo move is in M280 where we do not end in a defined position. If you want to handle a probe use M401/402
 c. skip deploying/stowing when already deployed/stowed in the dedicated deploy/stow functions.
 d. Handle the new FIX_MOUNTED_PROBE in parallel to a servo driven probe/endstop.

 To do: In another PR. handle all probes in deploy/stow_z_probe.
 Sort out SERVO_LEVELING vs. HAS_SERVO_ENDSTOPS.
9 years ago
Scott Lahteine 4634feaeab Merge pull request #3012 from thinkyhead/fix_command_injection
Use a serial line buffer to prevent queue corruption
9 years ago
Scott Lahteine e5fd43f343 Implement BABYSTEPPING for COREXY and COREXZ 9 years ago
Scott Lahteine 8fe7420310 Use a separate serial line buffer 9 years ago
Alexander Leisentritt 4338813814 save last extruder and set stepper directions too in case the extruder changed
fixes MarlinFirmware/Marlin#3144 and MarlinFirmware/Marlin#3083
9 years ago
Scott Lahteine 6e1bc03d3b Additional wrapping for #3140 9 years ago
Scott Lahteine 0c48eaf3de Expose motor current in more configs, disable by default 9 years ago
Elijah Snyder e8b10d2836 Adding PWM_MOTOR_CURRENT flag to help expose PWM_MOTOR_CURRENTS in Configuration_adv.h similar to DIGIPOT_MOTOR_CURRENT 9 years ago
Scott Lahteine 3fd31976c3 Reduce code in stepper.cpp with macros 9 years ago
Scott Lahteine ff13070b59 Use _BV macros, patch up others 9 years ago
Scott Lahteine 373e8a1ad4 Fixes for COREXY and COREXZ coordinates 9 years ago
Naruto-kyun 2932602643 Update stepper.cpp
Forgot Z2_MIN_PIN
9 years ago
Richard Wackerbarth 7a670e3911 Improve planner & stepper PR #263 9 years ago
Scott Lahteine 644c376e84 Use binary OR with endstop bits 9 years ago
Scott Lahteine 9bdab4f3a8 Clean up "else" and other spacing 9 years ago
Scott Lahteine 0c7f7ebcfb Styling adjustments (PR#2668 & PR#2670)
Keep "astyled" reformatting
9 years ago