I am trying to design a balance controller for a robot. With MATLAB simulink I arrived at the transfer function between the input and the pitch angle for the robot. I have plotted the bode and Nyquist plot below.
As you can see, the Nyquist plot looks very weird, and in the bode diagram the signals at low frequencies are attenuated. To fix this, I added a zero at the peak of the magnitude plot, so $$\omega_i=10 \text{rad}/s \Rightarrow \tau_i = \frac{1}{\omega_i}=0.1\text{s}$$
This results in an I-term which looks like this: $C_i(s)= \frac{\tau_is+1}{\tau_is}=\frac{0.1s+1}{0.1s}$
When I add this to the controller the bode plot now becomes.
Now I also want to add a lead-term to prevent overshoots but the way I usually do that is to change the crossover frequency $\omega_c$ such that there is good phase margin, define some constant $\alpha$, and then find the lead term with the formula $\tau_d = \frac{1}{\omega_c \sqrt{\alpha}}$. Then I can make my lead-term with $$C_d = \frac{\tau_d s + 1}{\alpha \tau_d s + 1} $$
But when I look at the current phase plot, it all around looks like there is no trouble regarding the phase margin. The phase is never close to $-180^{\circ}$ so I am not sure how to proceed with such a weird looking phase plot.
So my question is, how do I find my lead-term when the phase plot looks like this? Is there another way to do than I have proposed?
Edit
The open loop transfer function between the input and pitch angle is $G(s) = \frac{ 5.893e05 s^4 + 7.71e08 s^3 + 1.435e11 s^2 + 2.566e12 s + 7.683e09}{s^7 + 2418 s^6 + 1.317e06 s^5 + 1.977e08 s^4 + 1.312e10 s^3 + 1.796e11 s^2 - 9.658e11 s - 1.525e13}$ Using the "pole" command in MATLAB I noticed that there was a pole in the RHP which should cause some instability.