I have a second order undamped system 1/(s^2 + w^2), where w is the electrical speed of the motor.
Any tips how can I control this transfer function? Can I use the PI controller?
You have given the second order response of your final operator.
To discuss control of a motor you need to define what type of motor: induction, synchronous, variable speed AC, DC, etc. Then you also need to define the response of your sensor (presumed RPM), and finally that of the process you are trying to regulate...
Welcome to automation and controls!