How to Make Acceleration to work on X and Y Axis, back and forth

I’ve been trying to use my AR Glasses accelerometer and my phone, both based on android. Neither one works with acceleration.

if I limit it to just X Axis it works perfectly going one direction one way and the speed is accurate.

But it will not go back and forth. If I connect y to add movement input it is jittery and continually goes to the right and forwards. It only
goes one direction. Using tilt makes it accelerate using tilt, I want it to accelerate based on acceleration on real world speed.

Why does accuracy not work two ways, in only one direction? Is there a way to make it go back and forth or can acceleration not detect forward
and reverse acceleration?

Do you need negative acceleration or will that cancel everything out?