Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Finished Project/Animation - 3 Motor 6 Differential Fully Holonomic Mecanum Wheel Arduino Robot

alnisalnis Member, Developers Posts: 452 EDU
edited August 2020 in General
I met Joshua Peterson, a fellow Onshape user, over discord on Monday when he showed a video of this incredible robot in action to the FTC community. We decided to collaborate on making a promotional video/animation for the robot (which was fully designed in Onshape). He designed and built it, and I animated and edited this video.


This robot controls four mecanum wheels using only three motors for full holonomic motion. How? Through 6 differentials and a complex gear-based drivetrain. Each motor controls one degree of freedom—the top motor controls rotation, the middle motor controls lateral movement, and the bottom motor controls longitudinal movement.

This video shows the fully-functioning drivetrain in action in rendered footage as well as real-world footage of the physical robot driving around with a remote control. The robot is uniquely mobile in that all three degrees of freedom are controlled using exactly three motors, unlike traditional mecanum drive bases with one motor per wheel (for a total of four motors). Thus, it can move in any direction at any time.

GitHub code link: https://github.com/joshuapeterson210/threemotormecanum

Joshua Peterson’s email (designer and builder): contact@joshp.dev
Alnis Smdichens’ email (animator and video editor): contact@alnis.dev
Alnis Smidchens’ website/portfolio: https://alnis.dev

Hope you all enjoy  :)
Get in touch: contact@alnis.dev | My personal site: https://alnis.dev
@alnis is my personal account. @alnis_ptc is my official PTC account.

Comments

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,935 PRO
    Wow

  • EvanReeseEvanReese Member, Mentor Posts: 2,129 ✭✭✭✭✭
    this is sick
    Evan Reese
  • tony_459tony_459 Member Posts: 206 ✭✭✭
    edited August 2020
    A Blender render! Did you export the assembly in a DAE file? How did you capture the gear constraints? Nice job matching render and video cameras at 0:55.
    Very cool.
  • alnisalnis Member, Developers Posts: 452 EDU
    @tony_soares459 unfortunately, materials were not transferring correctly with Collada (dae) or stl exports from Onshape, so I did a STEP export and used https://cadexchanger.com/ to convert it to Collada and that imported correctly on the Blender end. I have a feeling this is a regression in Onshape since I exported a project for visualization using the Collada format in March, maybe April? (found a .dae in my old downloads folder with proper materials dated late March). Come to think of it, the "face colors" update might have broken materials for mesh exports. Now, at least for Collada, a material "ID11" is assigned to all objects, while earlier there would be materials called "IDXX" where XX are two digits and the materials would be correctly linked across all parts with the same color/appearance. I think I'll have to investigate a bit more and then file a bug report. I'm thinking about making a tutorial for efficiently doing renders and animations of Onshape models using Blender, but I need to work out these kinks first :).

    As for the constraints, I actually rebuilt all of the relationships using Blender's driver system. It's essentially a one-way constraint system/chain where you define motion relationships using mathematical equations. The result is extremely fast (real-time 60 FPS) movement for even super complex assemblies when dragging around inputs, but it requires some elbow grease (and often writing out some trigonometry) to set everything up. The .blend file I made actually has correct simulation/interaction between all of the gears and differentials in real time, and I'm hoping to publish it in the next day or two (after I clean everything up, I totally destroyed it in the process of animating :#)

    Also, I'll let you in on a secret: the render and the real-world footage have the gears spinning in totally different directions/speeds, I ran out of time in my time budget to sync them up  :s

    Thanks for the kind words @john_mcclary, @Evan_Reese, and @tony_soares459! It means a lot to me :)

    Update as I write this post: I have literally no experience parsing Collada, but I decided to grep the contents of an old and new export of a Collada file from Onshape looking for "material" and it looks like new exports are assigning a material to do with "ID11" to all objects while older ones have varied materials and objects, so I am now 99.8% sure that this is a regression in Onshape. I'll report a bug and I attached relevant info as a onedrive link. I have no clue what I'm doing, I'm just grepping "material" in files and guessing what might be going on haha

    https://1drv.ms/u/s!AjfbxG8x44KRhto9iZSzMcj3J_quwA?e=H3A0zw
    Get in touch: contact@alnis.dev | My personal site: https://alnis.dev
    @alnis is my personal account. @alnis_ptc is my official PTC account.
  • fnxffnxf Member, User Group Leader Posts: 138 PRO
    Really nice video, good beat too! 
  • michael3424michael3424 Member Posts: 688 ✭✭✭✭
    Very cool!
  • alnisalnis Member, Developers Posts: 452 EDU
    @fnxf @michael3424 thanks so much!
    The music is "Long Road - Futuremono" from the YouTube free music library. You can use it in your own videos without any advertisements/royalties.
    Get in touch: contact@alnis.dev | My personal site: https://alnis.dev
    @alnis is my personal account. @alnis_ptc is my official PTC account.
  • mahirmahir Member, Developers Posts: 1,307 ✭✭✭✭✭
    edited August 2020
    Very cool. Looks fancy, but I couldn't get rid of the nagging thought that it would have been much simpler to just use 4 motors direct driving each wheel, each one with its own simple non-differential gear train.
  • lemon1324lemon1324 Member, Developers Posts: 225 EDU
    Awesome work! Those renders look super crisp!

    @mahir definitely agreed for making this a product, but this approach does let you skip doing any math or controls whatsoever since it mechanically decouples DoFs. I haven't fully thought it through but this might actually be good as a teaching tool to develop an intuition for a Mecanum drive.

    Besides, even if it's totally impractical, it's still really cool! ;)
    Arul Suresh
    PhD, Mechanical Engineering, Stanford University
  • alnisalnis Member, Developers Posts: 452 EDU
    @mahir, that's how it's usually done for robotics since one disadvantage of this design is that when running forwards, sideways, or rotating, you are using the power of only one motor. In contrast, with a 4-motor drive, the full power of all four motors can be applied to any of these actions. It also simplifies the drivetrain a lot, so you can have greater speeds and greater efficiency while saving space. Joshua did this as a proof of "yes, it can be done!" since kinematically, there are three degrees of freedom in the robot's motion, so you only technically need three motors to control them fully. It was the sort of idea where no one had tried it before, and it wasn't proven impossible, so why not do it? The engineering here is definitely above my level; I just did the animation/video! Here's a great example of a high-performance four motor mecanum robot from the FIRST Tech Challenge (Designed in Fusion 360): https://youtu.be/i2g_b54MEFI

    @lemon1324 what's amazing about these renders is that it only took about 1.5 seconds per frame to render on an old GTX 970! The render engine is Blender's Eevee (Extra Easy Virtual Environment Engine). It's completely free to use, and there are lots of great tutorials out there for it, so if you ever need to do a video render, be sure to check it out! I'm happy to help out any time :) Also, for a Mecanum drive, the code is surprisingly simple. Here it is in pseudocode:
    // get inputs from remote controller or autonomous navigation software
    var x = input_lateral()  // left/right motion, scale of -1 to 1 (full left to full right)
    var y = input_longitudinal()  // forward/backward, same scale
    var r = input_rotational()  // ccw/cw, same scale
    
    // set motor powers, assumed that positive power = forwards motion for wheel, there's often a motor.reverse() function to help with this
    motorFrontRight.set_power(y - x + r)
    motorFrontLeft.set_power(y + x - r)
    motorBackLeft.set_power(y - x - r)
    motorBackRight.set_power(y + x + r)
    Thanks for the kind words @mahir and @lemon1324!
    Get in touch: contact@alnis.dev | My personal site: https://alnis.dev
    @alnis is my personal account. @alnis_ptc is my official PTC account.
Sign In or Register to comment.