Assi CNC grbl vanno solo in positivo

Grazie di esistere a tutta la comunity!! Sono Newbie, so ancora poco di elettronica e pochissimo di programmazione.
Ho preso una Arduino UNO Rev3
Due stepperDriver TB6600 /HY-DEV268N
6 motori passo passo FA23C22S4R (1,8°; 0,6A) Mikroma (poland)
2 motori in parallelo su asse Y
4 motori in parallelo su asse X
Ho scaricato arduino IDE 2.0.4
Ho scaricato grbl (sia 0.9j) 1.1h
Ho scaricato UGS 2.0.12
Su arduino UNO: Dir-, Pulse-, En-, tutti collegati su GND

UGS vede grbl su COM3 Baudrate 115200 ma ho diversi problemi:
Non fa home (nessuno dei 2 assi)
non funzionano i clicker fine corsa, nè X nè Y. (Ho provato sia 2 fine corsa in parallelo sullo stesso pin che un solo fine corsa collegato: niente)
Non comanda asse X - (non va in negativo) anche dopo diversi movimenti in +
Non comanda asse Y - (non va in negativo) anche dopo diversi movimenti in +
Non risponde alla freccia (45gradi) che andrebbe a movimentare X ed Y assieme
Non mi comanda asse X ( pin 2 pin5 ) (per far muovere x ho cambiato il pin con asse Z che non ho in uso, la macchina sarebbe una taglia polistirolo 2D a solo 2 assi)

Cosa funziona:
Motori asse Y si muovono solo in Y+ in positivo
Motori asse X si muovono solo in X+ in positivo

Suggerimenti? Ho una macchina da 2,5 metri per 1,5 per 0,7 per fare lettere giganti ma non mi funzia.

Molti video che ho visto, scaricano, installano aprono e la cnc TRE assi risponde: AIUTO

Buonasera e benvenuto nella sezione Italiana del forum,

:warning: prima di tutto ti segnalo che, nella sezione in lingua Inglese, si può scrivere SOLO in Inglese ... quindi, per favore, la prossima volta presta più attenzione in quale sezione metti i tuoi post; questa volta esso è stato spostato, da un moderatore della sezione di lingua Inglese, nella sezione di lingua Italiana ... la prossima volta potrebbe venire direttamente eliminato, dopo di che ...

... cortesemente, leggi attentamente il REGOLAMENTO di detta sezione, (... e, per evitare future possibili discussioni/incomprensioni, prestando molta attenzione al punto 15) e poi, come da suddetto regolamento (punto 16.7), fai la tua presentazione NELL'APPOSITA DISCUSSIONE spiegando bene quali esperienze hai in elettronica e programmazione, affinché noi possiamo conoscere la tua esperienza ed esprimerci con termini adeguati.

Grazie,

Guglielmo

P.S.: Ti ricordo che, purtroppo, fino a quando non sarà fatta la presentazione nell’apposita discussione, nel rispetto del succitato regolamento nessuno ti risponderà (eventuali risposte o tuoi ulteriori post, verrebbero temporaneamente nascosti), quindi ti consiglio di farla al più presto. :wink:

1 Like

Grazie per l’ appunto, mi impegnerò per poter seguire al meglio i regolamenti del forum nel rispetto della community intera, ho ancora molto da imparare e tutta la buona volontà di farlo, in tanto ho tradotto al mio meglio il post in inglese.

Gentile Sig. Guglielmo, ringraziandola ancora della sua cortesia, temo di aver fatto nel buon proposito di correggermi un nuovo errore, ho tradotto in un inglese spero funzionale un post che era già stato spostato, spero di poter “far basta con questi errori da evidente principiante al più presto” grazie per la pazienza.

... ho rimesso il testo originale Italiano nella giusta sezione del forum Italiano :wink:

Ora manca solo la tua presentazione NELL'APPOSITA DISCUSSIONE dove spieghi bene quali esperienze hai in elettronica e programmazione, affinché noi possiamo conoscere la tua esperienza ed esprimerci con termini adeguati.

Guglielmo

Mmmm ... NON sono né un esperto di GRBL né di CNC e quindi sono andato a guardare QUI la pagina di quel driver ... hai seguito questo collegamento?


Stai usando l'ultima versione della libreria stepper?

Un ultimo suggerimento, butta via l'IDE 2.0.4 ... per me è poco più di una beta e NON lo ritengo affidabile ed installa la versione legacy 1.8.19 (la trovi QUI verso il fondo della pagina) che è la più stabile ed affidabile. Ah, mi raccomando, sempre la versione .zip e non la versione .exe ... scompatti lo zip e metti la cartella Arduino in una tua cartella dove hai tutti i diritti di lettura/scrittura :wink:

Guglielmo

1 Like

Grazie mille per il suggerimento:
cambiando IDE ed eseguendola come amministratore, caricando l' esatto firmware GRBL che avevo son venuti fuori errori che con la IDE precedente non comparivano.

In file included from C:\Users\tomma\Documents\Arduino\libraries\grbl/grbl.h:43:0,
                 from C:\Users\tomma\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:
C:\Users\tomma\Documents\Arduino\libraries\grbl/nuts_bolts.h:56:0: warning: "max" redefined
 #define max(a,b) (((a) > (b)) ? (a) : (b))
 
In file included from sketch\grblUpload.ino.cpp:1:0:
C:\Users\tomma\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:93:0: note: this is the location of the previous definition
 #define max(a,b) ((a)>(b)?(a):(b))
 
In file included from C:\Users\tomma\Documents\Arduino\libraries\grbl/grbl.h:43:0,
                 from C:\Users\tomma\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:
C:\Users\tomma\Documents\Arduino\libraries\grbl/nuts_bolts.h:57:0: warning: "min" redefined
 #define min(a,b) (((a) < (b)) ? (a) : (b))
 
In file included from sketch\grblUpload.ino.cpp:1:0:
C:\Users\tomma\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:92:0: note: this is the location of the previous definition
 #define min(a,b) ((a)<(b)?(a):(b))
 
In file included from C:\Users\tomma\Documents\Arduino\libraries\grbl/grbl.h:43:0,
                 from C:\Users\tomma\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:
C:\Users\tomma\Documents\Arduino\libraries\grbl/nuts_bolts.h:61:0: warning: "bit" redefined
 #define bit(n) (1 << n)
 
In file included from sketch\grblUpload.ino.cpp:1:0:
C:\Users\tomma\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:124:0: note: this is the location of the previous definition
 #define bit(b) (1UL << (b))
 
C:\Users\tomma\Documents\Arduino\libraries\grbl\gcode.c: In function 'gc_execute_line':
C:\Users\tomma\Documents\Arduino\libraries\grbl\gcode.c:307:60: error: 'Z_AXIS' undeclared (first use in this function); did you mean 'Y_AXIS'?
           case 'K': word_bit = WORD_K; gc_block.values.ijk[Z_AXIS] = value; ijk_words |= (1<<Z_AXIS); break;
                                                            ^~~~~~
                                                            Y_AXIS
C:\Users\tomma\Documents\Arduino\libraries\grbl\gcode.c:307:60: note: each undeclared identifier is reported only once for each function it appears in
In file included from C:\Users\tomma\Documents\Arduino\libraries\grbl\grbl.h:42:0,
                 from C:\Users\tomma\Documents\Arduino\libraries\grbl\report.c:29:
C:\Users\tomma\Documents\Arduino\libraries\grbl\report.c: In function 'report_realtime_status':
C:\Users\tomma\Documents\Arduino\libraries\grbl\config.h:333:33: error: 'Z_AXIS' undeclared (first use in this function); did you mean 'Y_AXIS'?
 #define TOOL_LENGTH_OFFSET_AXIS Z_AXIS // Default z-axis. Valid values are X_AXIS, Y_AXIS, or Z_AXIS.
                                 ^
C:\Users\tomma\Documents\Arduino\libraries\grbl\report.c:515:18: note: in expansion of macro 'TOOL_LENGTH_OFFSET_AXIS'
       if (idx == TOOL_LENGTH_OFFSET_AXIS) { wco[idx] += gc_state.tool_length_offset; }
                  ^~~~~~~~~~~~~~~~~~~~~~~
C:\Users\tomma\Documents\Arduino\libraries\grbl\config.h:333:33: note: each undeclared identifier is reported only once for each function it appears in
 #define TOOL_LENGTH_OFFSET_AXIS Z_AXIS // Default z-axis. Valid values are X_AXIS, Y_AXIS, or Z_AXIS.
                                 ^
C:\Users\tomma\Documents\Arduino\libraries\grbl\report.c:515:18: note: in expansion of macro 'TOOL_LENGTH_OFFSET_AXIS'
       if (idx == TOOL_LENGTH_OFFSET_AXIS) { wco[idx] += gc_state.tool_length_offset; }
                  ^~~~~~~~~~~~~~~~~~~~~~~
exit status 1
Errore durante la compilazione per la scheda Arduino Uno.

e qui confesso che inizia ad essere complicato, suggerimenti?

Uuuuhhh ... molto strano, sai indicarmi i link alle varie cose che stai usando? librerie, programma, ecc. ecc. perché sembra esserci qualche incompatibilità ... così gli diamo un'occhiata ... :roll_eyes:

Guglielmo

Ancora grazie grazie,
ho provato a caricare il firmware grbl che caricavo prima ed il risultato è il medesimo solo X ed Y in direzione positiva, in negativo nessuna risposta (magari era proprio questo il problema ma con l' ide che usavo prima non venivano fuori gli errori. Dunque:
grbl
UniversalGCodeSender
giusto per allego anche il codice di due (per mia ignoranza chiamerò fogli)

il primo che segue è il file cpuMap (dove ho modificato la piedinatura Z per muovere asse X)

/*
  cpu_map.h - CPU and pin mapping configuration file
  Part of Grbl

  Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC

  Grbl is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Grbl is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
*/

/* The cpu_map.h files serve as a central pin mapping selection file for different
   processor types or alternative pin layouts. This version of Grbl officially supports
   only the Arduino Mega328p. */


#ifndef cpu_map_h
#define cpu_map_h


#ifdef CPU_MAP_ATMEGA328P // (Arduino Uno) Officially supported by Grbl.

  // Define serial port pins and interrupt vectors.
  #define SERIAL_RX     USART_RX_vect
  #define SERIAL_UDRE   USART_UDRE_vect

  // Define step pulse output pins. NOTE: All step bit pins must be on the same port.
  #define STEP_DDR        DDRD
  #define STEP_PORT       PORTD
  #define X_STEP_BIT      4  // Uno Digital Pin 2 (invertito con Z, era 2)
  #define Y_STEP_BIT      3  // Uno Digital Pin 3
  #define Z_STEP_BIT      2  // Uno Digital Pin 4 (invertito con Z, era 4)
  #define STEP_MASK       ((1<<X_STEP_BIT)|(1<<Y_STEP_BIT)|(1<<Z_STEP_BIT)) // All step bits

  // Define step direction output pins. NOTE: All direction pins must be on the same port.
  #define DIRECTION_DDR     DDRD
  #define DIRECTION_PORT    PORTD
  #define X_DIRECTION_BIT   7  // Uno Digital Pin 5 (invertito con Z, era 5)
  #define Y_DIRECTION_BIT   6  // Uno Digital Pin 6
  #define Z_DIRECTION_BIT   5  // Uno Digital Pin 7 (invertito con Z, era 7)
  #define DIRECTION_MASK    ((1<<X_DIRECTION_BIT)|(1<<Y_DIRECTION_BIT)|(1<<Z_DIRECTION_BIT)) // All direction bits

  // Define stepper driver enable/disable output pin.
  #define STEPPERS_DISABLE_DDR    DDRB
  #define STEPPERS_DISABLE_PORT   PORTB
  #define STEPPERS_DISABLE_BIT    8  // Uno Digital Pin 8 (MODIFICATO DA 0 A 8, PROVA 1 ANCHE)
  #define STEPPERS_DISABLE_MASK   (1<<STEPPERS_DISABLE_BIT)

  // Define homing/hard limit switch input pins and limit interrupt vectors.
  // NOTE: All limit bit pins must be on the same port, but not on a port with other input pins (CONTROL).
  #define LIMIT_DDR        DDRB
  #define LIMIT_PIN        PINB
  #define LIMIT_PORT       PORTB
  #define X_LIMIT_BIT      1  // Uno Digital Pin 9
  #define Y_LIMIT_BIT      2  // Uno Digital Pin 10
  #ifdef VARIABLE_SPINDLE // Z Limit pin and spindle enabled swapped to access hardware PWM on Pin 11.
  #define Z_LIMIT_BIT	   11 // Uno Digital Pin 12 // (era "comment")
  #else
  #define Z_LIMIT_BIT      11  // Uno Digital Pin 11 (era "comment")
  #endif
  #if !defined(ENABLE_DUAL_AXIS)
    #define LIMIT_MASK     ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)) // All limit bits
  #endif
  #define LIMIT_INT        PCIE0  // Pin change interrupt enable pin
  #define LIMIT_INT_vect   PCINT0_vect
  #define LIMIT_PCMSK      PCMSK0 // Pin change interrupt register

  // Define user-control controls (cycle start, reset, feed hold) input pins.
  // NOTE: All CONTROLs pins must be on the same port and not on a port with other input pins (limits).
  #define CONTROL_DDR       DDRC
  #define CONTROL_PIN       PINC
  #define CONTROL_PORT      PORTC
  #define CONTROL_RESET_BIT         0  // Uno Analog Pin 0
  #define CONTROL_FEED_HOLD_BIT     1  // Uno Analog Pin 1
  #define CONTROL_CYCLE_START_BIT   2  // Uno Analog Pin 2
  #define CONTROL_SAFETY_DOOR_BIT   1  // Uno Analog Pin 1 NOTE: Safety door is shared with feed hold. Enabled by config define.
  #define CONTROL_INT       PCIE1  // Pin change interrupt enable pin
  #define CONTROL_INT_vect  PCINT1_vect
  #define CONTROL_PCMSK     PCMSK1 // Pin change interrupt register
  #define CONTROL_MASK      ((1<<CONTROL_RESET_BIT)|(1<<CONTROL_FEED_HOLD_BIT)|(1<<CONTROL_CYCLE_START_BIT)|(1<<CONTROL_SAFETY_DOOR_BIT))
  #define CONTROL_INVERT_MASK   CONTROL_MASK // May be re-defined to only invert certain control pins.

  // Define probe switch input pin.
  #define PROBE_DDR       DDRC
  #define PROBE_PIN       PINC
  #define PROBE_PORT      PORTC
  #define PROBE_BIT       5  // Uno Analog Pin 5
  #define PROBE_MASK      (1<<PROBE_BIT)

  #if !defined(ENABLE_DUAL_AXIS)

    // Define flood and mist coolant enable output pins.
    #define COOLANT_FLOOD_DDR   DDRC
    #define COOLANT_FLOOD_PORT  PORTC
    #define COOLANT_FLOOD_BIT   3  // Uno Analog Pin 3
    #define COOLANT_MIST_DDR   DDRC
    #define COOLANT_MIST_PORT  PORTC
    #define COOLANT_MIST_BIT   4  // Uno Analog Pin 4

    // Define spindle enable and spindle direction output pins.
    #define SPINDLE_ENABLE_DDR    DDRB
    #define SPINDLE_ENABLE_PORT   PORTB
    // Z Limit pin and spindle PWM/enable pin swapped to access hardware PWM on Pin 11.
    #ifdef VARIABLE_SPINDLE
      #ifdef USE_SPINDLE_DIR_AS_ENABLE_PIN
        // If enabled, spindle direction pin now used as spindle enable, while PWM remains on D11.
        #define SPINDLE_ENABLE_BIT    5  // Uno Digital Pin 13 (NOTE: D13 can't be pulled-high input due to LED.)
      #else
        #define SPINDLE_ENABLE_BIT    3  // Uno Digital Pin 11
      #endif
    #else
      #define SPINDLE_ENABLE_BIT    4  // Uno Digital Pin 12
    #endif
    #ifndef USE_SPINDLE_DIR_AS_ENABLE_PIN
      #define SPINDLE_DIRECTION_DDR   DDRB
      #define SPINDLE_DIRECTION_PORT  PORTB
      #define SPINDLE_DIRECTION_BIT   5  // Uno Digital Pin 13 (NOTE: D13 can't be pulled-high input due to LED.)
    #endif

    // Variable spindle configuration below. Do not change unless you know what you are doing.
    // NOTE: Only used when variable spindle is enabled.
    #define SPINDLE_PWM_MAX_VALUE     255 // Don't change. 328p fast PWM mode fixes top value as 255.
    #ifndef SPINDLE_PWM_MIN_VALUE
      #define SPINDLE_PWM_MIN_VALUE   1   // Must be greater than zero.
    #endif
    #define SPINDLE_PWM_OFF_VALUE     0
    #define SPINDLE_PWM_RANGE         (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE)
    #define SPINDLE_TCCRA_REGISTER    TCCR2A
    #define SPINDLE_TCCRB_REGISTER    TCCR2B
    #define SPINDLE_OCR_REGISTER      OCR2A
    #define SPINDLE_COMB_BIT          COM2A1

    // Prescaled, 8-bit Fast PWM mode.
    #define SPINDLE_TCCRA_INIT_MASK   ((1<<WGM20) | (1<<WGM21))  // Configures fast PWM mode.
    // #define SPINDLE_TCCRB_INIT_MASK   (1<<CS20)               // Disable prescaler -> 62.5kHz
    // #define SPINDLE_TCCRB_INIT_MASK   (1<<CS21)               // 1/8 prescaler -> 7.8kHz (Used in v0.9)
    // #define SPINDLE_TCCRB_INIT_MASK   ((1<<CS21) | (1<<CS20)) // 1/32 prescaler -> 1.96kHz
    #define SPINDLE_TCCRB_INIT_MASK      (1<<CS22)               // 1/64 prescaler -> 0.98kHz (J-tech laser)

    // NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings.
    #define SPINDLE_PWM_DDR   DDRB
    #define SPINDLE_PWM_PORT  PORTB
    #define SPINDLE_PWM_BIT   3    // Uno Digital Pin 11
  
  #else

    // Dual axis feature requires an independent step pulse pin to operate. The independent direction pin is not 
    // absolutely necessary but facilitates easy direction inverting with a Grbl $$ setting. These pins replace 
    // the spindle direction and optional coolant mist pins.

    #ifdef DUAL_AXIS_CONFIG_PROTONEER_V3_51
      // NOTE: Step pulse and direction pins may be on any port and output pin.
      #define STEP_DDR_DUAL       DDRC
      #define STEP_PORT_DUAL      PORTC
      #define DUAL_STEP_BIT       4  // Uno Analog Pin 4
      #define STEP_MASK_DUAL      ((1<<DUAL_STEP_BIT))
      #define DIRECTION_DDR_DUAL  DDRC
      #define DIRECTION_PORT_DUAL PORTC
      #define DUAL_DIRECTION_BIT  3  // Uno Analog Pin 3
      #define DIRECTION_MASK_DUAL ((1<<DUAL_DIRECTION_BIT))

      // NOTE: Dual axis limit is shared with the z-axis limit pin by default. Pin used must be on the same port
      // as other limit pins.
      #define DUAL_LIMIT_BIT    Z_LIMIT_BIT
      #define LIMIT_MASK        ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<DUAL_LIMIT_BIT))

      // Define coolant enable output pins.
      // NOTE: Coolant flood moved from A3 to A4. Coolant mist not supported with dual axis feature on Arduino Uno.
      #define COOLANT_FLOOD_DDR   DDRB
      #define COOLANT_FLOOD_PORT  PORTB
      #define COOLANT_FLOOD_BIT   5  // Uno Digital Pin 13

      // Define spindle enable output pin.
      // NOTE: Spindle enable moved from D12 to A3 (old coolant flood enable pin). Spindle direction pin is removed.
      #define SPINDLE_ENABLE_DDR    DDRB
      #define SPINDLE_ENABLE_PORT   PORTB
      #ifdef VARIABLE_SPINDLE
        // NOTE: USE_SPINDLE_DIR_AS_ENABLE_PIN not supported with dual axis feature.
        #define SPINDLE_ENABLE_BIT    3  // Uno Digital Pin 11
      #else
        #define SPINDLE_ENABLE_BIT    4  // Uno Digital Pin 12
      #endif

      // Variable spindle configuration below. Do not change unless you know what you are doing.
      // NOTE: Only used when variable spindle is enabled.
      #define SPINDLE_PWM_MAX_VALUE     255 // Don't change. 328p fast PWM mode fixes top value as 255.
      #ifndef SPINDLE_PWM_MIN_VALUE
        #define SPINDLE_PWM_MIN_VALUE   1   // Must be greater than zero.
      #endif
      #define SPINDLE_PWM_OFF_VALUE     0
      #define SPINDLE_PWM_RANGE         (SPINDLE_PWM_MAX_VALUE-SPINDLE_PWM_MIN_VALUE)
      #define SPINDLE_TCCRA_REGISTER    TCCR2A
      #define SPINDLE_TCCRB_REGISTER    TCCR2B
      #define SPINDLE_OCR_REGISTER      OCR2A
      #define SPINDLE_COMB_BIT          COM2A1

      // Prescaled, 8-bit Fast PWM mode.
      #define SPINDLE_TCCRA_INIT_MASK   ((1<<WGM20) | (1<<WGM21))  // Configures fast PWM mode.
      // #define SPINDLE_TCCRB_INIT_MASK   (1<<CS20)               // Disable prescaler -> 62.5kHz
      // #define SPINDLE_TCCRB_INIT_MASK   (1<<CS21)               // 1/8 prescaler -> 7.8kHz (Used in v0.9)
      // #define SPINDLE_TCCRB_INIT_MASK   ((1<<CS21) | (1<<CS20)) // 1/32 prescaler -> 1.96kHz
      #define SPINDLE_TCCRB_INIT_MASK      (1<<CS22)               // 1/64 prescaler -> 0.98kHz (J-tech laser)

      // NOTE: On the 328p, these must be the same as the SPINDLE_ENABLE settings.
      #define SPINDLE_PWM_DDR   DDRB
      #define SPINDLE_PWM_PORT  PORTB
      #define SPINDLE_PWM_BIT   3    // Uno Digital Pin 11
    #endif

    // NOTE: Variable spindle not supported with this shield.
    #ifdef DUAL_AXIS_CONFIG_CNC_SHIELD_CLONE
      // NOTE: Step pulse and direction pins may be on any port and output pin.
      #define STEP_DDR_DUAL       DDRB
      #define STEP_PORT_DUAL      PORTB
      #define DUAL_STEP_BIT       4  // Uno Digital Pin 12
      #define STEP_MASK_DUAL      ((1<<DUAL_STEP_BIT))
      #define DIRECTION_DDR_DUAL  DDRB
      #define DIRECTION_PORT_DUAL PORTB
      #define DUAL_DIRECTION_BIT  5  // Uno Digital Pin 13
      #define DIRECTION_MASK_DUAL ((1<<DUAL_DIRECTION_BIT))

      // NOTE: Dual axis limit is shared with the z-axis limit pin by default.
      #define DUAL_LIMIT_BIT    Z_LIMIT_BIT
      #define LIMIT_MASK        ((1<<X_LIMIT_BIT)|(1<<Y_LIMIT_BIT)|(1<<Z_LIMIT_BIT)|(1<<DUAL_LIMIT_BIT))

      // Define coolant enable output pins.
      // NOTE: Coolant flood moved from A3 to A4. Coolant mist not supported with dual axis feature on Arduino Uno.
      #define COOLANT_FLOOD_DDR   DDRC
      #define COOLANT_FLOOD_PORT  PORTC
      #define COOLANT_FLOOD_BIT   4  // Uno Analog Pin 4

      // Define spindle enable output pin.
      // NOTE: Spindle enable moved from D12 to A3 (old coolant flood enable pin). Spindle direction pin is removed.
      #define SPINDLE_ENABLE_DDR    DDRC
      #define SPINDLE_ENABLE_PORT   PORTC
      #define SPINDLE_ENABLE_BIT    3  // Uno Analog Pin 3
    #endif

  #endif

#endif

/*
#ifdef CPU_MAP_CUSTOM_PROC
  // For a custom pin map or different processor, copy and edit one of the available cpu
  // map files and modify it to your needs. Make sure the defined name is also changed in
  // the config.h file.
#endif
*/

#endif

poi di seguito invece condivido il foglio segnalato nel riquadro errori di compilazione:

/*
  nuts_bolts.h - Header file for shared definitions, variables, and functions
  Part of Grbl

  Copyright (c) 2011-2016 Sungeun K. Jeon for Gnea Research LLC
  Copyright (c) 2009-2011 Simen Svale Skogsrud

  Grbl is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  Grbl is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with Grbl.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef nuts_bolts_h
#define nuts_bolts_h

#define false 0
#define true 1

#define SOME_LARGE_VALUE 1.0E+38

// Axis array index values. Must start with 0 and be continuous.
#define N_AXIS 2 // Number of axes (era 3, modificatoo Bog)
#define X_AXIS 0 // Axis indexing value.
#define Y_AXIS 1
//#define Z_AXIS 2 // Era comment (modificato su uncomment Bog)
// #define A_AXIS 3

// CoreXY motor assignments. DO NOT ALTER.
// NOTE: If the A and B motor axis bindings are changed, this effects the CoreXY equations.
#ifdef COREXY
 #define A_MOTOR X_AXIS // Must be X_AXIS
 #define B_MOTOR Y_AXIS // Must be Y_AXIS
#endif

// Conversions
#define MM_PER_INCH (25.40)
#define INCH_PER_MM (0.0393701)
#define TICKS_PER_MICROSECOND (F_CPU/1000000)

#define DELAY_MODE_DWELL       0
#define DELAY_MODE_SYS_SUSPEND 1

// Useful macros
#define clear_vector(a) memset(a, 0, sizeof(a))
#define clear_vector_float(a) memset(a, 0.0, sizeof(float)*N_AXIS)
#define clear_vector_long(a) memset(a, 0.0, sizeof(long)*N_AXIS) // (era uncomment, modificato Bog)
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define isequal_position_vector(a,b) !(memcmp(a, b, sizeof(float)*N_AXIS))

// Bit field and masking macros
#define bit(n) (1 << n)
#define bit_true(x,mask) (x) |= (mask)
#define bit_false(x,mask) (x) &= ~(mask)
#define bit_istrue(x,mask) ((x & mask) != 0)
#define bit_isfalse(x,mask) ((x & mask) == 0)

// Read a floating point value from a string. Line points to the input buffer, char_counter
// is the indexer pointing to the current character of the line, while float_ptr is
// a pointer to the result variable. Returns true when it succeeds
uint8_t read_float(char *line, uint8_t *char_counter, float *float_ptr);

// Non-blocking delay function used for general operation and suspend features.
void delay_sec(float seconds, uint8_t mode);

// Delays variable-defined milliseconds. Compiler compatibility fix for _delay_ms().
void delay_ms(uint16_t ms);

// Delays variable-defined microseconds. Compiler compatibility fix for _delay_us().
void delay_us(uint32_t us);

// Computes hypotenuse, avoiding avr-gcc's bloated version and the extra error checking.
float hypot_f(float x, float y);

float convert_delta_vector_to_unit_vector(float *vector);
float limit_value_by_axis_maximum(float *max_value, float *unit_vec);

#endif

spero sia esaustivo :slight_smile:

Aggiornato
Updated

2 Likes

Come ti ha suggerito @Ballscrewbob controlla bene le connessioni tra il driver ed il motore perché il cablaggio più comune con i piccoli stepper nema17 che si trovano online è questo:

image

Se fai attenzione, i pin centrali sul connettore del motore sono invertiti rispetto all'immagine che ha caricato Guglielmo.
Per esserne certo devi recuperare il datasheet del motore specifico (che non hai indicato) oppure verificare con un multimetro la continuità dei due avvolgimenti (anche se scambi le polarità non è un problema, semplicemente il motore girerà nel verso opposto).

1 Like

Grazie per il suggerimento, mi scuso di aver mancato di far presente il tipo di stepper, ho i fili del motore direttamente collegati alla morsettiera del driver.
Su Asse Y ho 2 motori in parallelo, su asse X ho 4 motori in parallelo (di cui due cablati con poli uguali, due con poli rovesci , si muovono tutti e 4 nello stesso verso) adesso completo la descrizione con questo dettaglio abbastanza importante che ho dimenticato, ancora grazie.

Ciao, grazie per il suggerimento; sai la cosa dei colori non corrispondenti mi è capitata su un brushless per gimbal (stoc di tre motori uguali uno solo aveva i colori sfalsati; la prova tester è praticamente una buona pratica sempre ho imparato (dopo aver bruciato l’integrato che comandava la gimbal ))
E pure sul motore di un monopattino stessa cosa dei colori (acceleravi andava all’ indietro hahahah; ancora grazie.
Temo sia una questione di codice…

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.