Derbyshire 381 for 7 (Madsen 103, Broom 96, Thakor 86*, Coles 4-75) v Kent
Coles took 3 for 9 on his return from suspension to reduce the home side to 35 for 3 but Madsen with his 20th first-class century for the county and Broom with 96 led a recovery that was continued by Shiv Thakor's unbeaten 86.
Although Coles took his fourth wicket with the second new ball to end with 4 for 75 from 26 overs, Thakor and Tom Taylor shared an unbroken stand of 69 in 11 overs to take Derbyshire to 381 for 7 at stumps.
It had looked so different when Coles got the ball to move sharply during an opening 10-over spell from the Racecourse End that raised doubts over Derbyshire's decision to bat.
Chesney Hughes had come into the game in prime form but his average plummeted to under a hundred when he was trapped lbw without scoring by the 15th ball of the morning.
Hamish Rutherford had made an unbeaten 71 in the T20 Blast victory over Lancashire the previous day but he made only 5 before he left a ball from Coles and had his off stump knocked back.
Coles was asking questions of all the batsmen and the quality of his bowling was highlighted by Billy Godleman's innings of 3 off 40 balls before he edged onto his pad and was caught at gully.
At that stage, Derbyshire were in danger of crumbling but Madsen played positively from the start and with Broom, took the initiative away from Kent.
After Coles was withdrawn, batting became considerably easier and by lunch, Madsen and Broom had established a platform that allowed them to dominate in the afternoon.
Broom, who had flicked Calum Haggett for six over square leg early in his innings, underlined his increasing confidence by lofting James Tredwell over the long-on boundary before driving the former England spinner for his first four.
Madsen revealed his pedigree as a former international hockey player with the reverse-sweep that took him to his century but when he tried to dispatch Tredwell over long-on, he was well caught by Adam Ball.
But there was no respite for Kent as Broom and Thakor added 85 in 19 overs with Broom moving to within four runs of a century when he was beaten by a full length delivery from Ball and trapped lbw.
Thakor completed his second 50 of the season before Kent struck two quick blows as Tom Poynton edged a drive at Mitch Claydon and Matt Critchley played across the line at Coles but by now the balance had shifted towards Derbyshire.