I thought that, seeing the Bode plots one could tell if the closed-loop system would be stable if the 0 dB crossing occured at a lower frequency than the −180° crossing.
The usual formulation is to say that the phase margin at the 0dB crossing is > 0. Matlab adds a vertical line to the phase diagram at the frequency where 0dB is. The length of that line is the phase margin.
The important thing to remember is that $L(s) \neq 0.1 L(s) \neq 0.01L(s)$.
By multiplying a transfer function with a number, you create a different transfer function (that describes a different system), which may or may not be stable.
The answer to the question why something multiplied by an arbitrary number, that's different from 1, does not behave as if being multiplied by 1 is because an arbitrary number different from 1 is, well, different from 1.
The phase margin is a good way to decide about stability of a system in a yes/no fashion.
But it looks like you actually want to add a variable gain $k$ to the transfer function. The question now is, for what values of $k$ is $kL(s)$ stable?
You can answer that question by choosing arbitrary values for $k$ and do the above analysis. As you experienced, this is somewhat tedious and only answering the question for discrete values of $k$.
To get the range of values for $k$, you have to approach the problem from the other direction, that is: find the gain margin from looking at the phase diagram instead of finding the phase margin from looking at the magnitude diagram.
You know that crossing the line of -180° is the critical point where the system becomes unstable at the gain of 1. Again, changing perspective now: look at the phase diagram and find the points (frequencies) where the value is -180°, now find the corresponding gains in the magnitude diagram above.
As you can see, matlab is already doing that for you. Your phase diagram intersects -180° at two points and matlab draws the gains at those frequencies into the magnitude diagram.
Changing the gain, means moving the plot in the magnitude diagram up and down. In your case, if you (choose a gain so that) move the plot down as far as the right gain margin is, the system will become unstable at that point. Moving the the plot further down (decreasing $k$ even further) will result in a an unstable system until the gain is decreased below the value of the left gain margin. The system will be stable for lower $k$ values.
I added two shifted versions of the magnitude diagram into the first body plot, one with the right gain magin (red) and one with the left gain margin (red):
If the magnitude diagram is between the red and green lines (blue area), the system is unstable. This is because the original condition for stability is false in that area (and only in that area): The phase margin at the 0dB crossing is > 0.
If you draw the root locus, you will see that there's one branch that starts in the left hand side (stable) moves into the right hand side (unstable) and later returns to the left hand side. The values for $k$ at which it crosses the imaginary axes are the two values for the gain margin.
Btw, this is why it's called "pole placement": you move the poles around in the root locus so that the system becomes stable.
The bode plot has two points that are critical for stability:
- the 0dB crossing in the magnitude diagram
- the -180° crossing in the phase diagram
looking at either point in one diagram, and looking at the other diagram at the same frequency allows to make some assumptions about the stability of the system:
- At the frequency of the 0dB crossing in the magnitude diagram, the value of the phase diagram should be > -180°. In other words: there should be a positive phase margin. The phase margin is a qualitative measure about how far away the system is from being unstable. The bigger the phase margin, the further it is away from instability.
- The range of frequencies in the phase diagram with a value < -180° (In other words: a negative phase margin) are those frequencies where the values of the magnitude diagram are not allowed to cross 0dB in order to ensure stability of the system. The boundaries of the range of frequencies (or ranges if there are many) are the -180° crossings in the phase diagram. The gain margins in the magnitude diagram at those frequencies determine the values for the boundary of the range (or boundaries of ranges) for the value of a gain $k$ for which the system will be stable.