Robot arm control for Brain Machine Interface