A patient support apparatus comprises a base and a patient support deck. The patient support deck comprises a back section capable of articulating relative to a seat section. A lift system lifts or lowers the patient support deck relative to the base. An articulation system articulates the back section relative to the seat section. Head end side rails are mounted to the back section to articulate with the back section. A controller controls operation of the lift system and/or the articulation system to prevent the head end side rails from colliding with obstacles, such as the floor surface.