Glamorgan 168 (van der Gugten 46*, Chappell 6-47) and 39 for 0 trail Derbyshire 429 (Dal 94, Came 84, Madsen 70) by 222 runs
Dal made 94 from 135 balls after Harry Came, with 84, and Wayne Madsen’s 70 put Derbyshire on course for a big first-innings total.
Glamorgan spinner Ben Kellaway took his first wickets in first-class cricket, finishing with 3 for 59, while Mason Crane claimed 3 for 43 as Derbyshire were bowled out for 429, a lead of 261.
Glamorgan were left with a tricky 12 overs to negotiate but they survived to close on 39 without loss, still 222 behind.
It was a good day for batting with the County Ground bathed in sunshine which was a good sign for the overnight pair of Came and Madsen who proceeded in untroubled fashion to move past Glamorgan’s modest first innings.
Ned Leonard again offered too much width which allowed Came to settle back into his innings by twice dispatching short balls to the point boundary.
Glamorgan’s attack struggled to impose a measure of control with Madsen reaching his 50 off 88 balls and the stand was worth 130 when Came threw away the chance of a century.
The opener came down the pitch to hit Kellaway back over his head but the bowler leapt to take an excellent catch at the second attempt to claim his maiden first-class wicket.
He soon had a second as Madsen attempted a slog sweep but got under it and skied a simple catch to midwicket. That brought together the former Glamorgan pair of David Lloyd and Anuerin Donald, who was intent on taking the attack to the bowlers.
He pulled Dan Douthwaite for six and crunched Kellaway through the covers to move to 28 from only 22 balls before a smart piece of wicketkeeping removed him two overs before lunch.
Donald paddled Kellaway around the corner but Chris Cooke had anticipated the shot and moved across to take a fine catch at leg slip.
Even so, it had been a productive morning for Derbyshire who led by 79 at the interval and they tightened their grip on the game in the second session.
Lloyd was closing in on a half-century against his former team-mates when Crane got one to spin between bat and pad to take the off stump.
Glamorgan’s hopes of wrapping up the innings quickly faded as Zak Chappell again showed how well he can bat by sharing a stand of 67 from 99 balls with Dal who straight drove Leonard for his sixth four to reach 50.
By tea, the lead was over 200 but rather than give their bowlers a session to go at Glamorgan, Derbyshire batted on for another 18 overs, presumably to give Dal a chance of a century.
Pat Brown stayed with him for 89 balls while another 48 runs were added but Dal fell short when he drove Crane to long-off.
That left Glamorgan with an awkward period to get through and Kellaway enjoyed another landmark when he edged Chappell for four to open his account in the first-class game after three consecutive ducks.
Chappell should have removed Billy Root in his next over but Donald spilled the chance at third slip and the pair stayed together to provide Glamorgan with some comfort at the end of another challenging day.