Using mBot with the dual motor driver sensor


#1

Hello!

Is it possible to install the “me Dual Motor Driver V1” on the mBot? I’ve heard it’s supposed to work with an external power source. But I need help or a step-by-step guide. Thank you in advance!


#2

Can you confirm that you are asking about this sensor here:

Thanks! @bensstar


#3

Hello!

Yes, this is the “Motor Driver” I try to connect to the “mBot”.

Greetings


#4

Alright. I believe there is an extension for mBot to interact with it, but I’m on a trip right now and will not be back for a week or so. Is that ok?

@bensstar


#5

Thanks so much!
that would be great! I can wait!
I wish you a good trip!


#6

Awesome! Thanks for your patience.


#7

Please excuse me for asking again! but I wanted to ask if you can help me with my problem now. I have to finish my project by April 28th. Greetings


#8

@bensstar Sorry, I forgot about this!


#9

@bensstar I’ll see what I can find out now.


#10

that would be very nice! You are the best! Thanks


#11

@bensstar It appears to me that you can connect the dual motor driver to the mBot using the standard RJ25 cable that comes in the mBot kit.
See the basic function below (this is for the single motor driver, but the function is the same):

Sadly, there are currently no extension for the mBot to interact with the dual motor driver as of my knowledge.
All I could find was a bit of info and this Arduino C code:

/*************************************************************************
* File Name          : TestMotorDriver.ino
* Author             : Steve
* Updated            : Jasen
* Version            : V1.0.1
* Date               : 11/14/2013
* Description        : Test for Makeblock Electronic modules of Me -Motor 
                       Driver. You can directly connect a motor to M1 or M2 Port, or connect to PORT_1 or PORT_2 through a DC motor driver
* License            : CC-BY-SA 3.0
* Copyright (C) 2013 Maker Works Technology Co., Ltd. All right reserved.
* http://www.makeblock.cc/
**************************************************************************/
#include <Makeblock.h>
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>

MeDCMotor motor1(PORT_1);//You can directly connect a motor to M1 or M2 Port, or connect to PORT_1 or PORT_2 through a DC motor driver.
MeDCMotor motor2(PORT_2);
MeDCMotor motor3(M1);
MeDCMotor motor4(M2);

uint8_t motorSpeed = 100;

void setup()
{

}

void loop()
{
	motor1.run(motorSpeed); // value: between -255 and 255.
	motor2.run(motorSpeed); // value: between -255 and 255.
    motor3.run(motorSpeed);
    motor4.run(motorSpeed);
	delay(2000);
	motor1.stop();
	motor2.stop();
    motor3.stop();
	motor4.stop();
	delay(100);
	motor1.run(-motorSpeed);
	motor2.run(-motorSpeed);
    motor3.run(-motorSpeed);
    motor4.run(-motorSpeed);
	delay(2000);
	motor1.stop();
	motor2.stop();
    motor3.stop();
	motor4.stop();
	delay(2000);
}


https://web.archive.org/web/20150302082934/http://wiki.makeblock.cc/index.php?title=Me-Motor_Driver

I’m sorry that I could not be of more service. If you have more info about your specific project, I might be able to write some code (for an extension) to help you further.
Also, @CommandeR you have done lots of mBot research — if you see this, please let us know if there is a way to use the sensor.

Good luck…


#12

First of all, thank you for your efforts. I’ll take a closer look at this. maybe it will help me.


#13

The problem I have is the following: the mbot has to travel a given route precisely several times. The problem is that after each lap the motor behaves differently (due to battery capacity).


#14

The mbot should recognize packages (black or white) via the color sensor and then push these packages to one of the designated locations (A or B). The mbot should then turn around and travel the same route again. Pick up another package and push it into the right place. And this several times.


#15


#16

@bensstar Where does the Dual Motor driver fit into this?


#17

I thought that the motor driver would enable precise motor control so that the route could be traveled precisely. There should be no deviations when driving along the route.


#18

or is there a simpler solution! Sorry, I’m a noob


#19

@bensstar Ah, I see. In that case, you would need an encoder motor driver and two encoder motors, as well as a way to use them to move the mBot — that’s a bit harder.
https://media.digikey.com/pdf/Data%20Sheets/Makeblock%20PDFs/12045_Web.pdf

:confused: Not really. Sorry. Personally, I would use mBot 2 (mBot Neo) or mBot Ranger for this, not mBot.


#20

OK, annoying! I kind of thought so, but I didn’t want to give up hope! :wink: