1.14 - Multi-Mapping

Overview

For Fullscreen: https://www.youtube.com/watch?v=mig7XXAEuxs

Multi-Mapping is a usefull feature to use on your App. This tutorial will show a example on how to use it to give you a better understanding.


What is multi-mapping?

The application mapping feature allows you to connect your physical hardware devices to the hardware objects in your app. The most standard method is to map each physical hardware device to its corresponding hardware object in your application. But what if you have multiple hardware devices that you want to perform the same action? The Quantum platform has a multi-mapping feature available as a property on each hardware object. When enabled it allows you to map multiple physical hardware components to just one hardware object in your application. To demonstrate you the benefits of this feature we will be using our that is connected to a Builder Base. We will create a simple app to control four motors and eight servos.


Setup

We will start by going to our Q-Server.

We already added and specified the Client connected to the servos and motors as you can see.

The related firmware is already uploaded to the client. We have eight servos and four motors uploaded to the Builder Base that is connected to the DIY Kit.

For the application we’ll be using the motor servo driver demo app that we used for the DIY Kit video. Go check that out if you need more information about the app and how to build it.

https://www.youtube.com/watch?v=h1H48zxaxCg

The app and firmware is also accessible in your Q-Server library. You can simply download it there or build it by your own following the linke video above.

This app allows you to control each motor individually using a series of interface objects. If you want to control all four of these motors or all eight of these eight of these servos and have it perform the same action. One way to do this is to use one interface object and connect it to all of the four Motors at the same time.

The other way is much simpler than that. We are going to delete all the interface and hardware objects expect for the first motor and first servo hardware object and interface object. The app will now look like this.

Click on the motor hardware object and activate the multi-mapping feature by clicking the slide button on the right side in the properties section of the object.

Also we rename the object to “Motors” instead of “Motor 1”. Then click “Save Properties”. Also we will rename the interface object as well. Do the same steps for the servo related objects.

Just by using the multi-mapping feature for these hardware objects we have greatly condensed our app from having four motor hardware objects and eight servo ones into just two hardware objects and two corresponding interface objects. Once you have created your app using the multi-mapping feature click “Save App” and we are going to return to our Apps tab.


Multi-mapping

Let’s run the application by clicking on the play button.

Since we have turned on the multi-mapping feature this is the process that’s going to be a little bit different than normal. Start by clicking on the servo tab to start.

We need to add multiple Clients that we want to map to this one servo hardware object. Since there are eight servos on the DIY Kit we are going to add eight client clicking on “+Add Client”. Start by clicking on the first Client and select the first servo hardware on the Motor Servo Driver DIY Kit Builder Base. Do this for each Client. So for Client 1 select the Servo 1, for Client 2 the Servo 2 and so on.

Now we have mapped all eight servos that we have connected to the Builder Base from the DIY Kit and mapped it to the one servo hardware object in our application. Do the same for the motor hardware object by adding for four additional Clients and connecting Client 1 with the Motor 1.


Demo

Our multi-mapping setup is complete and ready to start so hit “Save+Run”.

To control the motors and servos we are going to use the integrated Dashboard interface of the Q-Server. Click on the dashboard icon in the top right corner next to the settings.

Once opened click the Motor Servo Driver app.

You can see we have one control for all the motors and one control for all servos as we wanted. The motors and servos will now perform the same action at the same time.

Let’s control the four motors first by moving the slider in one direction.

After moving the slider the motors should start spinning as you can see.

Next we are going to control all the eight servos. For instance we can move the servos to a 180 degree position to demonstrate the control of all the servos at once.

We set them to 90 degree.

As you can see the servos are working correctly. Since there is a litte offset between the servos, they are not directly aligned perfectly but you can change that by calibrating each one of them before using them together if it is important for your specific project.

That’s how you’re able to multi-map hardware objects using the Quantum system. It is a great feature to use especially when you have multiple hardware devices that are all going to perform the same action.

Happy making!