From eac7f2a5f7168537878ecff841d1e30e5b1152e3 Mon Sep 17 00:00:00 2001 From: Michael Moon Date: Sun, 12 Sep 2010 13:42:45 +1000 Subject: [PATCH] added analog stuff to machine.h, rearranged a bit and expanded and tidied some of the explanations --- machine.h | 78 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/machine.h b/machine.h index ab6a1e3..2651303 100644 --- a/machine.h +++ b/machine.h @@ -36,16 +36,22 @@ #define TEMP_HYSTERESIS 20 #define TEMP_RESIDENCY_TIME 60 -// acceleration, reprap style. Each movement starts at the speed of -// the previous command and accelerates or decelerates linearly -// to reach target speed at the end of the movement. +/* + acceleration, reprap style. + Each movement starts at the speed of the previous command and accelerates or decelerates linearly to reach target speed at the end of the movement. + Can also be set in Makefile +*/ +#ifndef ACCELERATION_RAMPING #define ACCELERATION_REPRAP +#endif -// acceleration and deceleration ramping. Each movement starts at -// (almost) no speed, linearly accelerates to target speed and decelerates -// just in time to smoothly stop at the target. -// alternative to ACCELERATION_REPRAP +/* + acceleration and deceleration ramping. + Each movement starts at (almost) no speed, linearly accelerates to target speed and decelerates just in time to smoothly stop at the target. alternative to ACCELERATION_REPRAP + Can also be set in Makefile +*/ //#define ACCELERATION_RAMPING + // how fast to accelerate when using ACCELERATION_RAMPING // smaller values give quicker acceleration // valid range = 1 to 8,000,000; 500,000 is a good starting point @@ -57,8 +63,39 @@ #endif #endif +/* +firmware build options +*/ + +// this option makes the step interrupt interruptible. +// this should help immensely with dropped serial characters, but may also make debugging infuriating due to the complexities arising from nested interrupts +#define STEP_INTERRUPT_INTERRUPTIBLE 1 + +/* + Xon/Xoff flow control. + Redundant when using RepRap Host for sending GCode, but mandatory when sending GCode files with a plain terminal emulator, like GtkTerm (Linux), CoolTerm (Mac) or HyperTerminal (Windows). + Can also be set in Makefile +*/ +// #define XONXOFF + +/* + move buffer size, in number of moves + note that each move takes a fair chunk of ram (69 bytes as of this writing) so don't make the buffer too big - a bigger serial readbuffer may help more than increasing this unless your gcodes are more than 70 characters long on average. + however, a larger movebuffer will probably help with lots of short consecutive moves, as each move takes a bunch of math (hence time) to set up so a longer buffer allows more of the math to be done during preceding longer moves +*/ +#define MOVEBUFFER_SIZE 8 + +/* + analog subsystem stuff + REFERENCE - which analog reference to use. see analog.h for choices + ANALOG_MASK - which analog inputs we will be using, bitmask. eg; #define ANALOG_MASK MASK(AIO0_PIN) | MASK(3) for AIN0 and AIN3 +*/ +#define REFERENCE REFERENCE_AREF +#define ANALOG_MASK 0 + + // -------------------------------------------------------------------------- -// you shouldn't need to edit something below this line +// you shouldn't need to edit anything below this line // same as above with 25.4 scale factor #define STEPS_PER_IN_X ((uint32_t) ((25.4 * STEPS_PER_MM_X) + 0.5)) @@ -72,29 +109,4 @@ #define UM_PER_STEP_Z ((uint32_t) ((1000.0 / STEPS_PER_MM_Z) + 0.5)) #define UM_PER_STEP_E ((uint32_t) ((1000.0 / STEPS_PER_MM_E) + 0.5)) - -/* - firmware build options -*/ - -// this option makes the step interrupt interruptible. -// this should help immensely with dropped serial characters, but may also make debugging infuriating due to the complexities arising from nested interrupts -#define STEP_INTERRUPT_INTERRUPTIBLE 1 - -// Xon/Xoff flow control. Redundant when using RepRap Host for sending GCode, -// but mandatory when sending GCode files with a plain terminal emulator, -// like GtkTerm (Linux), CoolTerm (Mac) or HyperTerminal (Windows). -// #define XONXOFF - -/* - move buffer size, in number of moves - note that each move takes a fair chunk of ram (69 bytes as of this writing) so don't make the buffer too big - a bigger serial readbuffer may help more than increasing this unless your gcodes are more than 70 characters long on average. - however, a larger movebuffer will probably help with lots of short consecutive moves, as each move takes a bunch of math (hence time) to set up -*/ -#define MOVEBUFFER_SIZE 8 - -/* -*/ -#define REFERENCE REFERENCE_AREF - #endif /* _MACHINE_H */