Gear animation snaps to start at 180 degrees, also how to rig a piston for engine

I started learning how to create animations and as my first attempt I’m trying to create a mechanical scene with bunch of gears and such. But I can’t even get my first pair of gears to turn smoothly. I have two gears, a smaller gear driving a bigger one. Bigger one turns at 0.52 rotation. But no matter how I set up the constraints the bigger gear just resets to 0 and starts over when you go ±180 degrees from the starting rotation.

Blend file attached. In object mode try rotating the smaller gear around z axis and see how the big gear doesn’t work well. I’ve used two different ways (copy rotation and transform constraints) but neither is working. It is part of my full scene so I’m thinking it is possible that there is some weird link or something that breaks it. I am totally stumped.

Another problem I’m having is that I have a piston engine style of mechanical thing in my scene that I can not get to work at all. Basically it is exactly like this but it is resting on its side. Even if copy bits straight from that file I can’t get it to work.

Only tutorials I’ve found in youtube about rigging a piston engine are in french and I have no idea what they are doing.

The smaller gears.blend only has the gears. The slightly bigger one also has the piston motion. So my questions are

  1. what is wrong with my gears and what is causing the bigger gear to jump to different rotation like that?
  2. how to rig a piston engine (crank, connecting rod and a piston moving in its sleeve)

Attachments

gears.blend (2 MB)gears.blend (2.03 MB)

You should use drivers instead of constraints for the rotation of the gears. I have attached an example of your case. There are plenty of examples available of how to rig piston movement. Google blender pistons.
gears1.blend (1.33 MB)

Thanks, I’ll take a look at drivers. Why should I use drivers though? Why doesn’t the constraints work? Are they meant for something else?

I always prefer youtube tutorials because you can always see everything that is being done even if it is not explained. Written guides can be really hard to follow if you are trying to learn the basics. Written tutorials with pictures are most of the time hard to follow because either I can’t find the parameters that are changed or some critical steps are missing or assumed to be common knowledge. This blender’s own driver wiki is a good example:
https://docs.blender.org/manual/fi/dev/animation/drivers/workflow_examples.html
It explains how to duplicate an object (step 1) but doesn’t explain how to add a driver (step 2). In the end I need to treat each step of the example as its own challenge and in worst case I just get totally lost.