Commit Graph

329 Commits (4183a249b6b3102add751f661a852543852569a1)

Author SHA1 Message Date
Scott Lahteine 9248cfb0ad Bed leveling that accounts for home XYZ
Scott Lahteine 6ac9d895ca Tweak Filament Width variables
Scott Lahteine d554c1dda8 Clean up planner kernel pass methods
Scott Lahteine a485a19052 Added optional planner logging
Scott Lahteine ab59280075 MIN_SEGMENTS_FOR_MOVE => MIN_STEPS_PER_SEGMENT
Follow-up to 
Scott Lahteine 27b80b1dd1 Merge pull request from thinkyhead/rc_M211_sw_endstop_switch
M211: Enable/Disable Software Endstops
Scott Lahteine 2f223b8c79 Use ABC and XYZ for "3"
Scott Lahteine 01d4703429 PREVENT_DANGEROUS_EXTRUDE => PREVENT_COLD_EXTRUSION
Also improve the documentation of this and related options, and set
EXTRUDE_MINTEMP to 170 everywhere.
Scott Lahteine 374f8d2014 dropsegments => MIN_SEGMENTS_FOR_MOVE
Scott Lahteine 628dcbc764 extruder_multiplier => flow_percentage
Scott Lahteine b73203a0b7 Move some includes around to uncover missing deps
Scott Lahteine d8945e8464 Fix Z_HEAD index for COREYZ
Scott Lahteine f83369b79c Update refresh_positioning - no need for obj ref
Scott Lahteine 844a4e799e Account for DELTA in Planner::refresh_positioning
Scott Lahteine 753283e020 inverse_second => inverse_mm_s
Scott Lahteine 83e1d90ca3 Undo errant optimization of block->millimeters
Scott Lahteine 169c21b477 Merge pull request from thinkyhead/rc_consistent_positioning
Account for coordinate space offsets
Scott Lahteine d8e5af6834 Use RAW_POSITION for MBL in planner.set_position_mm
Scott Lahteine d8f2876753 Replace some float division with multiplication
Scott Lahteine ddde785b37 Code formatting in planner.cpp
Scott Lahteine f8b5749235 Replace division in planner with multiplication
Scott Lahteine b921f6b69d Optimize calculation of block->millimeters for DELTA
Scott Lahteine 3e2b3353b0 Fix axis indices for COREYZ
Scott Lahteine 4e67a85a5d Macros to loop over axes
Scott Lahteine 4226f56f53 Revert the planner acceleration logic somewhat
Scott Lahteine 209f5c03d0 Fewer temporary vars in planner accel limit
Scott Lahteine 9f9fe043ba Apply sq macro throughout
Scott Lahteine 93ba5bddd7 Append units to feedrate variables
Scott Lahteine 05da02f0a2 Implement MIXING_EXTRUDER and SWITCHING_EXTRUDER
Scott Lahteine 0554b65d22 Merge pull request from thinkyhead/rc_serial_ln_macros
Sled-probe sanity fix, conditionals for remaining types of leveling
Scott Lahteine e974ac63ef Init matrix in planner.init
esenapaj 58177a1602 Suppress warnings
João Brázio 664232140d
Fixes somes compiler warnings
Scott Lahteine ef3bef6b9e Fix feedrate in gcode_T (max_feedrate is mm/s)
Scott Lahteine 6d62a4ffc8 Patch LIN_ADVANCE for style and forward-compatibility
Sebastianv650 fb8e880734 Add LIN_ADVANCE
Scott Lahteine 72c6f2923f axis_steps_per_unit => axis_steps_per_mm
Scott Lahteine 80ab749563 Rename acceleration locals for clarity
Scott Lahteine 3b08eb1eeb `acceleration_st` => `acceleration_steps_per_s2`
Scott Lahteine cb4704e07a Rename some planner acceleration vars
- `per_sq_second` => `per_s2`
- `per_sqr_second` => `per_s2`
- `axis_steps_per_sqr_second` => `max_acceleration_steps_per_s2`
Reid Rankin 16212432c9 G20/21 and M149 support, and code_value() refactor
This is an update of MarlinDev PR .

G20/21: support for switching input units between millimeters and
inches.
M149: support for changing input temperature units.

In support of these changes, code_value() and code_value_short() are
replaced with an array of functions which handle converting to the
proper types and/or units.
Scott Lahteine 49ecaf774d Rename some auto/locals to avoid name conflict
Scott Lahteine c2362c1b3c Apply Marlin coding standards to MBL class
Edward Patel c06de0f097 MBL: Added keeping MBL active when homing single axises for
Scott Lahteine 381bc6f0b0 set_position => set_position_mm
Scott Lahteine 470d5ac09f Apply static to Planner class
Scott Lahteine 5172d4ba40 COREYZ stepper, planner, endstop, babysteps
esenapaj 1a97442d19 Follow-up the PR #3643(Temperature singleton)
Follow-up the PR #3643(Temperature singleton)

・Change from fanSpeedSoftPwm[0] to thermalManager.fanSpeedSoftPwm[0] in planner.cpp
It fix compilation error when FAN_SOFT_PWM is enabled.

・Remove declaration of setExtruderAutoFanState() in temperature.h
Because that function was abolished.

・Change from babystepsTodo to thermalManager.babystepsTodo in ultralcd.cpp
It fix compilation errors when BABYSTEPPING is enabled.
Scott Lahteine 084f6b5b44 Temperature singleton class
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
Scott Lahteine 7fd0243048 Cleanup, debug strings in Planner::adjusted_position
Scott Lahteine 96f51f400f Planner singleton class
Scott Lahteine 5e4e535ce8 Stepper and Endstops as singleton objects
Scott Lahteine e38baaa23e Fix an acceleration anomaly by making locals signed
Scott Lahteine fce1e843b9 Patch steps rate comment in trapezoid function
Scott Lahteine a4062a47ac Rename baricuda variables
Scott Lahteine c5a2ce4366 Merge pull request from thinkyhead/rc_fixup_M206_and_mesh
Fix home_offset handling and account for it in G29
Scott Lahteine b1bb1c7989 Merge pull request from thinkyhead/rc_look_for_leveling_bug
Add CORE support to st_set_position and plan_set_position
Scott Lahteine e087a99a10 Some cleanup of st_get_pos functions
Scott Lahteine 386140f361 Test time difference in safe way
Scott Lahteine 1b7356b3a1 Account for home_offset in G29 handler
Scott Lahteine 865dcf3fb4 Fix FILAMENT_WIDTH_SENSOR measurement
Only measure and store filament width when E is going forward.
Scott Lahteine de333c4fea Merge pull request from thinkyhead/rc_filament_width_sensor
FILAMENT_SENSOR -> FILAMENT_WIDTH_SENSOR
Scott Lahteine 1a79b13b7a FILAMENT_SENSOR -> FILAMENT_WIDTH_SENSOR
Scott Lahteine 5f32184254 Merge pull request from thinkyhead/rc_cleanup_m111_redo
Echo all debug levels in M111, default to DEBUG_NONE
Scott Lahteine 05765fb570 Add DEBUGGING macro
Scott Lahteine 3252df7998 Minor cleanup to filament sensor code
Scott Lahteine 0da744b7b0 Further cleanup of comments, partial Doxygen-style
Following up on 
jbrazio 5e5d250832 Added gplv3 header to all Marlin files
AnHardt ba4eebad2f Fix Fan KICKSTART
Sorting ot what else belongs to what if was not so hard.
But the static `ms = ms = millis();` was a bit surpising.
Scott Lahteine 4bbea5124d Support for multiple PWM fans
Scott Lahteine d7c6fd5c2f Merge pull request from thinkyhead/rc_enabled_true_false
Support "true" and "false" in the ENABLED macro
Scott Lahteine 6e1bc03d3b Additional wrapping for
Scott Lahteine 4b648793f2 Use ENABLED with DISABLE_[INACTIVE_][XYZ]
Scott Lahteine f9ded2a7c4 Wrap macros to prevent bad expansions
Scott Lahteine 614febaaf3 Fix acceleration limits
See: https://github.com/Ultimaker/Marlin/pull/7
Scott Lahteine 71718d888a Fix typos in check_axes_activity
Scott Lahteine ff13070b59 Use _BV macros, patch up others
Scott Lahteine 209f5f21e0 Use macros where possible
Apply `constrain`, `NOMORE`, `NOLESS` and `CRITICAL_SECTION` macros
wherever possible.
Scott Lahteine 34b8b9f0f5 Merge pull request from thinkyhead/rcbugfix_corexy_corexz
Add CORE support to st_get_position_mm (and elsewhere)
Scott Lahteine 772460a7b8 Various minor spelling corrections
Redo of  rebased against RCBugFix
Scott Lahteine 373e8a1ad4 Fixes for COREXY and COREXZ coordinates
Richard Wackerbarth 7a670e3911 Improve planner & stepper PR
Wurstnase 78a347a01a change nx, ny, nz and ne from float to long
st_set_position takes long
```void st_set_position(const long& x, const long& y, const long& z, const long& e)```
Wurstnase 6d691aceee change dx, dy, dz and de from float to long
anything is long, we don't need float there
Wurstnase 0fbfb22506 Renaming delta speeds (PR2824)
dx -> dsx
dy -> dsy
dz -> dsz
de -> dse
Scott Lahteine 9bdab4f3a8 Clean up "else" and other spacing
Scott Lahteine 0c7f7ebcfb Styling adjustments (PR#2668 & PR#2670)
Keep "astyled" reformatting
Richard Wackerbarth 7b4bdc0203 DUAL_X_CARRIAGE motor enabling
As noted by @darkjavi et.al. in , the E1 motor was not being enabled in planner.cpp when using DUAL_X_CARRIAGE. This patch enables and disables E1 as it should.
Scott Lahteine f690b82343 Remove extra MAX_FREQ_TIME define (PR#148)
Richard Wackerbarth 6292d9e815 Rename ENABLE_AUTO_BED_LEVELING
With the introduction of the #if ENABLED(…)

reads better than
Richard Wackerbarth 29b456ae07 Suppress some compiler warnings
Scott Lahteine 46453905d6 Apply remaining ENABLED/DISABLED conditionals
Scott Lahteine bf6eb93c61 Overridable Options - Part 10 (PR#2562)
Apply `ENABLED` / `DISABLED` macros to planner files.
Andrew Lenharth a0ae9e30df don't pass integer by reference, inefficient. (PR#2547)
Scott Lahteine a1154d4a20 Enable Y and sanity-check CoreXZ (PR#2509)
Scott Lahteine 9f53e2f0c9 Implement COREXZ in stepper.cpp and planner.cpp
Scott Lahteine fa00e1d97f Explode conditions common to corexy and cartesian
Richard Wackerbarth 54ddc1d417 Simplify DRY RUN (PR#2358)
Elsewhere DRYRUN turns off the heating elements
and ignores constraints on them.

Here, whenever motion is entered into the planner,
if DRY RUN is set, we instantly act as if the E_AXIS
is in the desired final position.
CONSULitAS 788eb6e647 planner.cpp: remove tab
planner.cpp: single evil and hidden tab removed ♻️ 😏
CONSULitAS e55e65d1e4 planner.cpp: Add FAN_MIN_PWM for slow fan stopping issue …
@CONSULitAS

planner.cpp: Add FAN_MIN_PWM for slow fan stopping issue (V2.1 with
macro and linear scaling)

@thinkyhead thanks for idea on linear scaling
AnHardt e400fce271 Merge pull request from MagoKimbra/Dryrun
Insert Debug DRYRUN Repetier Host compatible
wurstnase e7e964432b consistency name for multiplier
replace extruder_multiply with extruder_multiplier
like feedrate_multiplier or volumetric_multiplier
MagoKimbra 76306f9073 Insert Debug DRYRUN Repetier Host compatible
Scott Lahteine d76a01194d Slight size reduction by adding idle()
Scott Lahteine 513077c317 Minor change to fan kick
Scott Lahteine 35493e1af9 Tweak to planner.cpp position.debug
Scott Lahteine 0fca084ea6 Make EEPROM reproducible in GCode
With these changes the output of `M503 S0` is all you need to restore
the EEPROM. Building on this it is straightforward to save and restore
the EEPROM state using the SD card or external GCode file.

- Added `M145` to set “heatup states” for the LCD menu
- Added `M420` to toggle Mesh Bed Leveling
- Added `M421` to set a single Mesh coordinate
- Extended `Config_PrintSettings` with added M codes
- Cleaned up some comments here and there
Scott Lahteine 3f02da646c Make sure axis_active is cleared for
Scott Lahteine ccddc280be Apply three more commits
Scott Lahteine 8857b9e921 Use the extruder argument in plan_buffer_line
Scott Lahteine 1269c445ab Catch dangerous extrude before trying several
Scott Lahteine 3162971cd6 current_position not static
Scott Lahteine 1d291be2ba Fix de after PREVENT_DANGEROUS_EXTRUDE
- Set `de` to 0 when `position[E] = target[E]`
- Address regression mention in 
Scott Lahteine c185912c19 Latest upstream commits, mostly
Scott Lahteine e0d4368cb5 Minor code cleanup, move NUM_AXIS out of config
Scott Lahteine b98ebd517e disable / enable_all_steppers functions
Scott Lahteine 0e8182bbf2 Additional pin tests, cleanup
AnHardt 50a732360a Replace extrudemultiply by extruder_multiply[active_extruder]
Fix for .

Seems to work with only one extruder. Can't test this myself with more.
Scott Lahteine afff968e88 ARRAY_BY_EXTRUDERS, shorthand to sync planner
- Add some documentation to planner and stepper headers
- Patch up RAMBO pins with undefs
- Add `sync_plan_position` inline to set current XYZE
- Swap indices in `extruder_offset` to fix initialization values
Scott Lahteine 19d418cd6a Fix up the code to eliminate warnings
Scott Lahteine 88e81a4804 Latest upstream commits, plus fixes
- Also add Manual Bed Leveling to the rest of the configs
Scott Lahteine af14c684b5 Minor optimizations to planner code
- Prefetch values used more than once
Scott Lahteine 13fbf42d95 Cleanup of planner code
- Use named axis indexes, `X_AXIS` etc.
- Replace `block.steps_A` with block.steps[A]`
- Replace `A_segment_time` with `segment_time[A]`
- Add `A_AXIS`, `B_AXIS` for `COREXY` axes
- Conditional compile based on `EXTRUDERS`
- Add BLOCK_MOD macro for planner block indexes
- Apply coding standards to `planner.h` and `planner.cpp`
- Small optimizations of planner code
- Update `stepper.cpp` for new `block` struct
- Replace `memcpy` with loops, let the compiler unroll them
- Make `movesplanned` into an inline function
Edward Patel 8067a985ce Merge branch 'Development' into manual-bed-leveling+mesh-bed-level
Fixed conflicts:
	Marlin/planner.h
maverikou 8a739b6fba Merge branch 'Development' into delta_auto_bed_level
Conflicts:
	Marlin/Marlin_main.cpp
Edward Patel 8005d22c81 Added menu option for bed leveling.
Edward Patel 0e51e53813 WIP. Adding bed leveling code.
Scott Lahteine c37f7d15c9 - Rename WRITE_E_STEP for consistency
- Add BIT and TEST macros
- Add _APPLY_ macros to stepper.cpp to help with consolidation
- Consolidate code in stepper.cpp using macros
- Apply standards in stepper.cpp
- Use >= 0 instead of > -1 as a better semantic
- Replace DUAL_Y_CARRIAGE with Y_DUAL_STEPPER_DRIVERS
alexborro c0b6075f77 Fix max acceleration limits in planner
The max acceleration limiting was in wrong place.
alexborro 9157cbd8f3 Add Travel Acceleration and change the M204 options
Added option to set Travel Acceleration (non printing moves).
The M204 options was a non sense (S for printing moves and T for retract
moves).

It has been changed to:
P = Printing moves
R = Retract only (no X, Y, Z) moves
T = Travel (non
printing) moves

I will add this info o G-Code wiki in reprap.org. I also advise to put
this info in Marlin next version changelog.
maverikou 7c24b97958 Ported over Johann Rocholl's improvements for delta printers:
- Nonlinear auto bed leveling code (includes G29, G30, Z_RAISE_AFTER_PROBING). Cleaned it up to be a delta-specific AUTO_BED_LEVELING_GRID code path.
- Allen key z-probe deployment and retraction code. Cleaned it up and added safety checks.
alexborro afc737ca0c Fix CoreXY Homing Routine.
Fixed how stepper ISR figure it out when the head (extruder) is going to
Min or Max direction.
Added Homing to Max Endstops.
MagoKimbra 986e723eeb Add 4th extruder
daid 53f971095d Revert "Reduce PROGMEM warnings"
Bo Herrmannsen d4a665694a Merge pull request from odewdney/Development
Reduce PROGMEM warnings
odewdney 538859669d Removing compiler warnings for progmem
Alex Borro 422a958a34 Fix CoreXY speed calculation
For cartesian bots, the X_AXIS is the real X movement and same for
Y_AXIS.
But for corexy bots, that is not true. The "X_AXIS" and "Y_AXIS" motors
(that should be named to A_AXIS
and B_AXIS) cannot be used for X and Y length, because A=X+Y and B=X-Y.
So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning
the real displacement of the Head.
Having the real displacement of the head, we can calculate the total
movement length and apply the desired speed.
alexborro d74aabf259 Revert "Change Auto_Bed_Leveling to Auto_Bed_Compensation"
John Davis ac204028e7 Update planner.cpp
Changed level and leveling to compensation
Scott Lahteine 07c6b5ab71 Using axis constants
Erik van der Zalm 058e446531 Merge pull request from filipmu/Filament-Sensor
Support for a filament diameter sensor
Filip Mulier 62db9848d3 Improvements and bug fixes in sensor delay buffer for filament sensor code
Improvement to avoid reinitializing delay buffer with every print. Fixed
issues in buffer indexing and memory out of bounds due to floating point
imprecision.  Simplified the code by avoiding conversion to standard
diameter and 1cu mm extrusion, which caused complications in determining
mm extruded.
Filip Mulier 85649a4549 Real-time filament diameter measurement and control
This feature allows the printer to read the filament diameter
automatically and adjust the printer in real time.  Added code to read
an analog voltage that represents a filament diameter measurement.  This
measurement is delayed in a ring buffer to compensate for sensors that
are a distance away from the extruder.  The measurement is used to
adjust the volumetric_multiplier for the extruder.  Some additional g
codes (M404, M405, M406, M407) are used to set parameters and turn
on/off the control. g code M221 is updated.  Pins for RAMPS1.4, RAMBO,
and Printrboard are identified for analog input.  The configuration file
is updated with relevant user parameters.
midopple 17aa67e4ea If the option DISABLE_INACTIVE_EXTRUDER ist active the extruder switch to early to inactive because there are some moves in the buffer. So the planner wait 32 moves to disable the unused extruder.
Dim3nsioneer 8a32c5395b renaming the disable inactive extruder feature
Dim3nsioneer 29e7639933 Add switch unused feeder(s) off
Having the non-active feeder motors powered on all the time is not
necessary. A feature to deactivate the unused feeder motors has been
implemented. The feature is enabled on default but can be switched off
in the configuration.
whosawhatsis 856edfcc0d Fixed math
This is why I wanted to sleep on the code I wrote while falling asleep
rather than immediately submitting a pull request.
whosawhatsis d24df7af2c M200 implementation
fsantini 6ae7f7870d Merge branch 'Marlin_v1' of https://github.com/ErikZalm/Marlin into ErikZalm
Conflicts:
	Marlin/Configuration.h
	Marlin/Marlin_main.cpp