Linkswitch as current source
Comments
Hello bsala
Have you tried directly connecting the two resistors (removing the FET)? If not please give that a try and would you mind posting the schematic you are using.
I can think of two possibilities. 1. the voltage ripple across C4 and actual switching frequency is causing the non linearity between expected and actual output current. 2. Large ripple across C4 is saturating the opto.
The ripple voltage (Ipk x ESR) across C4 will modulate the output current. Therefore the voltage across R4 will be a function of the DC output current plus the AC content at the swtiching frequency causes by the ESR of C4. As the output current reaches the regulated value and the opto conducts the feedback current is modulated by the voltage generated across the ESR of the output capacitor and this determines if the subsequent cycle is enabled or not. We can say the converter regulates on the ESR voltage ripple of the output capacitor.
Are you using a low ESR cap for C4? If not try a low ESR type and if yes then try a larger value (reduce ESR by 50% by connecting second cap in parallel) and see if that makes a difference and post the results.
Cheers
PI-Chekov

With 22 ohms ideally you should get about 50 mA.
Try and use 200 or 220 ohms in place of R3.