Measuring speed correctly

As you can see here, It just goes negative If i go south. Will absolute functions fix this?