We are very sorry to hear of your difficulty with headaches and headcovering.
You should leave your hair uncovered at home when alone or in the presence of family members. We recommend asking your rabbi whether, given your severe headaches, you may uncover your head at home even if some male guests are present. You can also remove your headcovering outside the home when only other women are present, and you can be confident that men will not be coming in and out. Giving your head as much of a break as possible can make a big difference.
Try experimenting with different types of headcovering (scarves, berets, wigs, you name it) and different degrees of looseness and tightness to find whatever can be most comfortable for you, even if it means letting a bit more hair show than you otherwise would.
The Wrapunzel website suggests trying an anti-slip headband under a scarf, and wrapping the scarf loosely in a style that does not require tying knots. https://wrapunzelblog.com/photo-inspiration/faq-tips-and-tricks/ .
To really address this issue, it is important to see a specialist in headache medicine who can help diagnose and treat the underlying condition, whether allodynia or scalp fatigue or something else.
Please let us know if we can be of further assistance.