What is the right way to patent an idea under PhD studies?
You should ask yourself why do you want a patent. You should only do if your goal is to commercialize the idea. Because patent is very expensive to file, and also expensive to maintain.

If money is not a problem, filing a patent is extremely simple. Here are some absurd patents. You only need a vague idea, no need implementation, evaluation etc. You don't need to be better than the state-of-the-art, you only need to be "different". 

I'm a mediocre researcher who had never published more than 3 papers a year. More than 6 months in my current company, I already submitted 4 patents. Believe me, this is not what I want.

I said it is extremely simple because at my company, there is a team of lawyers that prepare the documents, and they also hire lawyers from another company. All I need to do is to present some slides. However, if I have to prepare these documents myself, I would not be able to do it.