This is a follow up to my previous question about scaling. After a day of looking into this I'm still confused, but I'm pretty sure it's scaling. I have a non-zero value for u_dq.d but a zero value for u_ab.alpha when in the align_start state and the PWM stays at 50%.
When I go into align_start I set i_dq_desired.d to about 100mA. My current rail is 3.125A, the value I see for i_dq_desired is d=262136 i=0 (262136/(0x7FFFFF/3.125)=.098). So that is OK.
The value I see for u_dq is the same (262136). I'm confused about that, since looking in the eTPU code the comments for the PMSMVC_PID_OFF case say:
/* u_dq.d = i_dq_desired.d / 4; */
/* u_dq.q = i_dq_desired.q / 4; */
so I expect u_dq.d to be 262136/4=65534. Is the /4 to convert from 1.23 to 3.21 format?
In either case, I have a non-zero u_dq.d. In the PMSMVC_PID_OFF case the eTPU code goes directly to PMSMVC_INV_PARK_TRANSFORMATION. This does:
MC_TRAN_PARK_INV(u_ab, u_dq, sin_cos);
/* u_ab values contain quarters of the actual values (format 3.21) */
Since we're stationary MC_TRAN_PARK_INV should be a form of identity transform. The position is zero, theta = *p_qd_pc * encoder_scale is zero as well, and the output should be the input value times 1 in fract24 1.23 format. Is that correct? I assume the call converted it back to 3.21 format.
In desperation to see something happen I disabled reading the bus rail and set it to zero, assuming the ripple eliminator would see the values above the bus rail and return +/- 1. Sure enough, when I go into the align_start state it slams to a fixed position. So something is screwy with my units.
The answer is: It doesn't work. I finally hacked in a set_u_dq_clim to set the u_dq after the circle limitation and called that in fs_etpu_app_pmsmesvc3_align_start. There is now an output current, the motor goes to the alignment position, and then it will turn.
However, looking through the etpuc_pmsmvc.c downloaded from Ashware there is no separate u_dq_clim parameter.
I got the AN3206SW from Freescale back in January when they updated the link. Is there any way to get a known matched set of the eTPU code that is generated by the eTPU function selector and the AN3206SW software?
At any rate, at least my motor is turning now.