Ranger(Ford) shift motors are the same as the power window motors, 2 wires
12volt on one wire and Ground on the other causes motor to spin clockwise
Reverse the polarity, ground/12v and motor spins counter-clockwise
Window up window down
Shift motor's 2 wires(and power windows 2 wires) are BOTH GROUNDED when not in use
Each motor wire has its own 30amp relay, 5 POLE relay
When relay is off its wire to motor is Grounded
When motor needs to be activated then only one of the relays needs to be activated, disconnecting it from ground and connecting to 12volts, because the other wire is already a ground
Most of these motors have a Thermal Limiter circuit breaker inside
This means when the motor's mechanical mechanism hits too much resistance(sudden high amps) the Limiter opens, cutting ground or 12volts, doesn't matter which, so motor won't turn any more
Which is why windows don't break if you continue to hold the up or down button, lol
There is no other "limit switches" just the Thermal Limiter, on windows or the shift motor
The shift motor has a mechanical stop on its drive wheel because you could damage the transfer cases Shift rod if it was used as the resistance stop for thermal limiter
Widow regulators are tougher, but you can still wear down/strip gear teeth, lol
So all you need to move the shift motor are two 30amp 12v 5 pole relays and a 20amp fused circuit, you want the fuse to blow before the wires or relays, lol
The position of the shift motor is the hard part
But Ford has done the hard work with the contact plate and 5 contacts
Contact plate is on the drive gear, the part that turns as the motor turns the shift rod in transfer case
You would have 4 LEDs(12v lights), all have 12volts with key on
There are 5 position wires on the shift motor
One main wire, yellow/white wire, which would be a full time Ground wire
Then 4 wires, one for each light bulb, the bulbs ground wire
This is what the controller uses to determine shift rod position
Open means NOT connected to yellow/white wire
Shorted means connected to yellow/white wire, in this case gounded
You would use light bulbs instead, say numbered 1 to 4 left to right
1 on
2 off
3 on
4 off
So thats 2WD(2H)
1 off
2 off
3 on
4 on
4High
1 on
2 on
3 off
4 off
4Low