Commit Graph

2775 Commits

Author SHA1 Message Date
Kevin O'Connor 86121ff79e toolhead: Calculate and store axes_r in move class
Calculate the ratio of axis distance to total move distance (axis_d /
move_d) and store in a new member variable axes_r.  This avoids
needing to recalculate the value in other code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 257058981e toolhead: Simplify set_junction() code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 076a66f791 trapq: Use separate 'move' entries for accel, cruise, and decel phases
Only track a single acceleration movement in a 'struct move' instance.
Break the classic trapezoid movement (accel, cruise, decel) into three
separate movements.  This simplifies the calculation logic.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 7ca86f1723 toolhead: Flush trapezoid velocity queue in batches
Load all items from the look-ahead queue into the trapezoid velocity
queue, and then flush that queue by time.  This prevents the host cpu
from being starved on very long moves (which may require a large
number of steps to be generated).  It also improves the overall
performance.

With the batch flushing logic in place, it is no longer necessary to
split homing moves up.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 1acaaa98c2 trapq: Remove move_fill()
Now that all callers use the trapq system to queue moves, it is no
longer necessary to individually allocate and fill a 'struct move'.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 797dcfcb12 itersolve: Remove unused gen_steps()
Eliminate the old gen_steps() call now that all callers have been
converted to the newer trapq based generate_steps().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor bd3c8920f6 mcu: Remove set_ignore_move()
Update callers of set_ignore_move() to use the trapq system to set a
stepper to ignore moves.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor befd263260 toolhead: Remove kinematic move() call
Now that all kinematics use the trapq system, there is no need to call
into the kinematics on each g-code move.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor ef53ded6bc force_move: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor e6f713f1ce manual_stepper: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 9845d0d103 extruder: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 746b928c8b winch: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 4b5cbc18a4 polar: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 351b565728 delta: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor b792e0fdd1 corexy: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 7afac2b3af cartesian: Convert step generation to use trapq system
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor f3ef9c1889 itersolve: Add support for generating steps from a trapq
Support associating a stepper_kinematics with a trapq.  Support
generating steps from a time range on the given trapq.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor d3afe4f1d8 trapq: Initial support for building a queue of trapezoidal velocity moves
Add support for building a list of moves in the trapq.c code.  Update
the toolhead code so that moves generated from the look-ahead code are
added to that list.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor c06f6943a6 list: Add additional list helper functions
Add list_is_first, list_is_last, list_last_entry, and list_prev_entry
helper functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor fdbdb3c707 trapq: Add new trapq.c file with code for trapezoidal velocity handling
Move the "struct move" code from itersolve.c to new file trapq.c.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 374eb98765 polar: Implement bed angle wrapping adjustments in chelper code
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 92993c062b itersolve: Rename calc_position to calc_position_cb
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 9945cc0f46 itersolve: Fix possible infinite loop in itersolve_gen_steps()
If the kinematic position calculation function had an error in it (if
it produces sudden position changes) then it could lead to an infinite
loop in itersolve_gen_steps().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 15:51:51 -05:00
Kevin O'Connor 5eb5841eaf mcu: Contact and identify all the mcus prior to configuring them
Break up the connect phase into two phases - mcu_identify and connect.
The first phase will contact all the micro-controllers and obtain the
"identify" data dictionaries for them.  Once all the micro-controllers
have been contacted, then they can be configured.  This fixes an issue
with FIRMWARE_RESTART not working correctly on multi-mcu setups that
use restart_method=command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-06 10:35:24 -05:00
Kevin O'Connor 0b90337d59 config: Minor updates to printer-lulzbot-mini1-2016.cfg
Add to printers.test test case.  Don't disable the
max_extrude_cross_section check by default (users should verify they
want that safety feature off).

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-05 10:57:47 -05:00
Martin 51cf244617 config: Create printer-lulzbot-mini1-2016.cfg (#2129)
Signed-off-by: Martin van Es <martin@mrvanes.com>
2019-11-05 10:54:23 -05:00
Kevin O'Connor c11e4b74c2 config: Minor updates to printer-creality-cr20-pro-2019.cfg
Don't specify a default for pressure_advance.  Don't specify values
that are already at their default.  Add to printers.test test case.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-05 10:50:19 -05:00
bskp 0cd808cfde config: Added config for Creality CR-20 Pro (#2135)
Based on the configuration for the CR20-2018.
Added support for BLtouch, save z-homing and
automatic bed leveling.

Signed-off-by: Matthias Roggo <bskp@posteo.ch>
2019-11-05 10:47:03 -05:00
clearchris 009d14fc3e stm32: adc for new stm32f0 common code (#2120)
Derived from stm32/adc.c and stm32f0/adc.c with additional changes.

Tested on Monoprice Mini Delta (malyan) stm32f070xb board.

Signed-off-by: Chris Lombardi <clearchris@hotmail.com>
2019-11-05 10:08:32 -05:00
Kevin O'Connor cf6e8a2eee stm32: Define PGx pins on stm32f103
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-11-02 11:35:27 -04:00
Kevin O'Connor 430ad0b658 virtual_sdcard: Only return from M25 after print confirmed paused
Wait in the M25 command handler until the work_handler() background
timer fully exits.  This ensures that subsequent g-code commands (such
as M27 or M24) will correctly report a paused state.

Reported by @foosel.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-31 11:36:35 -04:00
Kevin O'Connor 40e2c64c82 clocksync: Fix typo in pause() call at connect time
The initial clock measurement wasn't properly implementing a small
delay between clock queries.  Fix the pause() call so there is a small
delay between queries.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-31 11:36:35 -04:00
Kevin O'Connor 739583a21b test: Add printer-lulzbot-taz6-dual-v3-2017.cfg to printers.test
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-30 12:46:03 -04:00
radensb dcedd84fe1 config: Lulzbot TAZ6 w/ Dual v3 Toolhead Config (#2111)
Signed-off-by: Ryan Densberger <magshooterz@gmail.com>
2019-10-30 12:37:22 -04:00
Kevin O'Connor e2f5e2871c docs: Recommend OctoPrint v1.3.12 in Installation.md
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-30 11:02:03 -04:00
Kevin O'Connor d65f2e2861 docs: Minor cleanup to square_tower.scad
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-27 12:16:17 -04:00
Kevin O'Connor 43453131ac config: Only document thermistors in example.cfg
Move the common temperature amplifier config descriptions to
example-extras.cfg.

Also, minor changes to wording of some example-extra.cfg sections.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-27 12:03:59 -04:00
Kevin O'Connor 1a69f38e6e flash_usb: Pass -t $CONFIG_MCU to flash_usb on all targets
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 18:48:00 -04:00
Kevin O'Connor 538d6ac3a2 flash_usb: Use "-s" option to specify flash offset on atsamd
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 18:33:00 -04:00
Kevin O'Connor c694da3753 flash_usb: Change dfu-util to reset the board after a flash on stm32f4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 18:06:32 -04:00
Kevin O'Connor 4b4e309e1b flash_usb: Inform user to manually reset after stm32f4 flash
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 17:46:18 -04:00
Kevin O'Connor 5131ec5eb0 stm32: Add support for flashing over usb on stm32f042
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 17:11:04 -04:00
Kevin O'Connor 2ecc8d8f62 stm32: stm32f4 usb boot check only needed when CONFIG_USBSERIAL
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 16:56:33 -04:00
Kevin O'Connor 5da6a62759 stm32f4: Add support for flashing over USB
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 13:24:59 -04:00
Kevin O'Connor 0ba5819370 tmc_uart: Don't try to configure analog pins to -1 value
Commit 6f5f2a3b incorrectly altered the analog mux pin config.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-26 11:33:30 -04:00
Kevin O'Connor 081c24326d atsam: sysio support is only available on sam4s
Fix sam4e build error introduced in commit f723a314.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 22:21:47 -04:00
Kevin O'Connor f723a3141e atsam: Allow PB4-PB7,PB10-PB12 to be used as gpio on sam4
A separate "sysio" register must be set in order to use some port B
pins on the sam4 mcu.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 22:02:29 -04:00
Kevin O'Connor 6f5f2a3bc7 tmc_uart: Make sure to set analog mux pins after a restart
Don't assume the analog mux pins are in a low state at startup.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 22:00:58 -04:00
Kevin O'Connor d6d2be66e4 config: The duet2 maestro uses a 2200 ohm pullup resistor
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 13:07:07 -04:00
Kevin O'Connor 9a11286327 stm32: Implement armcm_main() in arch specific code
Move armcm_main() to stm32f0.c, stm32f1.c, and stm32f4.c.  This gives
the arch specific code more control on the early boot setup.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2019-10-24 11:35:18 -04:00