This project is the breadboard version of our Mecanum Car PCB project. This project shows you how to control 4 motors with Quantum. However, unlike our 2 Motor project this project turns the car by having the two sets of motors rotate in opposing directions, like a tank.
Gather all of the components in the parts list above.
We will start by setting up our breadboard. First, put the TLC5940 chip in the middle of the breadboard and have each L293D H-Bridge on either side of the TLC5940 like so:
Now, follow these schematics to wire each of your H-Bridges:
***The PWM tags on the H-Bridges will be wired to the TLC5940. The capacitors in the schematics above are the ones we already places on the Vcc and GND rails of the bread board.
Now, follow these diagram to wire your TLC5940:
Build the Firmware
Navigate to the Firmware Builder and create a new Firmware file. We named ours “Mecanum Firmware”.
Repeat these steps for the three remaining motors. You can find the proper pin configurations in the table below.
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 4-motor circuit.
Build the Application
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.
Configure each manual Ranging object as follows:
***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 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.
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.