I tried many of the suggestions here, and i was going crazy.
I had resorted to laying it flat on the table in order to use it.
Could not use Kensington keyboard since that was upside down.
Unhooked keyboard, turned bluetooth completely off.
Turned the IPad completely off 2 nights in a row.
Went to setttings each day and fiddled with them, re-doing virtually anything that I thought might make a difference.
Continued to tap periodically on edge of pad.
Third day, turned it on, and the orientation was OK.
I am typing this with the Kensington keyboard re-attached, and for now, it is fine.
I have had several intermittent issues with the IPad Air (screen freezing, becoming unresponsive to touch, randomly deleting from 'notes", etc.), but so far, they have resolved semi-spontaneouly, usually after a couple of days of fiddling.
I fear that Ipads may have a life of only a couple of years. (Mine is almost two.)
Given the price, that leaves me less than enamoured with my IPad Air.