All Info About OpenDuckMini

All Info About OpenDuckMini

HanFangchong |

1. Preparing Robot Simulation in MuJoCo

If you designed your robot in OnShape

Ensure your robot is designed according to onshape-to-robot constraints

https://onshape-to-robot.readthedocs.io/en/latest/design.html

The generated urdf file will contain frames named closing_<...>_1 and closing_<...>_2, which you can use in the mjcf file to close loops.

Obtain robot urdf from OnShape

Run the following command:

$ onshape-to-robot robots/bd1/

(Optional) If you have closed loops, follow the instructions in the onshape-to-robot documentation, then:

Add this to robot.urdf:

<robot name="...">
    <mujoco>
        <compiler fusestatic="false"/>
    </mujoco>
    ...
</robot>

2. Converting URDF to MJCF (MuJoCo)

Obtain MuJoCo binaries

Download MuJoCo binaries from: https://github.com/google-deepmind/mujoco/releases

Unzip and run:

$ ./compile robot.urdf robot.xml

Add actuators in robot.xml:

Example:

    <actuator>
        <position name="left_hip_yaw"    joint="left_hip_yaw"    inheritrange="1"/>
        <position name="left_hip_roll"   joint="left_hip_roll"   inheritrange="1"/>
        <position name="left_hip_pitch"  joint="left_hip_pitch"  inheritrange="1"/>
        <position name="left_knee"       joint="left_knee"       inheritrange="1"/>
        <position name="left_ankle"      joint="left_ankle"      inheritrange="1"/>
        <position name="right_hip_roll"  joint="right_hip_roll"  inheritrange="1"/>
        <position name="right_hip_yaw"   joint="right_hip_yaw"   inheritrange="1"/>
        <position name="right_hip_pitch" joint="right_hip_pitch" inheritrange="1"/>
        <position name="right_knee"      joint="right_knee"      inheritrange="1"/>
        <position name="right_ankle"     joint="right_ankle"     inheritrange="1"/>
        <position name="head_pitch1"     joint="head_pitch1"     inheritrange="1"/>
        <position name="head_pitch2"     joint="head_pitch2"     inheritrange="1"/>
        <position name="head_yaw"        joint="head_yaw"        inheritrange="1"/>
    </actuator>

Add free joint

Wrap the body in a free joint:

<worldbody>
    <body>
        <freejoint />
        ...
        ...
    </body>
</worldbody>

(Optional) Constrain closed loops

Add the following in the mjcf file:

<equality>
    <connect body1="closing_<...>_1" body2="closing_<...>_2" anchor="x y z" />
</equality>

The values for x, y, z can be found in the .urdf file:

<joint name="closing_<...>_1_frame" type="fixed">
    <origin xyz="x y z" rpy="r p y" />
    ...
</joint>

Set collision groups, damping, and friction

Remove actuatorfricrange from joints

Put this inside the <mujoco> tag:

<mujoco>
  <default>
    <geom contype="1" conaffinity="1" solref=".004 1" />
    <joint damping="0.09" frictionloss="0.1"/>
    <position kp="10" forcerange="-5.0 5.0"/>
  </default>
    ...
    ...
</mujoco>

Also need to add:

  • change frames to sites

Visualization

$ python3 -m mujoco.viewer --mjcf=<path>/scene.xml

or

$ <path_to_mujoco_bin>/bin/simulate <path>/scene.xml

3. 3D Printing Guide

You can find the .stl files in the print/ directory at the project root.

All parts are printed using standard PLA with 15% infill, except for foot_bottom_tpu.stl, which is printed with TPU at 40% infill.

Number of copies to print for each part

  • foot_top.stl x2
  • foot_side.stl x2
  • foot_bottom_pla.stl x2
  • foot_bottom_tpu.stl x2 (TPU)
  • knee_to_ankle_left_sheet.stl x4
  • knee_to_ankle_right_sheet.stl x4
  • leg_spacer.stl x4
  • left_roll_to_pitch.stl x1
  • right_roll_to_pitch.stl x1
  • roll_motor_bottom.stl x2
  • roll_motor_top.stl x2
  • trunk_bottom.stl x1
  • trunk_top.stl x1
  • neck_left_sheet.stl x1
  • neck_right_sheet.stl x1
  • head_pitch_to_yaw.stl x1
  • head_yaw_to_roll.stl x1
  • head_roll_mount.stl x1
  • head.stl x1
  • head_bot_sheet.stl x1
  • left_antenna_holder.stl x1
  • right_antenna_holder.stl x1
  • left_cache.stl x1
  • right_cache.stl x1
  • body_front.stl x1
  • body_middle_bottom.stl x1
  • body_middle_top.stl x1
  • body_back.stl x1
  • battery_pack_lid.stl x1

4. Assembly Guide

Before assembling your Duck, you need to first configure your servos

Requirements:

You will need:

  • A soldering iron, basic electronic tools and skills (Translator's note: Remember to buy a heat-set insert soldering tip! Although a pointed one will work too. Then I ask you...)
  • X M3 screws (TODO: add exact quantity) (I bought bags of 100 M3 screws each in 4mm, 6mm and 10mm lengths. No need to count screws when buying)
  • Some wires (I used 28 AWG ultra-soft silicone wires)
  • Loctite Threadlocker blue 243 (this is screw locking glue, technically optional since you can just disassemble and reassemble if screws loosen, if you don't mind the hassle)

These tools need to be prepared by yourself and are not included in the BOM. This is important.

General note: Every time you screw something into a motor, you should use a little Loctite threadlocker. This prevents screws from loosening due to vibrations when the robot is running. While it adds a bit to assembly time, you'll be glad you took the time ;)

At any time, you can refer to the CAD here: https://cad.onshape.com/documents/64074dfcfa379b37d8a47762/w/3650ab4221e215a4f65eb7fe/e/0505c262d882183a25049d05

Steps:

Before starting, it's best to read through everything. My suggestion is to install all heat-set inserts first. You'll need to identify where all the heat-set inserts need to go

Later, when there's time, I'll add it to the documentation. If you have time after reading, you can also help summarize it in the comments of this sentence. Total number of heat-set inserts needed. Anyway I bought 100, which was enough

Assembling the Torso

Insert bearings into trunk_bottom and insert M3 threaded inserts into these holes. This is also a good time to insert 4 M3 threaded inserts at the bottom of this part for installing body components later.

Torso Assembly Image 1

Torso Assembly Image 1

Then assemble trunk_bottom and trunk_top and screw them together with 2 M3x10 screws through these holes.

Torso Assembly Image 2

Torso Assembly Image 2

Install the middle motor like this and tighten it with the plastic screws provided with the motor.

Torso Assembly Image 3

Torso Assembly Image 3

Insert roll_motor_bottom like this.

Torso Assembly Image 4

Torso Assembly Image 4

Assembling the Feet

Both feet are the same.

Translator's note: There are specifics about servo orientation when installing, which you can check after assembling the left foot
After assembling the left leg, the ankle and calf motors of the right leg need to mirror the left leg's orientation. This is from my experience. You can first assemble everything according to the article. If there are issues, just modify according to this solution. If the text is hard to understand, wait for the assembly tutorial video~ will link here when available.

First, assemble foot_bottom_tpu with foot_bottom_pla. Insert M3 threaded inserts into these holes:

Foot Assembly Image 1

Foot Assembly Image 1

Then screw the two parts together with two M3x6 screws.

Then, insert M3 threaded inserts into these holes in foot_top:

Foot Assembly Image 2

Foot Assembly Image 2

Assemble all components like this. Ensure the motor drive side is on the side of the foot_top part:

Foot Assembly Image 3

Foot Assembly Image 3

Foot Assembly Image 4

Foot Assembly Image 4

Assembling the Lower Leg

Insert M3 threaded inserts into these holes in leg_spacer (insert on both sides, total 4 M3 threaded inserts):

Lower Leg Assembly Image 1

Lower Leg Assembly Image 1

Then, first insert the motor cables into the foot motor and pass them through right_sheet as shown below:

Lower Leg Assembly Image 2

Lower Leg Assembly Image 2

Then assemble as shown below:

Lower Leg Assembly Image 3

Lower Leg Assembly Image 3

Until the lower leg.

Assembling the Thigh

The thigh is basically the same operation, except the hip_pitch motor is installed this way (important for zero position).

Thigh Assembly Image

Thigh Assembly Image

Assembling the Hip

Install left_roll_to_pitch or right_roll_to_pitch - the parts are symmetrical here, so use the correct one.

Hip Assembly Image 1

Hip Assembly Image 1

Install roll_motor_top onto the hip_yaw servo motor (screwing from bottom). Don't install the servo motor to the torso yet.

Hip Assembly Image 2

Hip Assembly Image 2

Then install hip_roll like this.

Hip Assembly Image 3

Hip Assembly Image 3

Then insert the subassembly like this.

Hip Assembly Image 4

Hip Assembly Image 4

Tighten everything that can be tightened as much as possible (using the plastic screws provided with the servos).

Now you can install the leg like this:

Hip Assembly Image 5

Hip Assembly Image 5

Do the same for the other leg :)

Your duck should now look like this:

Hip Assembly Image 6

Hip Assembly Image 6

Assembling the Neck

You know what to do.

Neck Assembly Image

Neck Assembly Image

Assembling the Head

For reference, the inside of the head now looks like this:

Head Assembly Image 1

Head Assembly Image 1

First install head_pitch_to_yaw like this.

Head Assembly Image 2

Head Assembly Image 2

Then independently install head_yaw_to_roll and head_roll_mount to the head_roll dof.

Head Assembly Image 3

Head Assembly Image 3

(You can also insert head_bot_plate and body_middle_top now to avoid disassembling the head later)

Then:

Head Assembly Image 4

Head Assembly Image 4

Then:

Head Assembly Image 5

Head Assembly Image 5

Your duck should now look like this:

Head Assembly Image 6

Head Assembly Image 6

Installing the Servo Driver Board

TODO Take a photo

Installing the IMU

Install like this:

Actually, it's better to install the IMU in the correct natural orientation, which would be flipped on the X axis compared to the image below.

IMU Installation Image 1

IMU Installation Image 1

IMU Installation Image 2

IMU Installation Image 2

Electronics

Here's the overall electronic schematic for reference:

Electronics Image 1

Electronics Image 1

Electronics Image 2

Electronics Image 2

Battery Pack

For safety, ensure all battery cells are charged to the same voltage before placing them in the battery holder.

Battery Pack Image 1

Battery Pack Image 1

Battery Pack Image 2

Battery Pack Image 2

Head

First, insert M3 threaded inserts into all these holes:

Head Image 1

Head Image 1

Then insert bearings, install ear motors and Raspberry Pi Zero 2W.

Then assemble the neck with the head like this:

Head Image 2

Head Image 2

Body

First tighten body_middle_bottom:

Body Image 1

Body Image 1

Then insert M3 threaded inserts into all holes in body_middle_bottom and body_middle_top, where we'll install the battery pack and body_front.

Then install body_middle_top, body_front and battery pack:

Body Image 2

Body Image 2

Body Image 3

Body Image 3

And that's it.

Body Image 4

Body Image 4

Body Image 5

Body Image 5

Now your duck is fully assembled

Leave a comment

Please note: comments must be approved before they are published.