Derbyshire 319 for 3 (Godleman 157*, Madsen 109) v Worcestershire
The pair both scored centuries in a partnership of 253 in 75 overs, Derbyshire's highest for the third wicket against Worcestershire, after Joe Leach had taken two wickets in four balls.
Leach removed Hamish Rutherford and Chesney Hughes with the score on 13 but Godleman's career-best unbeaten 157 and Madsen's 109 transformed the game as Derbyshire closed on 319 for 3.
Worcestershire's decision to bowl first had looked a good one when Leach struck twice in the fourth over of the morning.
Derbyshire promoted Rutherford to open for the first time this season in the Championship but the New Zealander was guilty of a miscalculation when he left a ball and was bowled for 5.
Rutherford showed his annoyance as he walked back to the pavilion and he was quickly followed by Hughes who was lbw three balls later without scoring.
There was certainly enough in the pitch to encourage the seamers and Madsen looked fortunate to survive a confident appeal for leg before first ball against Leach as the batsmen had to fight hard to survive.
Godleman was at his most obdurate, batting though the morning for 23 from 31 overs, but he opened up after lunch as he and Madsen dominated in the sunshine.
A light aircraft circled over the ground trailing a banner relating to Thursday's EU vote but in the middle it was all about staying in with Godleman passing his previous highest score of 55 against Worcestershire on route to his fifth century for Derbyshire.
He reached it in style by launching Brett D'Oliveira's legspin over the long-on boundary shortly before the end of the afternoon session in which he and Madsen added 148 in 33 overs.
Worcestershire were frustrated to have a couple of strong shouts for lbw rejected but the pitch had eased considerably and Madsen completed the 22nd first-class century of his career and his 21st for Derbyshire from 214 balls with a sharp single off Ed Barnard.
Godleman equalled his previous best first-class score of 130 before Madsen tried to force Jack Shantry just before the second new ball and was caught behind.
Neil Broom edged fellow Kiwi Matt Henry just past a diving second slip which summed up how the day had turned against Worcestershire and Godleman celebrated his 150 by driving D'Oliveira for a second six three overs before the close.