Alright, so I finished building my 3D printer (ultimaker 2 clone from aluminium extrusions). and whatever I change in the marlin settings, the speed of my Z axis is really weird as the bed comes up after hitting the home switch. It starts out accelerating really fast, then it abruptly slows down to around 10mm/s and at 40mm from the top it starts a kind of shocking movement. I’ve tried fiddling with the acceleration and mmax speeds in marlin but it won’t change. The extruder also kinda does this when I make the retraction speed higher. is there anyone that has experienced this as well?

It might help to post your configuration (summary) for others to look for specific problems.

That sounds a lot like loosing steps.
If the stepper motor sounds change from a smooth, nice tone to a sudden loud, metallic and uncomfortable buzz, then it’s that your stepper motors are being driven so fast that they loose speeds.

I’m actually surprised that your Z-Axis goes up to 10mm/s, since mine (with a normal threaded rod for screws) gets up to 3mm/s
I’d set the max speed at around 5mm/s, you don’t need it that fast during prints anyways, and I’d also set the homing speed to a reasonable value of around 4mm/s or so.