Servo motor does not work

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2164
    erolunal
    Participant

      In file included from C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl/grbl.h:43:0,
      from C:\Users\Tolga\OneDrive\Masaüstü\grbl-1.0\grbl\examples\grblUpload\grblUpload.ino:27:
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl/nuts_bolts.h:54:0: warning: “max” redefined
      #define max(a,b) (((a) > (b)) ? (a) : (b))

      In file included from sketch\grblUpload.ino.cpp:1:0:
      C:\Users\Tolga\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\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl/grbl.h:43:0,
      from C:\Users\Tolga\OneDrive\Masaüstü\grbl-1.0\grbl\examples\grblUpload\grblUpload.ino:27:
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl/nuts_bolts.h:55:0: warning: “min” redefined
      #define min(a,b) (((a) < (b)) ? (a) : (b))

      In file included from sketch\grblUpload.ino.cpp:1:0:
      C:\Users\Tolga\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\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl/grbl.h:43:0,
      from C:\Users\Tolga\OneDrive\Masaüstü\grbl-1.0\grbl\examples\grblUpload\grblUpload.ino:27:
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl/nuts_bolts.h:58:0: warning: “bit” redefined
      #define bit(n) (1 << n)

      In file included from sketch\grblUpload.ino.cpp:1:0:
      C:\Users\Tolga\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))

      In file included from C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\grbl.h:43:0,
      from C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\gcode.c:22:
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\gcode.c: In function ‘gc_execute_line’:
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\nuts_bolts.h:58:19: warning: left shift count >= width of type [-Wshift-count-overflow]
      #define bit(n) (1 << n)
      ^
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\nuts_bolts.h:63:36: note: in definition of macro ‘bit_false’
      #define bit_false(x,mask) (x) &= ~(mask)
      ^~~~
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\gcode.c:852:118: note: in expansion of macro ‘bit’
      if (axis_command) { bit_false(value_words,(bit(WORD_A)|bit(WORD_B)|bit(WORD_C)|bit(WORD_D)|bit(WORD_X)|bit(WORD_Y)|bit(WORD_Z))); } // Remove axis words.
      ^~~
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\spindle_control.c:118:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
      spindle_set_state(uint8_t state, float rpm){
      ^~~~~~~~~~~~~~~~~
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\spindle_control.c:118:1: warning: conflicting types for ‘spindle_set_state’
      In file included from C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\grbl.h:59:0,
      from C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\spindle_control.c:26:
      C:\Users\Tolga\OneDrive\Belgeler\Arduino\libraries\grbl\spindle_control.h:32:6: note: previous declaration of ‘spindle_set_state’ was here
      void spindle_set_state(uint8_t state, float rpm);

      Hi Angel, Arduino gives warning like this when compiling and uploading. Stepper motors work but servo motor does not

      #2165
      Angel LM
      Admin

        Hi erolunal,

        What model of servomotor are you using? How it is connected to the PCB?

        #2166
        erolunal
        Participant

          I am using Tower Pro mg995 servo motor and connect it to PT1 on PCB

          #2167
          Angel LM
          Admin

            Ok, it’s the same one I use. I assume you have already tried connecting the wires by turning the connector 180 degrees.

            Check, just in case, that the motor connector pins correspond to SIG, VCC, GND in that order. By the way, check also the state of the connector pins, to discard that it could be due to a bad contact.

            Is the servo motor powered? There is 5V between the center pin of the PT1 pin set and the one closest to the edge of the board?

            What Gcode are you using? These are the ones that I use to check the functionality:
            M3 S900 – Open gripper
            M3 S0 – Close gripper

            #2168
            erolunal
            Participant

              5v is coming to the center pin and edge pin of the PT1 pin. I’m typing the same Gcodes. Not working. The problem is most likely in the warnings above.

              #2169
              erolunal
              Participant

                I installed the GRLB software on 3 different computers, it still gave the same error, the stepper motors work but the servo motor does not.

                #2170
                erolunal
                Participant

                  It goes to pin 41 on Arduino isn’t it the SIG pin of the servo?

                  #2171
                  Angel LM
                  Admin

                    Oh, my bad, my mistake. I forgot the most common problem in these cases. As you can see in the wiring diagram, the servomotor signal pin has to be connected to pin 7 of the Arduino (it is marked in another color).

                    When I designed the board, I made the mistake of thinking that pin 41 of the Arduino Mega could be used as PWM and it is not, so the solution is to unsolder from the Control PCB the pin that would be connected to pin 41 of the Arduino and instead solder a jumper wire to connect it to pin 7 of the Arduino.

                    I hope this solves the problem!

                    #2172
                    erolunal
                    Participant

                      Thank you for your answers and your interest, I’m at work right now, I’ll try it tomorrow.

                      #2174
                      erolunal
                      Participant

                        I plugged it into pin 7 and it worked. Thank you for your help.

                        #2175
                        Angel LM
                        Admin

                          I’m glad the problem has been fixed!

                          I will modify the documentation to make it clear how to make that connection and avoid more confusion in the future 😉

                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.