BLDC_SINE

NAME
SYNOPSIS
FUNCTIONS
PINS
PARAMETERS
AUTHOR
LICENSE

NAME

bldc_sine − Sinusoidal Brushless DC motor drive, with optional self-zeroing

SYNOPSIS

loadrt bldc_sine [count=N|names=name1[,name2...]]

FUNCTIONS

bldc-sine.N (uses floating-point)

PINS

bldc-sine.N.rawcounts s32 in

Encoder counts input

bldc-sine.N.init bit in

A rising edge on this pin starts the motor alignment sequence. This pin should be connected in such a way that the motors re-align any time that encoder monitoring has been interrupted. Typically this will only be at machine power-off. The alignment process involves powering the motor phases in such a way as to put the motor in a known position. The encoder counts are then stored in the offset parameter. The alignement process will tend to cause a following error if it is triggered while the axis is enabled, so should be set before the matching axis.N.enable pin. The complementary init-done pin can be used to handle the required sequencing.

Both pins can be ignored if the encoder offset is known explicitly, such as is the case with an absolute encoder. In that case the offset parameter can be set directly in the HAL file

bldc-sine.N.init-done bit out (default: 0)

indicates that the motor alignment process is completed

bldc-sine.N.dir float in (default: 1)

The peak output of the three *-value pins will be the product of the value pin and the dir pin. The main purpose of the pin is to invert the the motor direction sense using a scale of -1, but there is no restriction on the valid values. Typically the component will take a bipolar +/- fullscale input from a pid function and in that case this pin will not be wired

bldc-sine.N.value float in

PWM demand

bldc-sine.N.angle float in (default: 90)

The phase lead between the electrical vector and the rotor position

bldc-sine.N.initvalue float in (default: .1)

The PWM demand to use for motor initialisation

bldc-sine.N.A-value float out (default: 0)

Output amplitude for phase A

bldc-sine.N.B-value float out (default: 0)

Output amplitude for phase B

bldc-sine.N.C-value float out (default: 0)

Output amplitude for phase C

PARAMETERS

bldc-sine.N.offset s32 rw (default: 0)

The offset in encoder counts between the encoder zero position and motor electrical zero. Can be set directly for use in absolute feedback systems or will be initialised by the init pin.

bldc-sine.N.scale float rw (default: 512)

The number of encoder counts per electrical revolution. eg counts/2 for a 4-pole motor, counts/3 for a 6 pole etc. There is a 50% chance that this parameter will need to be negative for proper function.

AUTHOR

Andy Pugh

LICENSE

GPL