Page 1 of 1

MD10C with power window programming

PostPosted: Wed Dec 19, 2018 8:40 pm
by asinine
I have purchased the MD10C motor driver. I want to control the direction of the motor in programming. The tutorial attached to the MD10C is too cluttered due to unnecessary lcd button usage and it does not show the programming for direction. I need an example of coding in arduino for controlling the direction

Re: MD10C with power window programming

PostPosted: Thu Dec 20, 2018 10:56 am
by ober
There are many methods to control MD10C, but direction is quite straight forward in sign magnitude method. Just toggle the logic, from high to low, or low to high.

An example is here: https://github.com/CytronTechnologies/A ... button.ino

BTW, do ensure the power window is not stall for too long because MD10C can only support 13A continuous current. But power window motor can easily take upto >17A in stall.

Re: MD10C with power window programming

PostPosted: Thu Dec 20, 2018 4:15 pm
by asinine
so basically what you are saying, for example if i set the DIR to HIGH the motor will turn clockwise while if DIR to low is pressed the motor will turn counterclockwise.But what if I want to stop/pause the motor? I don't want the motor to continue on rotating.

Re: MD10C with power window programming

PostPosted: Thu Dec 20, 2018 4:17 pm
by asinine
ober WROTE:There are many methods to control MD10C, but direction is quite straight forward in sign magnitude method. Just toggle the logic, from high to low, or low to high.

An example is here: https://github.com/CytronTechnologies/A ... button.ino

BTW, do ensure the power window is not stall for too long because MD10C can only support 13A continuous current. But power window motor can easily take upto >17A in stall.



so basically what you are saying, for example if i set the DIR to HIGH the motor will turn clockwise while if DIR to low is pressed the motor will turn counterclockwise.But what if I want to stop/pause the motor? I don't want the motor to continue on rotating.

Re: MD10C with power window programming

PostPosted: Thu Dec 20, 2018 4:50 pm
by Idris
Hi asinine,

To stop the motor, give LOW at PWM pin.

Thanks.

Re: MD10C with power window programming

PostPosted: Sun Dec 23, 2018 4:13 pm
by asinine
Idris WROTE:Hi asinine,

To stop the motor, give LOW at PWM pin.

Thanks.


#define pwm 2
#define dir 3
char serialdata;
int pwm_value=0;

void setup(){
pinMode(pwm,OUTPUT);
pinMode(dir,OUTPUT);
Serial.begin(9600);
}

void loop(){

if (Serial.available()){
serialdata=Serial.read(); //Get next character from serial com

if(serialdata=='U') //clockwise
{
digitalWrite(dir,HIGH);
digitalWrite(pwm,255);
}
if(serialdata=='D')
{
digitalWrite(dir,LOW);
digitalWrite(pwm,255);
}

if(serialdata=='S')
{
digitalWrite(dir,LOW);
digitalWrite(pwm,0);
}
}
}


this should be correct?

Re: MD10C with power window programming

PostPosted: Sun Dec 23, 2018 7:11 pm
by asinine
Idris WROTE:Hi asinine,

To stop the motor, give LOW at PWM pin.

Thanks.


I've tried but when DIR is HIGH, the motor will not move but when DIR is LOW motor will move in just one direction, I've tried to change the PWM to a -255 in hopes that it will reverse the direction but no luck, any ideas?

Re: MD10C with power window programming

PostPosted: Sun Dec 23, 2018 8:00 pm
by asinine
asinine WROTE:
Idris WROTE:Hi asinine,

To stop the motor, give LOW at PWM pin.

Thanks.


I've tried but when DIR is HIGH, the motor will not move but when DIR is LOW motor will move in just one direction, I've tried to change the PWM to a -255 in hopes that it will reverse the direction but no luck, any ideas?


Nevermind, I got it working, it appears that I needed to connect the ground pin from the MD10C to the ground of Arduino.