But 25khz is not nearly enough.
Assuming the steps go to a Gecko, that's 10 microsteps/fullstep, and a Taig 20 tpi leadscrew:
That's a theoretical max of 37.5 ipm. But, that's only ONE speed and not applicable to most any CNC case.
The problem of reality is that you've probably got pulses broken down into 40us timesteps of resolution. If a program asks for 30 ipm, that needs 50us steps. The only way this will be accomplished is to space step pulses steps 40us, 40us, 40us, 80us, 40us, 40us, 40us, 80us. That's FAR too rough to step "properly". There's a huge deceleration asked for during the 80us-step and then acceleration before the next 40us. That's also a big phase error and can easily cause lost steps. It's only able to regulate the pulse width "well", such as as +/-10%, at 3.75ipm. In that case you'd have 400us, 400us, 400us, 440us, 400us, etc. I believe it would still have measurably degraded performance over 1% pulse width control.
Even assuming I'm mistaken and this can actually adjust spacing to intermediate spacings between 40us and 80us, the total PIC18F4550 capability cannot physically exceed 83nS steps, and in reality it's not possible to get that kind of resolution. That's where I concluded it's generally NOT possible to do with a PIC18F when evaluating my project earlier.