Forums/Tutorials/Laser Cutting Tutorials & Tips

Gears and Joints with SketchUp & Sketchy Physics

Rich Decibels
posted this on April 05, 2012 21:47

Sketchy Physics is a plugin for Google SketchUp that allows you to simulate mechanical models. It is very capable but also very frustrating so be warned!

I'm working on a design with lots of gears and linkages. SketchUp with Sketchy Physics is up to the task but it is a steep learning curve, with lots of bugs and weird gotchas. Here's some basics that worked for me, to get you started. I'd highly recommend scanning over this tutorial first.

Gears

I use the Involute Gears plugin to draw gears in SketchUp.

tut01_-_gear_2d.jpg

Using the settings shown, the 2-dimensional gear is placed at the origin as its own group. Double-click to edit the group, and push/pull it to make it 3d.

tut02_-_gear_3d.jpg

Sketchy Physics (SP) needs to be told what shape to model your object on. We want to use 'convex hull'.

tut03_-_convex_hull.jpg

If you switch on the debug mode 'Readback Collision Geometry', you will see what shape SP is using for your object, when you start your simulation.

tut04_-_debug.jpg

To check this, first add a floor, so your gear doesn't go plummeting off the screen.

tut05_-_floor.jpg

When you hit 'play', you will see a problem: the black outline is how SP 'sees' your object. The 'convex hull' shape hasn't taken into account the spaces between the teeth.

tut06_-_play.jpg

So we need a better method of telling SP where the teeth are, and where the gaps are. To do this, we need to break the gear up into little pieces. We'll start again from the top, so delete everything.

Draw a gear with the Involute Gear tool, double-click to edit the group, and draw these three lines on the face.

tut07_-_lines.jpg

Delete everything apart from these two shapes: let's call it a 'tooth' and a 'spacer'.

tut08_-_deleted.jpg

You want these to be two distinct components, so its easiest to duplicate them ('M' for move, then 'Ctrl' to make a new copy)

tut09_-_duplicated.jpg

Delete the originals, then push/pull to make the pieces 3D. Then right click on each object and select Make Component

tut10_-_3d.jpg

Now make sure that you give each component a 'convex hull' shape.

tut11_-_convex.jpg

Now move the two components together and use the rotate tool to duplicate them round about the origin ('Q' for rotate, then 'Ctrl' to make new copy). I found it easier to match the edges perfectly by first making a mark where the tooth should meet the spacer. Precise rotation can be buggy in SketchUp too; you might find it helpful to increase the angular precision in the Model Info tab (in the Window menu).

tut12_-_rotate.jpg

Continue rotating and copying until you have a complete gear. Make sure all these components are in one group (if you've followed the directions exactly, they will be.)

tut13_-_complete_gear.jpg

Now to test that SP sees things the way we do, put a floor back in and set the group's debug mode to 'Readback Collision Geometry', and hit play. You can see that the black outlines now conform to the shape of the gear.

tut14_-_outline.jpg

Now to make something happen! We'll add a hinge joint to the center of the gear: click once at the center of the gear, then click again to set the axis of rotation.

tut15_-_hinge.jpg

First, use the Joint Connector tool to attach the hinge to the floor: select the Joint Connector tool, click the hinge, then hold 'Ctrl' and click on the floor. (If you zoom out you'll see the joint is bordered in yellow and the floor is bordered in green.

tut16_-_jointconnect.jpg

Now you connect the Joint to the gear by grouping the two together.

tut17_-_group.jpg

Now when you hit play you should be able to grab and spin the gear around the joint! A gear is not much fun on its own, so duplicate the gear+joint group and place it alongside the original. Joint connections tend to get messed up when you make a copy, so delete the new joint, add immediately add a new one in its place. Reattach it to the floor with the Joint Connector Tool before you regroup the two (gear + joint). Now when you press play, the gears should mesh and turn together.

tut18_-_dup.jpg

You can set one of the joints to rotate automatically with the accel (acceleration) and damp (friction) settings in the UI.

tut19_-_ui.jpg

And there you have it! Time consuming and frustrating, maybe, but its free and it works!

Getting more complicated

I'll follow up this tutorial with another one next week that will show you how to make more complicated mechanisms with floating joints. In the meantime, if you don't want to wait, check out this tutorial on joints and groups. I've also attached my SketchUp file so you can play along at home.

Update: Here's Part 2 of the tutorial.

Sketchy Physics Gotchas

  • Save all the time! My installation at least crashes very frequently.
  • Groups of less than a certain volume are ignored, so scale everything up 10x if you're seeing weird behaviour.
  • Turn gravity off unless you need it.
  • Always attach a hinge to a grouped object (see dummy square hack).
  • Put damping on all your hinges
 

Comments

User photo
sanju yadav

thanks for this,but i am not able to get involute gear tools(i am using sketchup )?

July 10, 2012 06:16
User photo
Rich Decibels

Involute Gear is a separate plugin: http://www.ohyeahcad.com/download/

July 10, 2012 12:02
User photo
Karibe

Thank you, i have really been looking for this :D

May 17, 2013 04:46
User photo
Marc

... thanks for the tutorial!

to auto-generate gearwheel shapes

(e.g. for importing them as eps, ai, svg ...

any "sketchup-importable" shape)

one might use

http://woodgears.ca/gear_cutting/template.html

... don't know if that might help

to cut down the time for generating the gearwheels' shapes ...

November 12, 2013 05:41