Re: Project: Teacup Firmware April 28, 2011 06:25AM |
Registered: 16 years ago Posts: 900 |
Re: Project: Teacup Firmware April 29, 2011 11:48AM |
Registered: 16 years ago Posts: 1,094 |
Re: Project: Teacup Firmware April 29, 2011 03:10PM |
Registered: 13 years ago Posts: 64 |
Re: Project: Teacup Firmware April 29, 2011 09:08PM |
Registered: 16 years ago Posts: 1,094 |
Re: Project: Teacup Firmware April 30, 2011 02:55PM |
Re: Project: Teacup Firmware April 30, 2011 03:08PM |
Registered: 13 years ago Posts: 2,947 |
FFF Settings Calculator | Gcode post processors | Geometric Object Deposition Tool Blog |
Tantillus.org | Mini Printable Lathe | How NOT to install a Pololu driver |
Re: Project: Teacup Firmware April 30, 2011 05:52PM |
N4 G161 Z0*97 ok ok N5 M114*34 ok ok X:0.000,Y:75.350,Z:0.000,E:0.000,F:2000 N6 G92 Z-1.9*101 ok ok N7 M114*32 ok ok X:0.000,Y:75.350,Z:10322.536,E:0.000,F:2000 N8 G1 Z10*91 ok ok N9 M114*46 ok ok X:0.000,Y:75.350,Z:10.016,E:0.000,F:2000
Re: Project: Teacup Firmware May 01, 2011 02:47AM |
Registered: 16 years ago Posts: 1,094 |
diff --git a/gcode_process.c b/gcode_process.c index 45cb5dd..098a978 100644 --- a/gcode_process.c +++ b/gcode_process.c @@ -393,7 +393,7 @@ void process_gcode_command() { // M113- extruder PWM // M114- report XYZEF to host case 114: - sersendf_P(PSTR("X:%lq,Y:%lq,Z:%lq,E:%lq,F:%ld"), current_position.X * UM_PER_STEP_X, current_position.Y * UM_PER_STEP_Y, current_position.Z * UM_PER_STEP_Z, current_position.E * UM_PER_STEP_E, current_position.F); + sersendf_P(PSTR("X:%lq,Y:%lq,Z:%lq,E:%lq,F:%ld"), current_position.X * ((int32_t) UM_PER_STEP_X), current_position.Y * ((int32_t) UM_PER_STEP_Y), current_position.Z * ((int32_t) UM_PER_STEP_Z), current_position.E * ((int32_t) UM_PER_STEP_E), current_position.F); // newline is sent from gcode_parse after we return break; // M115- capabilities string
sliptonic
Re: Project: Teacup Firmware May 01, 2011 02:26PM |
N4 G92 Z-1.9*103 ok ok N5 M114*34 ok ok X:0.000,Y:72.324,Z:-1.584,E:0.000,F:2000
Re: Project: Teacup Firmware May 01, 2011 11:30PM |
Registered: 16 years ago Posts: 1,094 |
diff --git a/gcode_process.c b/gcode_process.c index 098a978..d707902 100644 --- a/gcode_process.c +++ b/gcode_process.c @@ -393,7 +393,27 @@ void process_gcode_command() { // M113- extruder PWM // M114- report XYZEF to host case 114: - sersendf_P(PSTR("X:%lq,Y:%lq,Z:%lq,E:%lq,F:%ld"), current_position.X * ((int32_t) UM_PER_STEP_X), current_position.Y * ((int32_t) UM_PER_STEP_Y), current_position.Z * ((int32_t) UM_PER_STEP_Z), current_position.E * ((int32_t) UM_PER_STEP_E), current_position.F); + do { + int32_t x_um, y_um, z_um, e_um; + // we can't multiply by 1000 if position is bigger than 2^22 or we'll overflow + if (current_position.X & 0x7FC00000) // labs(current_position.X) >= 2^22 + x_um = (current_position.X / ((int32_t) STEPS_PER_MM_X)) * 1000L; + else + x_um = current_position.X * 1000L / ((int32_t) STEPS_PER_MM_X); + if (current_position.Y & 0x7FC00000) // labs(current_position.Y) >= 2^22 + y_um = (current_position.Y / ((int32_t) STEPS_PER_MM_Y)) * 1000L; + else + y_um = current_position.Y * 1000L / ((int32_t) STEPS_PER_MM_Y); + if (current_position.Z & 0x7FC00000) // labs(current_position.Z) >= 2^22 + z_um = (current_position.Z / ((int32_t) STEPS_PER_MM_Z)) * 1000L; + else + z_um = current_position.Z * 1000L / ((int32_t) STEPS_PER_MM_Z); + if (current_position.E & 0x7FC00000) // labs(current_position.E) >= 2^22 + e_um = (current_position.E / ((int32_t) STEPS_PER_MM_E)) * 1000L; + else + e_um = current_position.E * 1000L / ((int32_t) STEPS_PER_MM_E); + sersendf_P(PSTR("X:%lq,Y:%lq,Z:%lq,E:%lq,F:%ld"), x_um, y_um, z_um, e_um, current_position.F); + } while (0) // newline is sent from gcode_parse after we return break; // M115- capabilities string
Re: Project: Teacup Firmware May 02, 2011 07:29PM |
Admin Registered: 17 years ago Posts: 7,879 |
Re: Project: Teacup Firmware May 02, 2011 08:57PM |
Registered: 16 years ago Posts: 1,094 |
Re: Project: Teacup Firmware May 08, 2011 11:22AM |
Registered: 16 years ago Posts: 15 |
In file included from gcode_process.c:20: pinio.h:42:20: error: macro "power_off" passed 1 arguments, but takes just 0
Re: Project: Teacup Firmware May 08, 2011 01:44PM |
Registered: 13 years ago Posts: 2,947 |
Re: Project: Teacup Firmware May 08, 2011 03:14PM |
Registered: 14 years ago Posts: 196 |
Re: Project: Teacup Firmware May 08, 2011 04:18PM |
Registered: 13 years ago Posts: 155 |
Re: Project: Teacup Firmware May 08, 2011 05:45PM |
Registered: 16 years ago Posts: 1,094 |
Re: Project: Teacup Firmware May 09, 2011 03:34AM |
Registered: 13 years ago Posts: 7,616 |
Quote
there's no gen7 config in our repository.
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Project: Teacup Firmware May 09, 2011 12:42PM |
Re: Project: Teacup Firmware May 09, 2011 09:29PM |
Registered: 16 years ago Posts: 1,094 |
diff --git a/dda_queue.c b/dda_queue.c index 5bc87be..8a37ae1 100644 --- a/dda_queue.c +++ b/dda_queue.c @@ -28,12 +28,20 @@ DDA movebuffer[MOVEBUFFER_SIZE] __attribute__ ((__section__ (".bss"))); /// check if the queue is completely full uint8_t queue_full() { - return (((mb_tail - mb_head - 1) & (MOVEBUFFER_SIZE - 1)) == 0)?255:0; + uint8_t sreg = SREG, r; + cli(); + r = (((mb_tail - mb_head - 1) & (MOVEBUFFER_SIZE - 1)) == 0)?255:0; + SREG = sreg; + return r; } /// check if the queue is completely empty uint8_t queue_empty() { - return ((mb_tail == mb_head) && (movebuffer[mb_tail].live == 0))?255:0; + uint8_t sreg = SREG, r; + cli(); + r = ((mb_tail == mb_head) && (movebuffer[mb_tail].live == 0))?255:0; + SREG = sreg; + return r; } // ------------------------------------------------------- @@ -95,9 +103,15 @@ void enqueue(TARGET *t) { mb_head = h; + uint8_t sreg = SREG; + cli(); // fire up in case we're not running yet - if (movebuffer[mb_tail].live == 0) + if (movebuffer[mb_tail].live == 0) { + SREG = sreg; next_move(); + } + else + SREG = sreg; } /// go to the next move. @@ -144,6 +158,9 @@ void queue_flush() { mb_tail = mb_head; movebuffer[mb_head].live = 0; + // disable timer + setTimer(0); + // restore interrupt flag SREG = sreg; } diff --git a/dda.c b/dda.c index 952c86b..846af3a 100644 --- a/dda.c +++ b/dda.c @@ -565,6 +545,8 @@ void dda_step(DDA *dda) { z_disable(); } + cli(); + setTimer(dda->c >> 8); // turn off step outputs, hopefully they've been on long enough by now to register with the drivers
Re: Project: Teacup Firmware May 09, 2011 10:38PM |
Registered: 16 years ago Posts: 1,094 |
Re: Project: Teacup Firmware May 09, 2011 10:53PM |
Registered: 16 years ago Posts: 1,094 |
Re: Project: Teacup Firmware May 10, 2011 06:22AM |
M111 S6 G21 ;metric is good! G90 ;absolute positioning G92 X0 Y0 Z0 (You are now at 0,0,0) G1 F2000 G1 X38.9 Y40.73 Z0.85 F180.0 ( problem here? ) G1 X37.81 Y39.98 Z0.85 F1920.0 G4 G1 X0 Y0 F2000and here is the resulting conversation between host and motherboard. I found that changing F180.0 to F1080.0 (or something like) solves the problem. But this G1 line alone do not cause any freezing even with F180.0. Strange..
Re: Project: Teacup Firmware May 11, 2011 01:19AM |
Registered: 13 years ago Posts: 11 |
Re: Project: Teacup Firmware May 11, 2011 02:15AM |
Registered: 13 years ago Posts: 7,616 |
case 161: queue_wait(); <-------- INSERTED THIS if (next_target.seen_X) home_x_negative();Looking at home_x_negative() in home.c, there is already a queue_wait(), so I wonder what makes the difference?
Generation 7 Electronics | Teacup Firmware | RepRap DIY |
Re: Project: Teacup Firmware May 11, 2011 02:30AM |
Registered: 16 years ago Posts: 1,094 |
Re: Project: Teacup Firmware May 11, 2011 10:06AM |
Registered: 14 years ago Posts: 196 |
Re: Project: Teacup Firmware May 11, 2011 10:15AM |
Registered: 13 years ago Posts: 11 |
Re: Project: Teacup Firmware May 11, 2011 11:12PM |
Registered: 14 years ago Posts: 196 |
#ifdef ACCELERATION_REPRAP // linear acceleration magic, courtesy of [www.embedded.com] if (dda->accel) { if ( ((dda->n > 0) && (dda->c > dda->end_c)) || ((dda->n < 0) && (dda->c < dda->end_c)) ) { dda->c = (int32_t) dda->c - ((int32_t) (dda->c * 2) / dda->n); dda->n += 4; } else if (dda->c != dda->end_c) { dda->c = dda->end_c; } // else we are already at target speed } #endifwith
#ifdef ACCELERATION_REPRAP // linear acceleration magic, courtesy of [www.embedded.com] if (dda->accel) { if ( (dda->c > dda->end_c) && ( dda->n > 0) ) { uint32_t increment = (dda->c * 2) / dda->n; if( increment < dda->c ) { dda->c = dda->c - increment; if( dda->c < dda->end_c ) { dda->c = dda->end_c; } else { dda->n += 4; } } else { dda->c = dda->end_c; } } else if ( (dda->c < dda->end_c) && ( dda->n < 0) ) { uint32_t increment = (dda->c * 2) / (-dda->n); if( dda->c + increment >= dda->c ) { dda->c = dda->c + increment; if( dda->c > dda->end_c ) { dda->c = dda->end_c; } else if( dda->n < -5 ) { dda->n += 4; } } else { dda->c = dda->end_c; } } else if (dda->c != dda->end_c) { dda->c = dda->end_c; } // else we are already at target speed } #endifI was able to reproduce the problem and was able to verify that the above fixes the specific problem.
Re: Project: Teacup Firmware May 12, 2011 12:14AM |