On 7/4/24 05:10, andy pugh wrote:
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.

Thank you for a very educational post, Andy.

I personally have not used any BLDC motors as I've found the stepper/servo to be an amazingly better control for me. They do exactly what the stepper driver tells them to do as the motor is locked to the stepper drivers output by the PID in the controller, which LCNC is not aware of. A machine with stepper/servo's needs no PID's.

But I've pinned the above post and others should too as it seems to be the best BLDC setup instructions we have seen here.

Take care & stay well Andy.

Cheers, Gene Heskett, CET.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis



_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to