On Wed, 3 Jul 2024 at 20:32, Viesturs Lācis <viesturs.la...@gmail.com> wrote:
> I believe that I need to specify encoder-offset parameter, but I do > not understand how exactly encoder-offset value for BLDC component is > calculated. I think that the motor "zero" angle for the 8i20 is defined as where the motor sits with V+ connected to U and V- to V and W. If this is where the index pulse is, then your encoder offset is zero. You could do this with a bench PSU, but it's mayeb easier (and closer to the real setup) to do it in a command-line hal session reset the encoder to the index, then setp the angle to zero and setp the current to a couple of amps (or enough to move the rotor) in each direction and the encoder offset is the midpoint. (it's in counts) Things are slightly complicated by the 8i20 built-in lead-angle calculation. (ie, you give it _rotor_ angle and it calculates _phase_ angle) eg: halrun loadrt hostmot2 loadrt hm2_eth board_ip=10.10.10.10 show pin loadrt threads addf hm2_....read thread1 addf hm2.....write thread1 start loadusr halshow {setup a watch of the encoder index-enable and counts) setp encoder.0.index-enable 1 {rotate motor by hand until the index-enable resets) setp hm2...8i20...current 0.5 {note the encoder counts} setp hm2....8i20...current -0.5 {note the encoder counts) {maybe repeat to get good statistics) There may be enables to set, it's been a long time. You might need more, or less, current. Depending on the pole count there will be several zeros, one is likely to align very closely with the index. If the encoder offset turns out to be zero, or close to zero, at this point you should be able to scale the encoder to give a zero-to-one output per _electrical_ revolution and connect the encoder angle to the 8i20 commutation angle and spin the motor with current commands. -- atp "A motorcycle is a bicycle with a pandemonium attachment and is designed for the especial use of mechanical geniuses, daredevils and lunatics." — George Fitch, Atlanta Constitution Newspaper, 1912 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users