There was a linker error regarding missing MASK function, which
is actually a macro defined in 'pinio.h'. After #including the
file, problem disappeared.
Temperature tables are emitted by selecting arbitrary sample values
to be used for the linear lookup table. This is fine in the range
where the thermistor produces linear output, but it is markedly wrong
near the extremes where the thermister output begins to curve.
Introduce a new sample selector which chooses samples based on the "most
incorrect estimate" and improves from there to ensure we get a cleaner
approximation across the selected range.
Traumflug: this topic is tracked here:
https://github.com/Traumflug/Teacup_Firmware/pull/208
It happens all to often that a #define is added or removed here
or there, but some related files gets forgotten. Now at least
existence of all the #defines is cross-checked.
Until this commit, the Z axis is disabled after each move and
only enabled when the Z axis will move. Now you can enable this
as a feature. Some printer axes are too heavy or have a high
pitch which are not self locking. In that case simply do nothing.
It's now off by default.
The marlin firmware reportedly reports "Error" instead of "!!", indicating
a machine failure which is followed by a full power-down. The Octoprint
GCode-sender assumes a reported Error means the print has failed and
the machine turned off.
In Teacup we report an "Error" when lookahead was too slow to join
movements, but this is interpreted as an emergency-stop by Octoprint who
then stops the job and leaves the printer idle with all the heaters running.
Change this "Error" to a "Notice" to avoid this problem. Add a comment
prefix while we're at it to fit the de facto standard better.
See http://reprap.org/wiki/G-code
The recent switch to send 'ok' postponed requires also sending a
newline in a few places, because this 'ok' is no longer at the
start of the line. Now it appears in its own line.
A recent commit tried to correct this already, but it missed a
few locations. Also remove the comments promising a forthcoming
newline from gcode_parse.
Derived from a contribution of Neil Darlow. Thank you, Neil!
The adjustments done were reverting customisations like moving
direction reversals (which depend on motor wiring) or custom
thermistor beta values. Everything else left as-is.
A comment in dda_queue.h says that MOVEBUFFER_SIZE no longer needs to be
a power of 2 in size. The comment is from a commit in 2011, but only
queue_full seems to be modified to make this true. Other places in the
code still assume that MOVEBUFFER_SIZE is always a power of 2, wrapping
it with "& (MOVEBUFFER_SIZE-1)".
Add a MB_NEXT(x) macro which can be used to definitively find the next
slot in the queue without using any boolean math. Replace all the
queue-position functions with new code that uses this MB_NEXT function
instead.
Also change the queue_full function to use this simpler method instead
of the complicated multi-step confusion which it did.
Implemented and tested for both platforms. This is quite a big
commit. Unlike with the previous changes to now choosable PWM
frequencies, all board configuration files and Configtool had
to be changed immediately to deal with the additional parameter
in DEFINE_HEATER() and keep AVR builds working (and regression
tests passing).
Just like with AVR, they're simply set as a GPIO output and
turned on and off as needed.
Bed heater and temp sensor not yet re-enabled, because Gen7-ARM
has a driver MOSFET for the bed, which needs an inverted signal.
It can be enabled for testing; M106 P1 S2 turns it on, M106 P1 S20
turns it off. Not the way it should work.
Especially at high frequencies the achieved one is only close,
but that's entirely sufficient for our purposes.
Test: the PWM frequency on the scope should be similar to the
one configures in the board file with DEFINE_HEATER().
Works very nicely from full off (M106 S0) to full on (M106 S255).
Test: M106 should work now as expected. M106 S0 should turn full
off, M106 S255 should turn full on, both without any spike on the
scope.
Currently at a fixed frequency of 1 kHz and with a fixed duty
cycle of 10%, but PWM does work.
As it turns out, PIO0_11 is not usable for PWM, because its timer
is already in use for the Step timer, and had to be disabled for
Gen7-ARM.
Test: define a heater in board.gen7-arm.h and a square signal
of 1 kHz with 10% duty cycle should appear on the heater pin.
Also move #defines from heater.c to heater.h
This operation became bigger than expected, because PID handling
hat to be separated from heater handling. Code and strategy wasn't
changed, but some chunks of code had to be moved.
No code changes, but quite a few removals of __ARMEL_NOTYET__
guards. 20 such guards left.
Test: M105 should work and report plausible temperatures.
Current code size:
SIZES ARM... lpc1114
FLASH : 9460 bytes 29%
RAM : 1258 bytes 31%
EEPROM : 0 bytes 0%
Very simple, because the LPC1114 features a hardware scan mode,
which automatically scans a given set of pins in freerunning mode
and stores all the values separately. No need for an interrupt!
Not yet done: configure not PIO1_0 and PIO1_1, but the pins
actually defined in the board file.
For testing, add this to ifclock(clock_flag_1s) in clock.c:
uint8_t i;
for (i = 0; i <= 7; i++) {
sersendf_P(PSTR("%lu "), analog_read(i));
}
serial_writechar('\n');
This should print all 8 ADC values repeatedly. Only two pins are
actually set up, these values should change depending on the
thermistor temperature. More precisely: depending on the voltage
on the pin.