Manual Robot with MC40SE and MDS40A

Introduction

MC40SE is designed as advance mobile robot controller. With the rich features, it helps beginner to get start in building mobile robot, yet reserving the feature to expand the capabilities of the controller. User may start in no time with powering up the controller and use it for build their own robot. SmartDrive40 is one of the latest smart series motor drivers designed to drive medium to high power brushed DC motor with current capacity up to 80A peak and 40A continuously. MOSFETs are switched at 16 KHz to ensure quiet operation and no annoying whining sound. Besides, it also equipped with a micro-controller unit to provide some smart features such as multiple input mode, current limiting and thermal protection. SmartDrive40 can also be hooked up with another similar unit and operates in pair. This make driving a robot with differential drive a truly plug and play experience. This SmartDrive40 is also suitable to use in Combat Robot because it is able to drive starter motor and operate in RC mode. Let see what it can do here. Let start our project .

Hardware required:

MDS40A x2 (*This product has been discontinued, please check MDS40B (Enhanced SmartDrive 40) as replacement.)

MC40SE x1

• MOTOR x2

WHEEL x1

BATTERY x3

• CASINGSELFMAKEx1

SKPS x1

PS2 CONTROLLER x1

mc40sepicMDS40A

                        MC40SE                                                        MDS40A

wheelDSCF7571

                        Wheels                                                   Motor

6186.7v Li-Ion

                               battery

 
  

SKPSSony PS2

                       SKPS                                                   PS2 controller

Software required:

MPLAB IDE & HITECH C PRO Installation

PICKIT 2

Related References:

Getting started with MPLAB IDE

User manual for MDS40A

User manual for MC40SE

Project:

To control the MDS40A using MC40SE Controller to run the motor using various ways

Procedure:

1. So the chassis I use is like the picture below. You can self build any chassis you like. This is just my demo project.

DSCF7572

2. Motor I use is starter motor and it’s already being modify to run if DWI-direction. What had done is the body terminal has been cut off and been replace so that it had become a normal 2-wire connection motor.

DSCF7571

3. Now, I would like to talk about the example program that had been done. So let look at below and I will explain 1 by 1 of it and talk about the problem you may meet later on.

PRECAUTIONS:

Read first before you start doing the project. The project maybe harmful!!!

1. Check all the positive and negative terminal else you will get shock circuit.

2. Check the battery connection

3. PLEASE LIFT YOUR ROBOT BEFORE YOU ON ANY POWER

4. DONT SWITCH THE CONTROLLER BEFORE YOU SWITCH OFF THE MOTORDRIVER

5. Please note that there where no kid beside.

 

EXAMPLE

Example1: Signed Magnitude

MODE

So we should set the mode to signed magnitude so that it indicate that. In Signed Magnitude mode, IN1 is to control the PWM(speed) and IN2 is to control the direction(left or right)

1

CONNECTION

So For the connection is like the below picture.

DSCF7573

DSCF7605

this is the clearer version to be looking too(the microcontroller is MC40SE

SMpic

Sample code

In this code, we can change speed and direction use only 2 joystick in the middle.

smcode

Example2: Locked Antiphase

MODE

So we should set the mode to Locked Antiphase as indicate below. In locked antiphase mode, IN1 is to control the PWM(speed) and IN2 is to control the direction. Each motor driver receive its own signal.

 
  

pic

CONNECTION

The connection of the wire is like below:

DSCF7606

 
  

SMpic1 (2)

Sample Code

So, this part I have to change the pwm immediately to 512 to stop the motor to turn after I initialize the port of the motor. If not the motor will run everytime reset.

untitled2

This is the sample code:

starttt2

 

Example3: Mix mode

MODE

So we should set the mode to Mix mode as indicate below. In Mix mode, both IN1 and IN2 share the same signal of PWM for the both controller. But the MotorDriver will automatically detect the signal and with the mode set it will self determine the direction that it should turn.

3

CONNECTION

DSCF7603

3join

Sample Code

PROBLEM MAY OCCUR

1. PWM MODE: to understand video got illustrate the pwm signal.

The PWM that we use is 10bits PWM. So, when we set the PWM value using the function given, the maximum value that can be use is 1024bits instated of 256bits. So, if we give the wring value to the controller PWM to instruct it to do something. Since the value goes wrong, that mean the robot will definitely do something that we unsuspected. Please note that we are using 10bits PWM. So, if you want see the pulse of the PWM you can refer to the video below.

2. MOTOR MISDIRECTION

Electrical DC motor usually runs on direct current. It’s often used to run machinery. It can move once there are electricity move directly to it. So DC motor does not have polarity (this mean no +ve or -ve area. Just insert the power and it will run. When you find the motor are in inverse direction of what you want. You can either check at mode that you set is wrong or correct, else just switch polarity of the motor wire if in wrong direction.

3. MOTOR WILL RUNS WHEN:(IMPORTANT SAFETY MEASUREMENT!!!)

Please note that the power for the motor driver and the controller are different. When in some mode the motor will turn when you shut off the power supply of the controller. This is cause by the ground signal when controller is shutting down. The the PWM signal will receive 0 and turn at full speed. So we are highly recommend that please jack-up your robot before you start doing anything for SAFETY PURPOSE!!!

Video to view:

[youtube]http://www.youtube.com/watch?v=KvL6USPfTNw&feature=channel&list=UL[/youtube]

Sample Source Code:

  1. Signed Magnitude
  2. Locked Antiphase
  3. Mix Mode

Buy

, , , , , ,

Related Post

Introducing 30A Dual Channel DC Motor Driver with Smart Features – SmartDriveDuo-30

Remote Control with Shield-PS2 + G15 as wheel

LSA08 Line Follower with MC40SE

Project 16 – Driving two DC geared motors with MD10C by using SKPS

3 thoughts on “Manual Robot with MC40SE and MDS40A

  1. You need to change the code to arduino which for the skps to use hyperterminal(UART). That can found in the example code in arduino. Then change the connection. i not sure if the arduino support PWM, but i believe yes. So you need to change the port of MD40A which provide PWM to arduino PWM port too.

Leave a Reply

Your email address will not be published. Required fields are marked *