Although i do not know what other code in the part you are talking about, I do know what LimitMax is doing.
As you can see, the number being entered into the function is well over 2000, while the maximum that can be put to the PWM is only 255. What Limit_Max is reduces the input number, and its output is limited to the 0,255 range valid for the PWMs… On my team, we just skipped this and made all numbers signed so we could just add 127 making the range from -127,127, to 0,255… but I would not advise doing this without knowing what you are doing, you may miss something and mess up the entire code.
Do yourself a favour and don’t play with limit mix. In our first year (last year) we had no idea what we did, so we removed it in some variations of the code we made…
Some of the junior programmers ended up having the robot with the wrong code (limit mixed removed, among other things). The robot went crazy almost ran over a few people.