Chain drive & sprocket rigging?

I have a project where I am wanting to model a chain drive, and I’ve had some issues with the drivers, getting the chain to follow the rotation of the gears.

I managed to get the sprocket drivers to work, so that the small gear follows the gear ratio of 3:1, respective to the larger sprocket on the right. I tried copying over the driver from the large sprocket to the chain elements, but it results in a mess when that sprocket is rotated. The links move away and out from the path the chain elements are parented to. I’m not quite sure how to get them to follow the path in sync with the sprockets. I did watch a few tutorials on Youtube, but that didn’t help much as the driver settings they provided were specific for the kind of arrangement they had, and mine is different. Also later I noticed that the small sprocket’s teeth don’t quite match the gaps in the chain, but that should be easy to fix.

What would be the best method to deal with this? Unfortunately, I’m fairly new to using drivers, so I’ve hit a wall here. I’ve included the small .blend file with this chain drive in it.

chaindrive.blend (528.6 KB)

Sorry, left a message where I hadn’t noticed your file.

First, you want your chain and the curve deforming it to have the same transform, because right now, they’re not quite set up right. Unparent both of these with “keep transform”, then set the origin of the mesh object to the location of the curve object. It’ll shift a little; don’t worry about that, we’ll worry about that when we get to the driver.

Second, you don’t want everything parented to sprocket.lg. You don’t want everything rotating when that rotates. Instead, parent everything to some shared parent, like an empty.

Third, to move the chain along the curve, you don’t want to rotate it in any way; you want to move it. Since your deform axis is set to -Y on the curve modifier, you want to move the chain in its Y. So copy/paste the driver to its Y location field and delete the rotation driver.

Now, how much do we want it to move? When I try to do this doing what makes sense, it doesn’t work for me. (It seems that its movement should equal the radius of sprocket, about 0.52 blender units.) So I just tune the driver curve to eye:

chaindrive1.blend (481.1 KB)

Thanks, I appreciate the help here. I probably will try making another set of sprockets, since the small one here didn’t quite mesh up with the chain.