Camera mast

This tutorial shows how to 3D print and integrate with Leo Rover camera mast addon.

Introduction

In this tutorial we will show you how to build and integrate another addon with Leo Rover - Camera Mast.

It is inspired by camera mast built on top of NASA's rover Opportunity and is able to rotate camera through an angle of 360 degrees, more than 270 mm above the top of the Rover!

Motors that are used for this application are Dynamixel AX-12A servo's which provide feedback, are quite easy to control with usage of ArbotiX and are in decent price. If you have access to a 3D printer, everything you need to build this addon is really easy to get and no special knowledge is needed. We will get through creating G-codes for 3D printer, assembling everything and at the end integrating it with Leo Rover.

Manufacturing

List of materials

  • 3D printed parts

    • 01126v2 (Base)

    • 01127 (Main tube)

    • 01129 (Second servo mount)

    • 01130 (Second servo cover)

    • 01125 (Rotation shaft)

    • 01131 (Third servo mount)

    • 01132 (Camera mount)

    • 2x 01133 (Bearing shaft)

    • 01134 (ArbotiX mount)

  • 3x Dynamixel AX-12A

  • 3x Dynamixel cable

  • ArbotiX-M Robocontroller

  • FTDI USB-UART cable

  • Leo Rover USB dongle

  • 2x 6800Z ball bearing (dimensions -> 19x10x5 mm)

  • 52x40x7 mm ball bearing

  • 8x M3 nut

  • 4x M3 square nut

  • 4x 2,2x6,5 screw

  • 8x M3x10 hex bolt with button head (actually any M3x10 will be okay)

  • 8x M3x6 hex bolt with button head (actually any M3x6 will be okay)

  • 4x M3 cooper inserts

  • 2x M3x10 hex bolt with head cap (ISO 4762)

  • 26x M2x8 hex bolt with head cap (ISO 4762)

  • 26x M2 nut

3D printing

You can get all of the needed files here:

As at our company we are using Prusa 3D printers, we will show how to prepare 3D models for printing using their software - PrusaSlicer. This application will provide a special file for the printer (G-code) which tells the machine what are the settings and how it should move to create our model.

PrusaSlicer layout

First thing we need to do is to import our files to the application. Click on the Add button (box with a plus sign at the top of the screen) and select the files you want to add.

After uploading the files, it should look like this:

Now we need to spread the models in order to avoid interference. To automatize the process, press the Arrange button (on the right from bin icon).

The arrangement is still not perfect. Our goal is to minimize the number of walls that are "levitating" in the air to avoid support constructions that needs to be printed. Here are some hints for positioning components:

  • Minimize support constructions - it brings a lot of advantages:

    • shorter printing time,

    • less post-processing,

    • smaller amount of used filament,

    • better quality of print.

  • Try to use big flat surfaces as base to increase adhesive area.

  • If some places in component are critical (ex. bearing housing, round holes) try to put them on the top of the print.

By using the buttons on the left, we can rotate and change position of every component. As you can see, we need 2 pcs of Bearing shaft (01133), so click on this part and press + button to add another instance of this model. When you are satisfied with the orientation of the models, press the Arrange button again for optimal arrangement of components at the 3D printer table.

Now we can move on to the settings. You can go through all the detailed options by clicking on different tabs at the top, but if you don't have much experience in 3D printing, we recommend using system presets.

The presets can be chosen from the panel on the right side and they consist of:

  • Print settings They affect the layer height, printing speed and quality of the printed model. For our need, the fastest option - 0.30mm DRAFT will be enough. If you need a better quality print and you don't care about the printing time, you can choose a more detailed preset.

  • Filament In our case it is Prusament PLA and it is also our recommendation for you. For more sturdy models, you can use ABS but it is much harder in printing - it may peel of the table or the layers may not stick together and you will have to start the print from the beginning.

  • Printer Select the printer you want to use. In our case it is Original Prusa i3 MK3.

  • Supports For this option, we suggest support on build plate only. Printer will handle everything that is inside of the models and we will save some time and material. In case of some problems, you can use support everywhere option.

  • Infill As the material we are using is not so strong, we are using 100% infill. In lower infill settings, the 3D printer will do grid structures instead of full infill.

If everything is set, click on Slice now button.

You can now see exactly how your print will look like. Use your mouse to rotate, move or zoom your preview and the slider on the right side to discover individual layers of the build.

When you'll finish admiring your work, you can click on the Export G-code button that's located on the bottom right corner. Save the file on SD card of your 3D printer, load SD card into your machine and that's it! You can now start printing.

Remember to clean 3D printer table before any print! We recommend IPA for this purpose.

Assembling

Flat layout of all elements
Step 1: Press ball bearings into 01132 and 01127.
Step 2: Assemble 01127 with 01129 using 4xM3x10 bolts and 4xM3 nuts.
Step 3: Prepare AX-12A servo, 01130 and 10xM2 nuts
Step 4: press M2 nuts into places where there will be bolt connection and assemble servo and 01130
Step 5: Connect 2 cables to the servo. If you have short cables you should extend them. Especially the one which will be going to the upper servo.
Step 6: Route the wire through rectangular hole in main tube
Step 7: bolt together both parts using 6xM2 bolts
Step 8: Assemble servo to the main tube using 4xM2 bolts on one side and M3x10 bolt and bearing shaft on the other. Route cable through rectangular hole
Step 9: Press big ball bearing into 01130.
Step 10: Bolt rotation shaft to the servo using 4xM2 bolt. Make sure that shaft is parallel to the servo horn.
Step 11: Bolt third servo to the 01131 using 8xM2 bolts and plug the cable.
Step 12: Assemble 01131 to the rest of camera mast using 4xM3x10 bolts and 4xM3 nuts.
Step 13: Assemble 01132 to the rest using 4xM2 bolts on one side and bearing shaft and M3x10 bolt on the other side - similar to the first joint.

Integrating with Leo Rover

Now, that you've built the mast, it's time to mount it on the Rover and install all the necessary software.

Mounting and wiring the mast

Camera mast for operation needs 2 things - power supply and communication with rover. Device which will be used for communication is ArbotiX controller suggested by Dynamixel manufacturer. 3 cables needs to be connected to that - power supply, FTDI cable and Dynamixel servo. To make it easier we designed special mount for Arbotix that needs to be attached to the rover.

Step 1: Bolt 01134 (ArbotiX mount) to the top of the rover near antenna. Remember to hot-press M3 inserts earlier.

When ArbotiX will be safely mounted we can start wiring. The first thing - power supply. Dynamixel's are powered with 12VDC - fortunately Leo rover also so we can take some juice directly from rover's battery using it's DC-DC converter as on image below:

Solder DC connector to 12V part of DC-DC converter. For your convenience you can also get this part at our website.

When it will be done just press in the connector to ArbotiX pcb board. Next step is to communicate ArbotiX with Leo rover. For this purpose FTDI cable needs to be used. There are many variations of this connection but basically you need to connect miniUSB socket in the rover with FTDI socket at ArbotiX pcb board. Below we are showing 2 possible connections:

Possibility 1: FTDI adapter -> double miniUSB cable
Possibility 2: Standard FTDI cable -> miniUSB to USB adapter

Last step is to connect Dynamixel cable to any of the socket which will fit the connector.

Setting servo ID's

In order to properly communicate with the servos, you need to assign them unique ID's. The most common way of choosing the ID is to set 1 for the base joint and increment it by 1 for each next joint in the chain.

Set the Dynamixel ID's like in the image below:

To learn how to do this, you can follow our guide for the Arbotix controller here:

Install the ROS driver package

The leo_mast_bringup package contains a configuration for arbotix driver as well as a script that provides mast lift and lower operation through ROS services.

You can build it like any other ROS package. Start by creating an empty catkin workspace, if you don't have one yet:

mkdir -p ~/ros_ws/src && cd ~/ros_ws
catkin init
catkin config --extend /opt/ros/kinetic

Clone the package into the source space:

cd ~/ros_ws/src
git clone https://github.com/LeoRover/leo_mast_bringup.git

Install dependencies:

cd ~/ros_ws
rosdep update
rosdep install --from-paths src -i

Build the workspace:

catkin build

Source the result space:

source ~/ros_ws/devel/setup.bash

Now you can use roslaunch to run the driver:

roslaunch leo_mast_bringup leo_mast.launch

If you want the driver to start automatically when the RaspberryPi boots, you can follow the Building leo_bringup section of ROS development tutorial:

Then, add this line to leo_bringup.launch file:

<include file="$(find leo_mast_bringup)/launch/leo_mast.launch">

Apart from the topics and services described in the Arbotix tutorial, you will see two new services: /mast/lift and /mast/lower. The first one will lift the mast to standing position, the second one will lower the mast to the back of the Rover and relax the servo.

You can test these operations with rosservice tool:

rosservice call /mast/lift
rosservice call /mast/lower

Adding a Web UI

We have prepared a sample UI for the camera mast. It is just a simple control panel that demonstrates its capabilities. Don't hesitate to develop your own one and present your project to the community.

The UI source is available at our Github repositories: https://github.com/LeoRover/leo_ui_sample_mast

To install it on your Rover, follow the tutorial below:

Then, type in you web browser the LeoRover's address and choose the port number (for example 10.0.0.1:90). If the UI was loaded correctly, you should see the same interface as below: