Commit Graph

1668 Commits

Author SHA1 Message Date
Nico Tonnhofer 3b13eb342f enumerate for axis endstop 2017-12-02 00:11:33 +01:00
Nico Tonnhofer ccbcbc5ab4 home.c: move fast_feedrate and search_feedrate to PROGMEM 2017-12-02 00:08:39 +01:00
Nico Tonnhofer 51eb03583d Give a warning for wrong TEMP_EWMA values.
float values are deprecated. Some users could accidentally set 1.0 to 1
2017-11-06 19:04:51 +01:00
Nico Tonnhofer 01c2300d20 home.c: refactor homing 2017-11-04 07:40:02 +01:00
Nico Tonnhofer 5ff6e4c755 home.c: homing starts always at position 0. 2017-11-04 07:37:19 +01:00
Nico Tonnhofer 06931c50f6 home.c: only home to the expected endstop direction.
Afterwards move back. It's not 'zeroed' at this time.
2017-11-04 07:37:19 +01:00
Nico Tonnhofer 3856d11673 home.c: prevent overflow of traveled length while homing.
In dda.c we have some limitation factors. e.g. the calculation
for the move_duration. 'distance * 2400' should be everytime below
UINT32_MAX.
Maybe we find later an other limitation factor. So you can
modify it now in dda.h.
2017-11-04 07:37:11 +01:00
Nico Tonnhofer 8427c2724a whitespace correction for dda_create() 2017-11-04 07:35:48 +01:00
Nico Tonnhofer e965931d9a Makefile-ARM: LPC1114 as standard
Much more users have a GEN7 ARM. So make it them more easy.
2017-11-04 07:30:25 +01:00
Nico Tonnhofer 301c5ed149 dda.c: get endstops back working
In the endstop_trigger case, we look, if will are cruising.
-> Yes: Take the rampdown_steps for calculation
-> No: We are still accelerating. So we want to decelerate the same amount of steps.
2017-10-27 21:59:42 +02:00
Nico Tonnhofer e976f2bdf3 dda.c: c0_P is only for ACCELERATION_RAMPING
dda.c:65:35: error: 'c0_P' defined but not used [-Werror=unused-const-variable=]
2017-07-20 21:24:16 +02:00
Nico Tonnhofer f4d1a6a33b usb_serial.c: Avoid inline error
We've got with -Winline:
usb_serial.c:761:13: error: inlining failed in call to 'usb_wait_in_ready': call is unlikely and code size would grow [-Werror=inline]

We want to inline this in the USB ISR. So let's force it and prevent the error.
2017-07-20 21:21:54 +02:00
Markus Hitter a88bf4ef16 git-step-rebase: remove pause.
This script is now reliable enough to no longer need investigation
stops.

One can still stop an ongoing step-rebase by hitting Ctrl-C, then
doing a 'git rebase --abort'.
2017-06-04 17:13:41 +02:00
Markus Hitter d3867f112c git-step-rebase: enable the rerere-mechanism.
Git provides a mechanism to record conflict solutions done with
one rebase and replaying that when rebasing another branch. That's
what's Rerere is about. Unfortunately, a rebase still stops after
resolving all conflicts with recordings, so convenience is a bit
limited.

If Rerere is disabled in a repo or there are no recorded solutions,
this option has no effect.
2017-06-04 17:09:35 +02:00
Markus Hitter 606611a070 git-step-rebase: count distance to branch head correctly.
Without --first-parent, 'git rev-list' counts commits on merged
branches, too. Not noticed on Teacup, because we have no merges
here, but in another repo this came up.
2017-06-04 17:05:37 +02:00
Markus Hitter 7a36302cd7 git-step-rebase: try the faster standard rebase mode.
Standard mode, like without ignoring whitespace changes. Only if
that fails, try again with whitespace ignorance.

Reason for this attempt is, rebases not ignoring whitespace are
significantly faster and much less verbose. As 99% of all rebases
work fine without ignoring whitespace, it's a good idea to try
that first.
2017-04-25 20:26:23 +02:00
Markus Hitter 92926aadf5 git-step-rebase: slightly nicer progress report. 2017-04-25 20:00:13 +02:00
Markus Hitter b1ba8b4003 git-step-rebase: --whitespace=fix was apparently fixed. 2017-04-25 19:49:48 +02:00
Nico Tonnhofer 1bb4d7f7dd dda: recalculate only dedicated axes 2017-04-20 19:06:58 +02:00
Nico Tonnhofer 5cf1b34924 dda.c: correct current position for CoreXY 2017-04-20 19:01:22 +02:00
Nico Tonnhofer eacb5bbbed dda.c: split move_step and move_step_no
12 bytes less
2017-04-20 19:01:10 +02:00
Nico Tonnhofer 3592622414 dda.h/.c: remove move_state.step_no
We don't need to save the step_no. We can easily calculate it when needed.
Also some whitespace-work. In dda.h is only a delete of 'uint32_t step_no;'.

Saves up to 16 clock cycles in dda_step():

short-moves.gcode statistics:
LED on occurences: 888.
LED on time minimum: 209 clock cycles.
LED on time maximum: 504 clock cycles.
LED on time average: 241.441 clock cycles.

smooth-curves.gcode statistics:
LED on occurences: 22589.
LED on time minimum: 209 clock cycles.
LED on time maximum: 521 clock cycles.
LED on time average: 276.729 clock cycles.

triangle-odd.gcode statistics:
LED on occurences: 1636.
LED on time minimum: 209 clock cycles.
LED on time maximum: 504 clock cycles.
LED on time average: 262.923 clock cycles.
2017-04-03 23:10:02 +02:00
Nico Tonnhofer 89bb0ae3bb dda.c: resort calculation for high frequencies 2017-04-03 23:07:18 +02:00
Nico Tonnhofer f9c8652715 dda.c: correct md_candidate calculation 2017-04-03 23:07:17 +02:00
Nico Tonnhofer 104cc0b757 dda.c: c_limit calculation is only for non-temporal configs
no functional change, but saves 24 bytes when using acceleration temporal
2017-04-03 23:07:17 +02:00
Nico Tonnhofer a1cca9bdad arduino_stm32: correct channel for pwm 2017-04-03 23:07:17 +02:00
Nico Tonnhofer 635d40a42a heater-stm32.c: rework init 2017-04-03 23:07:17 +02:00
Nico Tonnhofer 772d507a45 clock.c: delete really old comment code
and reformate some lines with spaces
2017-03-29 06:21:05 +02:00
Wurstnase e7dce1817b MAX6675: change evaluation of spi result
https://cdn-shop.adafruit.com/datasheets/MAX6675.pdf
When thermocouple is open (bit2), we send a "not ready", reset active and hopefully we get a result next time.
2017-03-21 17:45:13 +01:00
Nico Tonnhofer bcb6964ceb heater: add max_pwm and software pwm also for stm32 2017-03-21 17:36:14 +01:00
Nico Tonnhofer fbe1af4013 configtool: add FORCE_SOFTWARE_PWM to configtool 2017-03-21 15:04:26 +01:00
Nico Tonnhofer 4882d19215 heater: if pwm is set to 1, hardware pwm is forced, if available. 2017-03-21 15:04:26 +01:00
Nico Tonnhofer 6e78757385 heater-arm/avr: add some descriptions and prettify files 2017-03-21 15:04:25 +01:00
Nico Tonnhofer 60a7542dc9 heater-avr.c: precompiled masked pin
Saves 28 bytes.
2017-03-21 14:51:27 +01:00
Nico Tonnhofer 0f83223bc8 arduino: Extend arduino-files with pin ##_TCCR and _COM for heater-avr.
Add also NO_PWM_PIN and NO_TCCR_PIN to arduino-files.

		config			|Program|Data
	--------------------		|---	|---
config.regtest-gen7-avr.h		| -94	| 0
config.regtest-ramps.h			| -226	| 0
config.regtest-nanoheart.h		| -80	| 0
config.regtest-teensy2.h		| -150	| 0
config.regtest-gen3.h			| 0	| 0
config.h.Profiling			| -92	| 0
config.regtest-display.h		| -94	| 0
config.regtest-acceleration-reprap.h	| -226	| 0
config.regtest-acceleration-temporal.h	| -226	| 0
config.regtest-gen7-arm.h		| 0	| 0
config.regtest-no-endstops.h		| -102	| 0
config.regtest-no-lookahead.h		| -94	| 0
2017-03-21 14:51:27 +01:00
Nico Tonnhofer dd50675ac0 heater: add pwm_types and a union for AVR pin/pwm. 2017-03-21 14:51:25 +01:00
Nico Tonnhofer d9f18f0780 heater: precalculate max_value for software PWM
PWM_TYPE macro for finding the correct pwm type.
2017-03-21 14:51:24 +01:00
Nico Tonnhofer 8e273c2789 heater: heater_runtime needs not to be extern 2017-03-21 14:51:24 +01:00
Nico Tonnhofer 4abc3aa2f0 heater: software pwm with delta sigma algorithm
@triffid points me to the delta sigma algorithm. This is pretty nice
for slow updating routines. Others than normal PWM, this scale better
for slow frequencies.

This algorithm is a mix of
https://www.mikrocontroller.net/topic/293454#3128867
and
https://github.com/Smoothieware/Smoothieware/blob/29e80/src/libs/Pwm.cpp#L55
2017-03-21 14:51:08 +01:00
Nico Tonnhofer fb83d2de57 heaters: rework max heater value
remove the define USE_MAX_HEATER
this will cost only neglabile space when not enabled on AVR.
2017-03-21 14:51:01 +01:00
Phil Hord 4b3c6fee7b Overload DEFINE_HEATER to take variable arguments
DEFINE_HEATER used to take 3 arguments.  Today it takes 4.  Soon it might
take 5.  The transition from 3 to 4 was painful while old config files
had not caught up to the new parameters.  Let's avoid the pain again in
the future by making this macro overloadable to accept any correct number
of arguments while doing the right thing.  Also let's accept 5 or 6
parameters so new configs will work with today's "older" code.
2017-03-21 14:50:28 +01:00
Phil Hord ab2c355821 Factor out some boilerplate code from configs
Configs are always included via a config_wrapper.h now, and configs always
must include this safety-definition for a missing DEFINE_HEATER.  Let's
simplify the configs by moving it to a common location.
2017-03-21 14:48:19 +01:00
Nico Tonnhofer f8c78e6384 heaters: add max heater value
You can reduce the max. power of each heater.
With the max_pwm value between 1 and 100% you reduce the active pwm.
For example you could reduce the power of your hotend.

My hotend for example is 12V 30W but connected to 24V. So it has
normally 120W. This is very huge. Setting the max_pwm to 25, it has
again ~30W.
2017-03-21 14:48:15 +01:00
Nico Tonnhofer 9033d86877 fast integer: uint_fast8_t and uint_fast16_t for some vars.
This will decrease the flash size and should increase performance.
In some cases this will increase the used ram slightly.

In total this path costs 28 bytes RAM and saves 88 bytes of Flash on a STM32.
AVRs are not affected by this commit.
2017-03-05 15:00:13 +01:00
Nico Tonnhofer dcd67e402a STM32F411: rework serial-stuff.
Simplify changing the USART for debug or serial output.
Implement all 3 USARTs for the stm32f411re.
2017-03-05 15:00:13 +01:00
Nico Tonnhofer 230572b1d0 STM32F411: simplify cmsis files for stm32f411
Delete some macros from cmsis-file we will never use again.
Also replace magic numbers.
Add missing flag to allow -O0 (using R7 as register)
2017-03-05 15:00:12 +01:00
Nico Tonnhofer dea9cec217 STM32F411: uff... ADC works. Really? Really!
Was a little bit tricky. When using ADC with DMA and infitiy readings, everthing is ok. But we don't need so much readings.
To read only one shot after starting the ADC, we need something more.
Disabling continuous conversion and unset the DMA bit. So conversion is stopped. Else the next conversion could start at any ADC.
For a restart just enable again the DMA bit, the continuous conversion and start the ADC.
2017-03-03 18:54:57 +01:00
Nico Tonnhofer 767c4a6911 STM32F411: simplify analog readings
We don't need an interrupt for the DMA.
Simply clear and set the DMA-bit for the ADC is sufficient.
2017-03-03 18:54:57 +01:00
Nico Tonnhofer aeb98b557b STM32F411: cleanup code with using pinio.h macros. 2017-03-03 18:54:57 +01:00
Nico Tonnhofer 56c2238fef dda.c/dda_maths: add int_f_sqrt for controller with FPU
very fast sqrt in hardware
also accurate dda->c for high steps/mm without overflowing
2017-03-03 18:54:57 +01:00