Now that I have cleaned my glasses.....
One way that you can do what you need is to create you own functions like the ones in the FRC default code that I will copy in here. Just use these in place of the code you are now using that forces your arm back and then allows it to move forward again.
These examples are straight out of the default code and will need to be modified to match your existing code.
These are examples only, and will not work "as is".
Code:
void Limit_Switch_Max(unsigned char switch_state, unsigned char *input_value)
{
if (switch_state == CLOSED)
{
if(*input_value > 127)
*input_value = 127;
}
}
And
Code:
void Limit_Switch_Min(unsigned char switch_state, unsigned char *input_value)
{
if (switch_state == CLOSED)
{
if(*input_value < 127)
*input_value = 127;
}
}
These two functions allow the motion to be limited in one direction, but not the other.
For your code, substitute in your PWM to be limited for "*input_value" and your limit switch input for "switch_state".
I assume someone on your team understands code, at least in a limited way, otherwise you would not have been able to get your code operating the way it is already. They should be able work with these.