Nonlinear adaptive control example

I’m looking at Nonlinear adaptive control — NengoExamples 22.1.22.dev0 docs example code.

I don’t fully understand what the nonlinear adaptive control ensemble does (block 11). From the code, it seems that the ensemble represents the arm joint angles as a learning context, and the error that is sent to PES is the negative OSC output.

From my understanding, PES will learn to return the same output as the OSC from the arm joint angles, which means that this adapter just amplifies the OSC output and does not really learn the new gravity impact.

Can someone explain how the adapter works?