Re: Project: FiveD on Arduino December 02, 2010 03:19AM |
Re: Project: FiveD on Arduino December 02, 2010 10:37PM |
Registered: 17 years ago Posts: 1,094 |
Re: Project: FiveD on Arduino December 04, 2010 08:46PM |
Registered: 14 years ago Posts: 71 |
/***************************************************************************\ * * * 4. TEMPERATURE SENSORS * * * \***************************************************************************/ /* TEMP_HYSTERESIS: actual temperature must be target +/- hysteresis before target temperature can be achieved. NOTE: format is 30.2 fixed point, so value of 20 actually means +/- 5 degrees TEMP_RESIDENCY_TIME: actual temperature must be close to target for this long before target is achieved temperature is "achieved" for purposes of M109 and friends when actual temperature is within [hysteresis] of target for [residency] seconds */ #define TEMP_HYSTERESIS 20 #define TEMP_RESIDENCY_TIME 60 // which temperature sensors are you using? (intercom is the gen3-style separate extruder board) // #define TEMP_MAX6675 // #define TEMP_THERMISTOR // #define TEMP_AD595 // #define TEMP_PT100 #define TEMP_THERMISTOR // if you selected thermistor or AD595, what pin is it on? (this value only used to fill ANALOG_MASK for you) #define TEMP_PIN_CHANNEL AIO0_PIN // ANALOG_MASK is a bitmask of all analog channels used- if you use more than one analog input (more than one temp sensor?), bitwise-or them all together #define ANALOG_MASK MASK(TEMP_PIN_CHANNEL) // how many temperature sensors do you have? #define NUM_TEMP_SENSORS 1 /***************************************************************************\ * * * Fill in the following struct according to your hardware * * * * If your temperature sensor has no associated heater, enter '255' as the * * heater index. Unassociated temperature sensors are still read, but they * * do not affect firmware operation * * * * for GEN3 set temp_type to TT_INTERCOM, temp_pin to 0 and heater index to * * 255 - the extruder manages the heater for us * * * * Types are same as TEMP_ list above- TT_MAX6675, TT_THERMISTOR, TT_AD595, * * TT_PT100, TT_INTERCOM. See list in temp.c. * * * \***************************************************************************/ #ifdef TEMP_C struct { uint8_t temp_type; uint8_t temp_pin; uint8_t heater_index; } temp_sensors[NUM_TEMP_SENSORS] = { // type pin heater { TT_THERMISTOR, 0, 0 } }; #endif /***************************************************************************\ * * * 5. HEATERS * * * \***************************************************************************/ // number of heaters- for GEN3, set to zero as extruder manages the heater by itself #define NUM_HEATERS 2 // check if heater responds to changes in target temperature, disable and spit errors if not // #define HEATER_SANITY_CHECK /***************************************************************************\ * * * Fill in the following struct according to your hardware * * * * If your heater isn't on a PWM-able pin, set heater_pwm to zero and we'll * * use bang-bang output. Note that PID will still be used * * * * If a heater isn't attached to a temperature sensor above, it can still be * * controlled by host but otherwise is ignored by firmware * * * \***************************************************************************/ #ifdef HEATER_C struct { volatile uint8_t *heater_port; uint8_t heater_pin; volatile uint8_t *heater_pwm; } heaters[NUM_HEATERS] = { // port pin pwm { &PORTD, PIND6, &OCR0A }, { &PORTD, PIND5, &OCR0B } }; #endif
Re: Project: FiveD on Arduino December 06, 2010 07:17PM |
Registered: 17 years ago Posts: 1,094 |
Re: Project: FiveD on Arduino December 06, 2010 07:33PM |
Registered: 14 years ago Posts: 119 |
Re: Project: FiveD on Arduino December 06, 2010 08:02PM |
Registered: 17 years ago Posts: 1,094 |
Re: Project: FiveD on Arduino December 06, 2010 11:19PM |
Registered: 17 years ago Posts: 1,094 |
Re: Project: FiveD on Arduino December 06, 2010 11:32PM |
Registered: 14 years ago Posts: 71 |
Yes this is strange. I first noticed it in this post from cdriko and sure enough the next time I loaded a new version of the firmware it started happening to me. If this were caused by noise would it be so consistent? It happens every time and is always the same character. I would expect noise to be intermittent and not always the same character. I am not sure what strace is, but it sounds like I will be learning something new.Quote
I don't know what the character before Start would be, perhaps some noise from startup or something? strace may help you find out
Quote
Feel free to go through the code and manually enable any debug sections you think may be helpful
Quote
It appears that if I assign any pin on PORTC (DIO30-DIO37) for my stepper signals, the moves are not executed correctly if at all.
Re: Project: FiveD on Arduino December 07, 2010 01:55AM |
Registered: 17 years ago Posts: 1,094 |
Re: Project: FiveD on Arduino December 07, 2010 04:17AM |
Registered: 14 years ago Posts: 119 |
Re: Project: FiveD on Arduino December 07, 2010 11:26AM |
Registered: 17 years ago Posts: 900 |
Re: Project: FiveD on Arduino December 07, 2010 10:02PM |
Registered: 17 years ago Posts: 1,094 |
Re: Project: FiveD on Arduino December 07, 2010 11:30PM |
Registered: 14 years ago Posts: 71 |
Re: Project: FiveD on Arduino December 08, 2010 12:49AM |
Registered: 17 years ago Posts: 900 |
Re: Project: FiveD on Arduino December 08, 2010 02:55PM |
Registered: 14 years ago Posts: 155 |
Re: Project: FiveD on Arduino December 08, 2010 07:01PM |
Registered: 14 years ago Posts: 71 |
Re: Project: FiveD on Arduino December 08, 2010 07:51PM |
Registered: 14 years ago Posts: 155 |
Re: Project: FiveD on Arduino December 08, 2010 08:07PM |
Registered: 14 years ago Posts: 155 |
Re: Project: FiveD on Arduino December 09, 2010 05:30AM |
Registered: 17 years ago Posts: 900 |
Re: Project: FiveD on Arduino December 11, 2010 05:47AM |
Registered: 14 years ago Posts: 7,616 |
Quote
spaztik
The debug options don't fit on the 168 chip
Quote
Architect
ok X:3200,Y:3200,Z:0,E:0,F:50 // x never turned
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Project: FiveD on Arduino December 13, 2010 11:02AM |
Registered: 14 years ago Posts: 155 |
Re: Project: FiveD on Arduino December 13, 2010 12:24PM |
Registered: 17 years ago Posts: 74 |
Re: Project: FiveD on Arduino December 13, 2010 02:10PM |
Registered: 14 years ago Posts: 155 |
Re: Project: FiveD on Arduino December 13, 2010 04:00PM |
Registered: 17 years ago Posts: 1,094 |
Re: Project: FiveD on Arduino December 13, 2010 08:47PM |
Registered: 14 years ago Posts: 188 |
Re: Project: FiveD on Arduino December 14, 2010 06:04AM |
Registered: 14 years ago Posts: 7,616 |
default: // can't do ranges in switch..case, so process actual digits here if (c >= '0' && c <= '9' && read_digit.exponent < 5) {
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Project: FiveD on Arduino December 14, 2010 06:16AM |
Registered: 14 years ago Posts: 119 |
Re: Project: FiveD on Arduino December 14, 2010 05:50PM |
Registered: 14 years ago Posts: 7,616 |
// valid range: 0.001 to 4095.0 #define STEPS_PER_MM_X 320.000 /* Switch user friendly values to coding friendly values This also affects the possible build volume. We allow +-20 bits for the value and 12 bits for the STEPS_PER_MM multiplicator. Resolution in mm mode is 0.001 mm and 0.0001 in inch mode. So the step-accurate range is 2^20 mm / 1000 = +-1048 mm or 2^20 in / 10000 = +-104 in Regarding the multiplicator we extract the upper 12 _used_ bits, providing a resolution of 1 / 4096 = 0.000244 for both, mm and inch. At runtime, this extraxtion is reversed by shifting the calculated number of stepper motor steps by STEPS_xx_x_SHIFT bits to the left, leading to a result as accurate as possible with 32-bit integers (and more accurate than with 32-bit floats). */ #if (STEPS_PER_MM_X < 2^0) #define STEPS_MM_X_SHIFT 12 #elif ((STEPS_PER_MM_X < 2^1) #define STEPS_MM_X_SHIFT 11 #elif ((STEPS_PER_MM_X < 2^2) #define STEPS_MM_X_SHIFT 10 ... #elif ((STEPS_PER_MM_X < 2^11) #define STEPS_MM_X_SHIFT 1 #elif #define STEPS_MM_X_SHIFT 0 #endif #define STEPS_MM_X ((uint32_t) (STEPS_PER_MM_X * 2^STEPS_PER_X_SHIFT))
int32_t decfloat_to_int(decfloat *df, int16_t multiplicand, uint8_t shift) { uint32_t r = df->mantissa; r *= multiplicand; // 20 bits + 12 bits = 32 bits = safe // exponent=1 means we've seen a decimal point but no digits after it, and exponent=2 // means we've seen a decimal point with one digit so it's too high by one if not zero if (df->exponent == 2) r /= 10; else if (df->exponent == 3) r /= 100; else if (df->exponent == 4) r /= 1000; else if (df->exponent == 5) r /= 10000; r >>= shift; // sign if (df->sign) return -(int32_t)r; return (int32_t)r; }
next_target.target.X = decfloat_to_int(&read_digit, STEPS_MM_X, STEPS_MM_X_SHIFT);
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Project: FiveD on Arduino December 16, 2010 08:00PM |
Registered: 14 years ago Posts: 155 |
Re: Project: FiveD on Arduino December 18, 2010 07:32PM |
Registered: 14 years ago Posts: 28 |