CASTEP will converge to the lowest energy state which is close to your initial configuration, so you need to initialise your calculation in the appropriate magnetic state. In your cell file you should specify the initial atomic spins to the appropriate values, e.g. if you had a system of 2 Cr atoms and 1 C you might have
%block positions_frac
C 0.0 0.0 0.0
Cr 0.0 0.2 0.1 spin=2.0
Cr 0.0 0.1 0.2 spin=2.0
%endblock positions_frac
(ignore the values for the fractional positions, I just made them up so you had a valid input block.)
This initialises the Cr atoms in a ferromagnetic configuration, both of them having a spin of +2 hbar (so 4 "up" electrons). The carbon atom will be initialised with no spin. If you wanted an antiferromagnetic initial guess, then you could put something like:
%block positions_frac
C 0.0 0.0 0.0
Cr 0.0 0.2 0.1 spin=-2.0
Cr 0.0 0.1 0.2 spin=2.0
%endblock positions_frac
i.e. one chromium now has a spin of -2 hbar, or 4 "down" electrons, and the other is still +2 hbar.
In your param file you set:
spin_treatment : scalar
(or "collinear", CASTEP accepts either.) CASTEP will fix the total spin of your system for a few iterations while the wavefunctions etc. converge to something more physically meaningful than their initial guesses. Occasionally you might want to increase the number of iterations it keeps the total spin fixed for, and you do this by setting e.g.
spin_fix : 14
in the param file (to fix the total spin for the first 14 SCF cycles).
It would be helpful if you give some suggestions about the Ferrimagnetic configuration as well just like you have given above about the Ferromagnetic and Antiferromagnetic configurations.