A system for controlling a stability of a milling machine is disclosed. The system includes a frame having a first slope and a leg coupled to the frame. The leg extends and retracts along a length thereof with respect to the frame. The system includes a controller to determine the first slope and to actuate the leg if the first slope is greater than a first predetermined slope.