Myself I would mount a disk or crank arm on a torqey gear motor, either hydraulic or electric. Then a variable length connecting rod on a pivot point on disk or crank arm. By varying pivot point on disk max travel could be set. Varying output point on connecting rod sets max swing other direction.
Doc


Warning: Reading is addictive and may serve as a "gateway" drug to the unregulated accumulation of knowledge!