AIC I/O Interface


Defines

#define REF_FREQ   10e6
 Reference frequency = 10MHz.

#define SW_FREQ   20e3
 Default Switching Frequency = 20KHz.

#define TURNOFF_DELAY   600e-9
 H-bridge turn-off delay.

#define MIN_COUNT   (unsigned int)(2*TURNOFF_DELAY*REF_FREQ)
 PWM minimal count value.

#define MAX_COUNT   (unsigned int)(REF_FREQ/SW_FREQ)
 PWM maximal count value.


Functions

void brake_initialize (unsigned long base)
 Initializes brake.

void brake_apply (void)
 Applies the electromagnetic brake
Since:
AIC-1.4.2.


void brake_release (void)
 Releases the electromagnetic brake
Since:
AIC-1.4.2.


void index_initialize (unsigned long base)
 Initializes Index.

unsigned long index_read (void)
 Reads the sync-switch.

void pwm_set_count (unsigned int count)
 Sets the frequency of PWM in cycles of 10MHz.

void pwm_set_freq (float frequency)
 Sets the frequency of PWM.

float pwm_get_freq (void)
 Returns the frequency of PWM.

void pwm_initialize (unsigned long base, unsigned int min_count, unsigned int count)
 PWM initialization.

void pwm_finalize (void)
 Finalizes the PWM
Since:
AIC-1.4.2.


unsigned long pwm_set_duty_float (float dutycycle)
 Sets the duty-cycle of PWM.

unsigned long pwm_set_duty (unsigned long dutycycle)
 Sets the duty-cycle of PWM.

void pwm_on (void)
 Turns the PWM on
Since:
AIC-1.4.2.


void pwm_off (void)
 Turns the PWM off
Since:
AIC-1.4.2.


void motor_initialize (unsigned long base, float voltage, float freq)
 Initializes the motor driver.

void motor_finalize (void)
 Finalizes the motor driver
Since:
AIC-1.5.0.


void motor_on (void)
 Turns the motor driver on
Since:
AIC-1.5.0.


void motor_off (void)
 Turns the motor driver off
Since:
AIC-1.5.0.


float motor_set (float voltage)
 Sets the voltage to be applied by the motor driver.

 encoder_clear (void)
 Clears the counter on the quadrature decoder chip
Since:
AIC-1.5.0.


void encoder_initialize (unsigned long base, long pulses)
 Initializes Encoder, clears the counter on the quadrature decoder chip.

void encoder_finalize (void)
 Finalizes Encoder
Since:
AIC-1.5.0.


long encoder_get_count (void)
 Gets the count on the quadrature decoder chip.

long encoder_get_count_and_clear (void)
 Gets the count and clears the counter on the quadrature decoder chip.

float encoder_read (void)
 Reads the counter on the quadrature decoder chip and converts the motion to radians.

float encoder_read_and_clear (void)
 Reads the counter on the quadrature decoder chip, converts the motion to radians and clears the counter.

void aic_on (void)
 Turns an AIC on
Since:
AIC-1.5.0.


void aic_off (void)
 Turns an AIC off
Since:
AIC-1.5.0.


void aic_initialize (unsigned long base, float vm, float freq, long np)
 Initializes an AIC.

void aic_finalize (void)
 Finalizes an AIC
Since:
AIC-1.5.0.



Function Documentation

void aic_initialize unsigned long  base,
float  vm,
float  freq,
long  np
 

Initializes an AIC.

Parameters:
base Base address for on board devices
vm Motor Voltage
freq PWM frequency
np Pulses per encoder revolution
Since:
AIC-1.5.0

void brake_initialize unsigned long  base  ) 
 

Initializes brake.

Parameters:
base Base address for on board devices
Since:
AIC-1.4.2

long encoder_get_count void   ) 
 

Gets the count on the quadrature decoder chip.

Returns:
the number of pulses (in 2-complement) since the last time the counter was cleared
Since:
AIC-1.5.0

long encoder_get_count_and_clear void   ) 
 

Gets the count and clears the counter on the quadrature decoder chip.

Returns:
the number of pulses (in 2-complement) since the last time the counter was cleared
Since:
AIC-1.5.0

void encoder_initialize unsigned long  base,
long  pulses
 

Initializes Encoder, clears the counter on the quadrature decoder chip.

Parameters:
base Base address for on board devices
pulses Number of pulses per revolution of the encoder, considering the quadrature decoder
Since:
AIC-1.5.0

float encoder_read void   ) 
 

Reads the counter on the quadrature decoder chip and converts the motion to radians.

Returns:
the displacement in radians since the last time the encoder was cleared
Since:
AIC-1.5.0

float encoder_read_and_clear void   ) 
 

Reads the counter on the quadrature decoder chip, converts the motion to radians and clears the counter.

Returns:
the displacement in radians since the last time the encoder was cleared
Since:
AIC-1.5.0

void index_initialize unsigned long  base  ) 
 

Initializes Index.

Parameters:
base Base address for on board devices
Since:
AIC-1.4.2

unsigned long index_read void   ) 
 

Reads the sync-switch.

Returns:
the sync-switch state
Since:
AIC-1.4.2

void motor_initialize unsigned long  base,
float  voltage,
float  freq
 

Initializes the motor driver.

Parameters:
base Base address for on board devices
voltage Motor Voltage
freq PWM frequency
Since:
AIC-1.5.0

float motor_set float  voltage  ) 
 

Sets the voltage to be applied by the motor driver.

Parameters:
voltage to be applied by the motor driver
Returns:
the duty-cycle of the associated PWM
Since:
AIC-1.5.0

float pwm_get_freq void   ) 
 

Returns the frequency of PWM.

Returns:
PWM frequency in Hz
Since:
AIC-1.4.2

void pwm_initialize unsigned long  base,
unsigned int  min_count,
unsigned int  count
 

PWM initialization.

Parameters:
base Base address for on board devices
min_count MIN_COUNT
count frequency of PWM in cycles of 10MHz. Number of cycles from 10 to 65530.
Since:
AIC-1.4.2

void pwm_set_count unsigned int  count  ) 
 

Sets the frequency of PWM in cycles of 10MHz.

Parameters:
count number of cycles from 10 to 65530. Default value is 500
Since:
AIC-1.4.2

unsigned long pwm_set_duty unsigned long  dutycycle  ) 
 

Sets the duty-cycle of PWM.

Parameters:
dutycycle to be used by PWM as a int from 0 to 1000000
Returns:
the count value programmed to the PWM timer
Since:
AIC-1.4.2

unsigned long pwm_set_duty_float float  dutycycle  ) 
 

Sets the duty-cycle of PWM.

Parameters:
dutycycle to be used by PWM as a float from 0 to 1.0
Returns:
the count value programmed to the PWM timer
Since:
AIC-1.4.2

void pwm_set_freq float  frequency  ) 
 

Sets the frequency of PWM.

Parameters:
frequency frequency in Hz from 152.60Hz to 1MHz. Default value is 20KHz
Since:
AIC-1.4.2


Generated on Thu Mar 27 15:33:37 2008 for Actuator Interface Card by doxygen 1.3.6