Dear Community,
In Reference to the RA6T2, we would like to develop a e-bike PMSM motor controller using RA6T2 platform and i found example code for Hall sensor based FOC which is good for my application. But the entire control loop is designed for speed control loop. My application need a Torque control loop and speed varies with torque in e-bike's. Can you help with what modifications has to be done to this example code to modify it to Torque control loop ?
https://www.renesas.com/us/en/document/apn/120-degree-conducting-control-permanent-magnet-synchronous-motor-hall-sensors-mckmcb-ra-family?r=1542426
Thanks,
Naga Penmetsa
Hello Naga,
Thanks for reaching out Renesas Technical Support
Torque control loop means that you control the motor currents direclty, without using the speed controller. By setting Iqs, you control the motor's torque. The equation that you will need is:
Τοrque[N.m] = Iq[A] x Torque Constant [N.m/A]
The torque constant is usually given from motor manufacture's datasheet.
So, you need to control the Iq current directly.
This can be done, using the Motor Current Controller stack. You can find an example on how to use it from the link below:
https://renesas.github.io/fsp/group___m_o_t_o_r___c_u_r_r_e_n_t.html#gab118cba8bd337f696b4b86e0093784f6
Just one more comment. On the link above you will find a demo project that describes how to use motor controller, but if you need to rotate the motor you have to impose a rotating current vector, so you need to modify the phase regularly., by using SpeedPhaseSet function.
Regards,
AL_Renesas
Any feedback from your side?
Was my previous response helpful for your implementation?