ED & painful nocturnal erections

has anyone had or know why youd get painful nocturnal erections? particularly in the glans/head of the penis. the glans dont feel full and heavy, but instead hard and like a nail is being driven into both sides. when flaccid its difficult to get an erection without some discomfort/ less pleasurable sensitivity on the underside of the head/ the frenulum.