Pixhawk 2.4.6 and MaxSonar-EZ0 (in front)

I’m having a problem on my quad I’m using a pixhawk 2.4.6 and a sonar MaxSonar-EZ0, the sonar is IN FRONT OF THE QUAD …
I would like to know which parameter I change in the pixhawk (using mission planner or similar), when the sonar detects object the quad stops or has another attitude.

The quad had a standard attitude that increased the throttle but after an upgrade he lost this attitude.

I installed the sonar and changed the parameters with the help of the link: Maxbotic Analog Sonar - Copter3.2 — Copter documentation