How to tweak gears using drivers?

I’m using v2.66.a and am working on a set of gears. The details may sound complicated so I include the .blend file.

Each gears uses drivers pointing to the previous gear. All is well except for a variation in the rotation that I need to introduce. This is going to be a model of the Antikythera Mechanism. The rotational period is correct but the idea is that the k1 gear speeds up and slows down during one rotation. In the physical world the gear uses a pin on the bottom gear (k2 gear) that drives the top gear (k1 gear) via a slot. The k2 and k1 gears are on slightly offset axis(s).

I can’t figure out how alter the driver and get something that makes sense. A sine wave modifier added to the basic rotation doesn’t seem to follow the motion I need. Is there a way to create a custom curve to add/subtract to the basic motion. A detailed step-by-step would help.

I did a brute force keyframing instead of drivers but I would like to see what is possible using drivers, plus drivers adjust to varying input speeds.

btw What are the values on the vertical scale of driver graph?? They seem super large.

offest gears with drivers.blend (762 KB)

This is possible with constraints;
Put an empty on the pin, parented to k2.
Use a “locked track” constraint on k1, locking y, tracking -z to the empty.

Like this:offest gears with constraints.blend (797 KB)

Cool, simple elegant solution Solvent.

@Solvent
Nice…

I had almost given up on an answer. I was so fixated on a driver solution. The constraint makes the answer so simple. Thanks Solvent.