help with pwm

I am trying to control a proportional controller with this circuit.

the problem is when I do an analoguewrite the controller comes on max power at analoguewrite 1 and it is at its lowest power at analoguewrite 160, surely this is the wrong way round.

It would appear that your circuit is working correctly. At analogWrite 1 the transistor is off so the SSR sees max voltage on its input.