As I have no experience with dc motors with more than 2 wires, I was wondering if someone could give me some support. This is the motor I have: http://robokitsworld.com/documentation/RMCS220x_DCServo_Driver.pdf

Problem is that it turns only in one direction. GND and VCC is connected to a 12V 5A Source. Pulse Step + and Pulse Step - are conected to Pin 5 and 6 of the Arduino, GND is connected to the Arduino as well. Direction + and Direction - are not connected. I tried connecting Direction - to GND but it makes no difference. This is the script I am using for testing:

from java.lang import String
arduino = Runtime.createAndStart("arduino", "Arduino")
arduino.connect("COM8") 
m1 = Runtime.createAndStart("m1","Motor")
m1.setType2Pwm(5,6)
m1.attach(arduino)

keyboard = Runtime.createAndStart("keyboard", "Keyboard")
keyboard.addCommand("Links", "python", "Links", "Links")
keyboard.addCommand("Rechts", "python", "Rechts", "Rechts")

def Links(cmd):
    global keyboardInput
    keyboardInput = "Links"
    print "motor left"
    m1.move(-0.5)
    sleep(2)
    m1.move(0)

def Rechts(cmd):
    global keyboardInput
    keyboardInput = "Rechts"
    print "motor right"
    m1.move(0.5)
    sleep(2)
    m1.move(0)

The motor turns right (Rechts) but doesn't turn left (Links). My feeling is that the wiring is not correct. Thanks for any suggestions!

Here the wiring:

 

Thanks to Gareth we found out the following:

PUL + & DIR + connected to the arduinos 3.3v or 5v and PUL - & DIR - to pin 5 & pin 6 = motor turns left

PUL - & PUL + connected to pin 5 & pin 6 = motor turns right (DIR + and DIR - are not connected)

calamity

8 years 8 months ago

Hi

I'm not an expert in this, but I would try wiring as in p8 of the documentation

so

Green-> 12v

Yellow-> they said nothing, so ground or open

Orange -> 5v

Red -> 2.5v

Brown -> arduino pin for your input (0 - 255) for 0-5v, 2.5v been stop, 0 max reverse and 255 max forward

Black -> ground

Christian

Mats

8 years 8 months ago

In reply to by calamity

Hi

Assuming that the motor is the one that you linked to above, and not the one you link to in the shoutbox. They are two different animals, even if both are Rhinos :-). What I write below applies to http://robokitsworld.com/documentation/RMCS220x_DCServo_Driver.pdf

This motor has 4 alternative ways control the speed and direction as you can see in the datasheet.

UART: you send and receive serial commands to control speed and direction.

I2C: you use i2c commands to control speed and direction.

PPM: you use the same method as you would use to drive any RC servo. 

Analog: You use a voltage between 0 and 5V to control speed and direction.

Using one of the two fist methods ( UART or  I2C ) will also give you the possibility to read from the  encoder.

But to get the motor running in a way that is well supported and easy to use, I suggest PPM. So thats what I describe below.

----

Follow the instructions from the "Speed Control Signal Connection PPM Signal" to make the electrical connections. The "PPM SIGNAL GENERATOR" is the Ardino.

For the PPM signal use any of the digital pins and connect it to 

In MyRobotlab start an Ardino and a Servo service and attach the servo to the Ardino and select the digilal pin that you connected. 

Seitting the servo at 0 position should rotate the motor reverse, and position 180 shoud rotat the motorforward. forward. Position 90 should make to motor stand still. The pulses you will get this way are between 1 and 2 ms, so the motor will not run at the fastest speed. To make it run att full speed, use servo.writeMicroseconds(600) or servo.writeMicroseconds(2400).

----

Hope this helps. If you have the motor that you link to in the shoutbox, then let me know so that I can write a new guide.

/Mats

 

This reply applies to https://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&…

Use the electrical wirind diagram "Control Signal Connection PNP pull-up"

Connect PUL-, DIR- and ENA- to GND.

Connect DIR+ to PIN 5 on the Arduino. 

Connect PUL+ to PIN 6 on the Arduino,

Connect ENA+ to Vcc on the Arduino.

Connect GND on the motor GND on the Arduino.

Connect GND on the motor to - on the power source.

Connect V+ on the motor to + on the power source. 

------------------------------------------------------------------------------------------------

To drive it you need to create a Python script, since stepper motors aren't yet implemented in MRL.

PIN 5 will control the direction of the motor so a 0 will drive it in one direction and 1 in the other direction.

To move the motor you need to write 0 and 1's to PIN 6. You will ned to write 1800 pulses to make the motor turn a full revolution, because it only moves .2 degrees per pulse.

Hope this helps. Looks like there is a demand to implement stepper motors in MRL and MRLComm.

/Mats

The PDF diagram PNP pull up uses a digital step/direction input interface, looks like this one: http://robokits.co.in/motors/stepper-motors/micro-stepping-stepper-moto…;

I don't have this interface which means I have no ENA + and ENA -.

In november 2015 the motor used to run using MRL and a similar script I posted on top. Motor was only  connected to an arduino uno. https://www.youtube.com/watch?v=hUEn0VjiEPU

Thanks Mats, I will see what I can do today.