First, a comment on electric flaps . . . it is not worth the trouble unless you have a special reason. Too much time, weight, and complexity. With that said . . .
The flap motor was taken from a satellite dish actuator. It has a 36 volt DC motor and gear reduction in one unit. It runs on 12 volt DC power and is wired for 5 amps.
The drive unit has a 3/8" diameter shaft with a 3/16" hole through it. This originally drove the satellite dish jack shaft. In my application, it is connected to the flap jack shaft via a small universal joint.
The jack shaft has a threaded end that push/pulls on the flap torque tube.
The torque tube has a tab installed that trips the limit switches. There are two microswitches wired in series for both up and down stops. When either one of the switches open, the flap motor will turn off and no longer drive in that direction.