MD10C with power window programming

LINIX Brushless, VEXTA Brushless, RC Servo, DC Geared, Linear, Stepper, Tamiya.....

MD10C with power window programming

Postby asinine » Wed Dec 19, 2018 8:40 pm

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
asinine
Newbie
 
Posts: 8
Joined: Wed Dec 19, 2018 8:36 pm

Re: MD10C with power window programming

Postby ober » Thu Dec 20, 2018 10:56 am

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.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: MD10C with power window programming

Postby asinine » Thu Dec 20, 2018 4:15 pm

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.
asinine
Newbie
 
Posts: 8
Joined: Wed Dec 19, 2018 8:36 pm

Re: MD10C with power window programming

Postby asinine » Thu Dec 20, 2018 4:17 pm

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.
asinine
Newbie
 
Posts: 8
Joined: Wed Dec 19, 2018 8:36 pm

Re: MD10C with power window programming

Postby Idris » Thu Dec 20, 2018 4:50 pm

Hi asinine,

To stop the motor, give LOW at PWM pin.

Thanks.
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 409
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: MD10C with power window programming

Postby asinine » Sun Dec 23, 2018 4:13 pm

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?
asinine
Newbie
 
Posts: 8
Joined: Wed Dec 19, 2018 8:36 pm

Re: MD10C with power window programming

Postby asinine » Sun Dec 23, 2018 7:11 pm

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?
asinine
Newbie
 
Posts: 8
Joined: Wed Dec 19, 2018 8:36 pm

Re: MD10C with power window programming

Postby asinine » Sun Dec 23, 2018 8:00 pm

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.
asinine
Newbie
 
Posts: 8
Joined: Wed Dec 19, 2018 8:36 pm


Return to DC Motor

Who is online

Users browsing this forum: No registered users and 5 guests

cron