These three variables
unsigned int CM1 = sonar.ping_cm();
unsigned int CM2 = sonar2.ping_cm();
unsigned int CM3 = sonar3.ping_cm();
and these three variables:
unsigned int CM1 = sonar.ping_cm();
unsigned int CM2 = sonar2.ping_cm();
unsigned int CM3 = sonar3.ping_cm();
are not the same variables.
How you expect the last three to affect any if statement is a mystery.
Go to File + Preferences, and uncheck the stupid random indent value for tab spacing. It makes your code look stupid.