I need to build a conversion/mapping algorithm from a controller (PID etc.) output to the duty cycle in order to command my bldc motor via esc. I couldn't do it yet because l think l dont know the meaning of controller output. Anybody highlights my way?
Usually you would use a PID controller's output as a "substitute" for your (the operator's) output. If you bypassed the PID controller, what signal would you be providing to the ESC? It is easiest to put the input to the PID controller and the feedback to the PID controller in the same units as you would like the output to be.
In your case, I would use a input and feedback as speeds in percent, then the output of the PID controller should be speed in percent, which is easy to provide in PWM form. If you try to compare speeds in km/hr or m/s or something else like that, then you wind up having to convert that speed into a percentage anyways because you don't send "2 m/s" to a speed controller, you send a speed setpoint - either in rpm or percentage. Again, whatever units the ESC is using are the units you should be using for your PID control.