Chris,
I've tried the brain on my lathe & it seems to work. There needs to be a bit of polishing but the idea works. See the attached file.
I've allocated outputs 5 & 6 for the relays. To try it, load the brain file into you brains folder. You should then see it in Mach under Operator/ Brain control. Enable it and go to diagnostics. If you set a speed & start your spindle, Output 6 will start to flash (speed up relay), as the speed passes the requested number, 6 will go out & 5 will come on. ( speed reduce)
I need to include a delay in operation so that the spindle reaches a stable speed before any corrections start & also a bit of dead space to stop chatter.
As I say, it's not exactly right yet but it shows that it's possible.
Hmm it won't let me post brains, I'll try a .dxf ending. If it works you'll have to rename it.
Tony