Nidec gamma32 4pin pinout
It is partly answer to my question: black wire is GND and red wire is +24v.

It became clear after I saw the layout on the board:



The tracks on the board for the yellow and white wires are very thin, on the other hand the tracks for the red and black wires are thick.