Wait a minute... how is Sonic grinding if the sensor is not even touching the rail?
That doesn't make sense, unless you have another invisible sensor doing the job.
Oh and don't use Sonic as the main position object. Use an invisible circular object as the mask (that means the main movement object, the one that will move instead of Sonic) and set the sprite's position always to the same position of the mask.
On the main site, there's a fully functional static grind movement tutorial. It could easily be implemented in your engine. That is, if you're familiar enough with MMF.