In systems with absolute encoders and brushless motors that are being driven by a sinusoidal drive such as the D3540/D3640 or DMC-30012, you can take advantage of the absolute position information to commutate the system at power up without using BX or BZ. Instead, you can measure the phase relationship and then run a #AUTO routine using that relationship to automatically commutate the motors. To do this, you will need to follow these steps.
- Commutate successfully using the BX or BZ command.
- Move the motor to the zero position using PAA=0;BGA. If position zero is not physically reachable, positioning to a factor of the axis' brushless degrees is also acceptable (i.e. PAA=_BMA * 2).
- Make sure you have zero or a very little TE value so that you are exactly at the encoder zero (may need to use small KI to get position error to zero).
- Then issue MG_BDA.
- The value that is returned is by MG _BDA is the "offset" of your magnetic modulus and should be entered into the program below as the variable "offsetA".
The trick is using the BI-1 command (without using the BC command) so that you can directly enter a BD value based on the calculated value.
Here is the example program:
'this code allows the user to initialize their D3540
'based on the absolute position of the SSI encoder
~a="A"; 'axis A
'SI~a=1,-19,19,0<12>1; 'input SSI values
BM~a=131072; 'insert brushless modulus
BI~a=-1; 'not using halls but using BI-1 as a way to set BD directly
'find offsetA value by initializing with BX or BZ and then
'move to PA0 and query MG_BDA
bdA=bdA%360; 'modularize to 360 degrees
Absolute encoders are the main reason this type of commutation would be used. However, it is possible that it could come in handy to validate commutation (ie: move to the index location or hard-stop and measure _BD to verify it matches with a "known" good _BD value that is stored in the program).