🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5stack Core and GoPlus Module dc motor connector adresses missing (Arduino)

    Modules
    3
    5
    2.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      WBE
      last edited by

      Hello. I'm trying to configure my GoPlus module using the example codes which are very limited on the M5 documentation for GoPlus. I can't find the correct list of addresses to be used anywhere.

      I want to power my DC 3-6V gearmotors 1:120 using the code adding an extra 5V external powersupply (max 2A) through the XT30 connector.
      I found the max speed in example codes is 250 and min is -250 for the motor command but with other values in between this gives the same issue.
      So the code I used is following:
      void Motor(void){
      Serial.println("-------------------------MOTOR Sturing -------------");
      Serial.println(" motorspeed 200");

       M5.Lcd.setCursor(40, 60, 2);
       M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
        M5.Lcd.printf("Test MoTor motorspeed 250      \n "); 
      goPlus.Motor_write_speed(MOTOR_NUM0, (uint8_t)0x80, 250);
      goPlus.Motor_write_speed(MOTOR_NUM1, (uint8_t)0x00, 250);
      delay(5000);
      
      Serial.println(" motorspeed 0");
       M5.Lcd.setCursor(40, 60, 2);
       M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
        M5.Lcd.printf("Test MoTor motorspeed 0      \n "); 
       goPlus.Motor_write_speed(MOTOR_NUM0, (uint8_t)0x80, 0);
       goPlus.Motor_write_speed(MOTOR_NUM1, (uint8_t)0x00, 0);
      delay(500);
      
      Serial.println(" motorspeed -250");
       M5.Lcd.setCursor(40, 60, 2);
       M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
        M5.Lcd.printf("Test MoTor motorspeed -250     \n "); 
       goPlus.Motor_write_speed(MOTOR_NUM0, (uint8_t)0x00, -250);
       goPlus.Motor_write_speed(MOTOR_NUM1, (uint8_t)0x00, -250);
          delay(5000);
      Serial.println(" motorspeed 0");
       M5.Lcd.setCursor(40, 60, 2);
       M5.Lcd.setTextColor(TFT_WHITE, TFT_BLACK);
        M5.Lcd.printf("Test MoTor motorspeed 0\n "); 
      goPlus.Motor_write_speed(MOTOR_NUM0, (uint8_t)0x80, 0);
      goPlus.Motor_write_speed(MOTOR_NUM1, (uint8_t)0x00, 0);
      delay(500);
      

      }

      It just doesn't seem to be able to power the DC connectors. I get a -0.2V max out and a + 0,8V max which isn't enough to run the motor.

      Has anyone experience or documentation what adresses of code instructions are to be used to fix this issue?
      Or a link with the more complete documentation what commands and adresses to use for steering the servo and DC motor pins?

      Because I'm really blocked for weeks now.
      Thanks upfront.
      Wim

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @WBE

        Note: I don't own the GoPlus module so my conclusions could be incorrect.

        The DCDC step-down converter (TPS54360) is, according to the schematic, setup to output 6.5 V. Normally step-down converter require a slightly higher input voltage than the output voltage to function properly. Also according to the GoPlus description the DC input range is 6.5 V - 24 V. So assuming nothing is wrong with your code (which I cannot say w/o testing, sorry) I have a feeling that 5 V at the DC input might be too low.

        BTW: have you tried to use UIFlow - might be helpful to verify whether your hardware setup is correct?

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        W 1 Reply Last reply Reply Quote 0
        • W
          WBE @felmue
          last edited by

          @felmue Thanks for the fast response. I missed the 6,5V minimum input. I initially changed the power supply of 12V 500mA to a 5v 2A because I thought the power consumption would be bigger than 0.5A. I tested again and it doesn't seem to work.
          I found a chinese doc on the GoPlus that contained another example after translation (thanks Deepl):
          uint16_t speed = 200;
          Wire.beginTransmission(0x5d); // adress GoPlus
          Wire.write(0x30); //motor connection
          Wire.write((speed >> 8)&0x80); // port 1 DC and 0x00 = port 2 DC
          Wire.write(speed & 0xff); // no idea where 0xff comes from
          Wire.endTransmission();

          fingers crossed this will work. I have no way to test whether the GoPlus became defunct. The Servo steering doesn't work either. Maybe I need also a bigger power supply...
          Starting to think buying the GoPlus a while ago wasn't the best idea...

          1 Reply Last reply Reply Quote 0
          • W
            WBE
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • ajb2k3A
              ajb2k3
              last edited by

              In my railway project I use 12V in but only get 5V out max

              0xff stops the motors.

              Wire.write((speed >> 8)&0x80);
              

              Needs to be

              Wire.write((speed >> 8)&0x00);
              

              for the second channel.

              UIFlow, so easy an adult can learn it!
              If I don't know it, be patient!
              I've ether not learned it or am too drunk to remember it!
              Author of the WIP UIFlow Handbook!
              M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post