Four Motor Kit

Overview

The four motor was prototyped with a protoboard pCB and a PCA9685 as a PWM expander. Now it is hand solderable featuring the TLC5940 and 2 L293D H-Bridges. 4 H-bridges are driven by 8 outputs of a PCA9685. The PCA talks to the client via I2C.

The used the four motor kit to build a mecanum car. The car moves forwards and backwards, and turns like a tank by applying power to only one side. In regards to circuitry, the Mecanum car is a bit more complicated than our other projects, however it is a great project to pursue if you would like to learn more about how to properly drive and control motors with our platform.

intermediate

$105 - 110

1 hour

1 Client

Add Image, Fritzing or animated gif here


Things used in this project

Hardware components

Picture

Name

Quantity

Price(As of 7/10/20)

Link

Picture

Name

Quantity

Price(As of 7/10/20)

Link

 

Radial LED (5mm)

1

$.05/LED (when purchased in a 100 pack)

 

 

Included in Starter Kit

Or you can purchase it here

 

Sliding Switch

1

~$.26/Switch

Can be purchased here

 

2kΩ Resistor

9

$.02/Resistor

Can be purchased here

 

220Ω Resistor

1

$.02/Resistor

Included in Starter Kit

Or you can purchase it here

 

100nf Capacitor

3

~$.03/Capacitor

Can be purchased here

 

1uf Capacitor

2

~$.03/Capacitor

Can be purchased here

 

L293D

2

~$3.91

One is included in the starter kit, but you can purchase the second here

 

TLC5941NT

1

~9.00/chip

Can be purchased here

 

1x2 3.5mm Terminal Block

9

~.22/ Terminal Block

Can be purchased here

 

Mecanum Kit

(different from ours, but similar enough)

1

~$80.00

Can be purchased here

 

Mecanum DIY Kit PCB

1

$2-5

-

Q-Client Builder Base

1

$49

Q-Client

Tools Used

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

Small slotted-head screwdriver

1

Included in Starter Kit

or you can pick from one on our Recommended Tools List

 

Soldering Iron

1

You can pick from one on our Recommended Tools List

 

Solder

1

You can pick from one on our Recommended Tools List

 

Diagonal Cutters

1

You can pick from one on our Recommended Tools List

 

Work Holder

 

You can pick from one on our Recommended Tools List


Story

The Idea

The Quantum revision on the Four Motor kit was built to familiarize our users with using PWM expander chips and H-bridges with our platform with a fun and approachable project.

Video

Build Process

Step 1: PCB Assembly and Soldering

Download the Four Motor DIY Kit Bill of Materials:

Gather your Four Motor Kit PCB and all required components listed in the BOM.

It is especially important to follow the BOM exactingly as it tells you where to place the components on the PCB. The fifth column on the BOM is the “parts” column. This column designates which position on the PCB you are to pace the component. For example, if under the parts column you have a resistor labeled r1 you would then find the position marked r1 on the PCB and place the resistor there.

Using some form of work holder is advised. You can find a list of suitable work holders on our Recommended Tools List.

Step 2: Connecting the Motors to the board

Here you can see the junctions labeled M1 → M4. These are the terminals to which you will connect your motor leads.

 

 

The junctions are paired together as follows: (M1,M3) and (M2,M4). It is important that for each of these pairs you match which leads from the motors go into the terminals labeled X and Y. If you don’t, the directions from your motors will be out of sync. In the table below I will show you how we wired our motors to the terminals.

-

X

Y

-

X

Y

M1

GND

VCC

M3

GND

VCC

M2

VCC

GND

M4

VCC

GND

With your terminal orientation settled, you can then attach your motors to the mecanum frame. With our Mecanum Kit, the each motor is attached via 2 Allen Screws as seen here:

Take care to ensure that your paired motors (M1,M3) are on one side, and (M2,M4) are on the other. If you don’t your motor directions will be out of sync.

Step 3: Wiring your Four Motor to the Builder Base

Once all of your motors are wired and mounted you can connect your PCB to the Builder Base. You can follow along to the diagram and table below to ensure you have the appropriate wiring.

In the above diagram the M4 motor is on top and the M3 motor is on the bottom.

Mecanum PCB

Builder Base

Mecanum PCB

Builder Base

XLAT

GP1

GSCLK

GP0

BLANK

GP2

SIN

GP3

SCLK

GP4

GND

GND

5V

5V

Be careful to make sure that you connect the pcb to 5V and not 3.3V. If you don’t the Mecanum car will be under powered.

Step 4: Build the Firmware

Remember: All Apps and Firmware Files are available in the resources section at the bottom of the page!

Navigate to the Firmware Builder and create a new Firmware file. We named ours Mecanum Kit.

 

Next, click the “+ Add Hardware” button and find the Motor device via the search bar, select it, name it, and then click “Add Hardware”. We named ours Motor FL.

 

 

Now, repeat these steps three more times, naming the Motors Motor FR, Motor RR, and Motor RL.

 

 

You should now have four motor devices in your firmware file.

To configure the drivers for the Motor FL device, select the TLC5940 Driver from the driver dropdown menu.

 

 

Now, set the pins accordingly:

 

GSCLK

XLAT

BLANK

SIN

SCLK

DC 1

DC 2

 

GSCLK

XLAT

BLANK

SIN

SCLK

DC 1

DC 2

MFL

GP0

GP1

GP2

GP3

GP4

0

1

 

 

Repeat these steps for the three remaining motors. You can find the proper pin configurations in the table below.

 

GSCLK

XLAT

BLANK

SIN

SCLK

DC 1

DC 2

 

GSCLK

XLAT

BLANK

SIN

SCLK

DC 1

DC 2

MFR

GP0

GP1

GP2

GP3

GP4

2

3

MRL

GP0

GP1

GP2

GP3

GP4

4

5

MRR

GP0

GP1

GP2

GP3

GP4

6

7

You have now finished configuring your firmware, so save your firmware by clicking the “Save button at the bottom of the screen.

 

Now you can upload your firmware to the client you have attached to the Mecanum car.

 

 

Step 5: Build the Application

Remember: All Apps and Firmware Files are available in the resources section at the bottom of the page!

Navigate to the Applications page and click the “+ Create New Button”, name your application, and click create.

 

 

You will now be directed to the App Builder Canvas.

Using the search bar in the left hand tool-bar search for the Motor code object and drag four of them onto the canvas.

 

 

Name the Motor Objects as we do, this will help you to identify the motors during the application mapping. To rename them, click on the motor object and change the name in the properties panel on the right.

 

 

In order to save the names you must click the “save properties” button at the bottom of the properties tab.

Next, search for the “Manual Ranging” code object using the search bar and drag two of them onto the canvas.

 

 

Configure each manual Ranging object as follows:

Value

In Min

In Max

Out Min

Out Max

Rounded

Value

In Min

In Max

Out Min

Out Max

Rounded

Trigger: on

0

4095

4095

0

true

To configure each port on the object click on the port and change the properties in the properties panel on the right side of the screen, and hit save properties at the bottom of the screen. If you don’t your changes will not be saved!

Next, connect each of the Value out ports from the Manual ranging objects to the Motor objects as follows:

 

Now search for the “Joystick” object and drag two of them onto the canvas. Name one Joystick Left, and the other Joystick Right.

 

 

Now connect the Y-Axis ports from the Joystick objects to the Manual Ranging objects as follows:

Now, in this state your Mecanum Kit App will work with a joystick, but we are going to finish the App by also making it steerable using the dashboard interface.

Find the Digital Toggle Code object, drag three of them onto the screen, and name them.

 

 

Connect the Digital Toggle objects to the manual ranging objects as follows:

 

Now, we just need to add buttons, so search for them and add three of them to your application.

Be sure to add the green “interface” button objects and not the “hardware” version of the button object.

 

 

Name and label them, Left, Forward, and Right by use of the properties panel. If you don’t name/label them it will be confusing to determine which button does what when controlling the car via the dashboard.

Connect the Button objects to the Digital Toggle objects as follows:

Congrats, your app is now complete!

Hit “Save App” and go back to your applications page.

Step 6: Map Your Application

You should now be back on the Apps page.

Find your “Mecanum KIT” app and hit the play button.

A list containing all of the devices in your application will expand.

Next click on the “Motor RL” device and the client dropdown menu will appear on the right.

Select the Motor RL driver from the dropdown menu and hit “Done”.

Repeat the same steps for the Motor FL,RR, and RL devices, ensuring that you match the device name to the object name.

Now, you can map the Joystick Devices in the same way, but make sure that you match the Left and Right Joystick drivers with the Left and Right Joystick devices.

If you have yet to build a Joystick project you can find out how to build one here:

Joystick DIY Kit

 

 

Notice how the status symbols have changed to green checkmarks.

When mapping firmware devices to objects in your Apps it is important to note that only devices and objects of the same type can be mapped together. Using this app for example, we are only given the option to map the client with the button firmware to the button object.

Step 7: Run the Application!

Next, hit “Save + Run”

Congratulations! Your Mecanum project is now complete, have fun!

 

 


Code

App

Firmware


Gallery

 

 

 


Resources

App

 

Firmware

Schematic

BOM

Gerber Files

Final Rev D