This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28069M: velocity problem gMotorVars.MaxVel_krpm

Part Number: TMS320F28069M

hello,

My application read joystick and send velocity via CAN interface. Project is modified from labs13e. Max speed of motor is 1500RPM. When I send velocity from range 0-1500 and use

gMotorVars.MaxVel_krpm = _IQ((float)speed/1000)

it seems everything works good.

But for example when application use velocity range from 0-20000(example) I need convert to max velocity 1500. So I do

float vel = (float)speed/GEARBOX;

gMotorVars.MaxVel_krpm = _IQ((float)vel)

sometimes motor run with double speed. In expressions window I see that gMotorVars.Speed_krpm show 2x bigger number then gMotorVars.MaxVel_krpm.

When I try convert with this(without cast float) so no decimal number, it is work.

float vel = speed/GEARBOX;