Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE
Hi Team,
Good day. I am posting this inquiry on behalf of the customer.
"I am doing the stepper-motor control with FOC, which is state control. Now I want to extract and record the state Parameter when the motor runs. The control loop runs once 20 microseconds, and I need a program to acquire a complete set of parameters every 1 or 2 microseconds.
Now I using the Graph Tools, but the sample rate is too low.
The motor position is reported by an incremental Encode, and the QEP Mode in C2000 calculates the rotor position, then according to the motor equation calculates the rotor position in electrical coordinates. the Code is following
StepsValue is obtained through EQep1Regs.QPOSCNT. then convert into micro steps by a constant( conv_rate),
StepsValue = (int32)(pulse_value*(float32)conv_rate);
due to 1600 micro-steps per revolution, so the rotor physical angle is calculated as follows
the Wave should also be saw-tooth, but the Scalar should be in 0-31.
The motor runs counterclockwise as in Graph 1 displayed. And Graph 2 shows clockwise.
Only the StepsValue is right, but the direction of angle-mech is reverse, and others are chaos"
Please help to advise. Thank you for extending your help.
Kind regards,
Marvin