3 phase hybrid stepping motor

This a photo of the motor:
Imgur

There are 23 wires connected to the PCB:

  • 3 for the three phase motor,
  • 4 for the optical shaft encoder (within which there is also a resistor attached)
  • 13 go towards what used to be the printer head
  • 3 to mechanical switches and resistors that refer to the printer head (but for which I do not have full knowledge).