Some background as to why: (1) I haven't seen this done yet. (2) Human in the loop traction control seems like a recipe for disaster when a LDU produces enough torque to break traction at almost any speed, particularly when used on the front axle.
The LDU setups which retain the Tesla logic board rely on either the driver skill or the inbuilt torque limiting which is tuned for the OEM car that utilises an open differential and brake-assisted wheelspin control. A comment I have heard from several places is that people are preferring to use a SDU or reduce the power output because the car is 'less fun to drive' with more power. We can and should have both if we optimise the axle torque throughput to match the tire capabilities.
This is all new to me so there will be a bit of learning and getting a few/all facts wrong to begin with. Please jump in with helpful info anytime.
A tire produces the optimum acceleration at around 10% slip. Below that the relationship between applied torque and angular acceleration is stable (more torque = more acceleration) and above that it becomes increasingly unstable (more torque = less acceleration, i.e. wheelspin)

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5491023/
traction control therefore needs to modulate applied torque in a similar way to antilock brakes modulate brake pressure in order to maintain a stable state under varying conditions and speed.
We know the axle speed and therefore angular acceleration from the motor encoder and we know the applied torque from the phase current. We don't however know the reference (zero slip) wheel speed or any other forces applied to the tires such as cornering so calculating a simple ratio is probably not feasible.
A simple approach could be to determine the maximum acceleration of the vehicle by trial and error and implement a lookup table of allowable phase current values for a range of axle speeds and PID that to the commanded power/speed. This would prevent gross wheelspin during acceleration but may not optimise the acceleration or be particularly useful at preventing a spinout if accelerating while cornering.
A more complex approach could be to determine the point at which phase amps begin to roll off and angular velocity begins to climb based on a product of these two variables. I'm guessing it will be prone to noise but this could give an active monitoring of energy transfer through the tire (ultimately what we want to achieve) that is independent of the available traction at any point.
ABS brake systems modulate brake pressure relatively slowly, around 5-10Hz so the processing load will not be that great if the same can be true for traction control. I believe field weakening starts at around 150 rev/sec and above that the motor is less likely to produce enough torque to break traction so that would be a logical maximum speed range (approx 120 kph, 9000 rpm motor, 16 r/sec axle). If the traction loop updated at 10Hz that would not be many updates per axle revolution but is similar to the apply-cycle rate of ABS.
tbc