Anuj Dal scored 94 as Derbyshire built a first innings lead of 261 on the second day at The County Ground.
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 mid-wicket.
That brought together the former Glamorgan pair of David Lloyd and Aneurin 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.
All-rounder Anuj Dal said: “At the end of the day, you are trying to put the team in the best position that you can, it’s a bit frustrating when you bat at seven you don’t often get chance to get a hundred, but trying to win the game is the priority.