The way I (and many others) implemented haptics does exactly what you say- it’s using a PID in torque mode, where the P term is scaled with angle error from the knob, so increased turning results in increased force until it passes a threshold. In my case I just snap to the next detent, but the code I shared above you can put whatever you like at the snap moment or change parameters so that each detent is feeling different. You really should try to read this thread: Haptic textures - #4 by Antun_Skuric