Hi Rodrigo,
No, no motorcontrol specialist at all actually, just a guy who tinkers with a lot of stuff, trying to pick up on what ever interests me at the moment ;-)
question1:
i don't understand theese variables:
pid_I_Clamp = 100 'Clamp I-term to max ±100
pid_Out_Clamp = 511 'Clamp the final output to ±511
The pid_I_clamp helps preventing what is called integrator wind-up. Let's say you are controlling the position of a motor. You command a new position but the mechanics that the motor is moving is blocked so it can't move. The I-term will now start to add "effort" to the total output of the filter to get the motor moving (decrease the error) but since the mechanics is blocked the error won't change so the I-term gets larger and larger and larger. When the mechancis finally "loosens up" you can imagine what happens. So with pid_I_clamp you can set the max amount of "effort" that the I-term will apply to the total output, no matter how big or how long the error persists.

(Another thing is that the I-term output is not protected from overflowing internally so we have to clamp it to something)

pid_Out_Clamp works the same way. Let's say you are running a 12V motor with a 24V powersupply. Applying full power (24V) to the motor may damage it so you can use the pid_Out_Clamp to prevent the final output of the PID-filter to ever go above a certain value, for example.


question2:
I see it controls position. ¿Does it control speed?
"It" controls anything you like. You provide it with an "error" and gives back a "drive-value" based on the gains etc that you've specified. It doesn't know or care what it is you are controling. With that being said it may lack features that is better suited for controling one thing or another, like feedforward etc but more or less, it doesn't care.

question3:
from my pc i get two parameters: position and speed. i want to preset a 1 second of gradual speed increasing (you know, for not damaging mechanism & stuff..) and speed decreasing for before getting to the given position. Do any of your PID inc file variables handle this parameter/s or i need to do it by myself?
No, there's no trajectory planner built in. If you want acceleration and deceleration ramps you need to "slowly" increase the "setpoint" to bring it up to speed and so on.

Hope that answers your questions.

/Henrik.