AN 994: Drive-on-Chip Design Example for Intel Agilex® 7 Devices

ID 780361
Date 6/26/2023
Public
Document Table of Contents

4.4. Software Application Configuration Files

You can modify the operation of the software application for the Drive-on-Chip Design Example by editing some C source code and header files.
Table 1.  Software application configuration files
File Path Function
demo_cfg.c . Declare motors[] array
demo_cfg.h . Configuration macros and include file for demo_cfg.c
motor_types.c Platform/motors Declares motor types and encoders
motor_types.h Platform/motors Defines motor and encoder types and include file for motor_types.c
app_cfg.h . Header file for OS cfg switches

Table 2.  Configuration MacrosThis table lists the configuration macros that you can use to configure the design in demo_cfg.h.
Macro Default State Range Function
FIRST_MULTI_AXIS 0 0 - 1 Index of first motor axis to be controlled.
LAST_MULTI_AXIS 1 0 - 1 Index of last motor axis to be controlled.
DEFAULT_ADC_TYPE ADC_TYPE_SIGMA_DELTA ADC_TYPE_SIGMA_DELTA Use sigma delta ADCsamples in control loop.
SD_ADC_FILTER ADC_D_10US ADC_D_10US Sinc3filter delay 10us.
ADC_D_5US[VVE1] [WS2] Sinc3filter delay 20us.
constScaleVoltage 1<<6 n Voltage is stored as short (16 bits signed value:sfix16), (1<<n), n means how many decimal bit in sfix16
OPEN_LOOP_INIT 0 0 Start motors in closed loop mode.
1 Start motors in open loop mode.
INTERACTIVE_START 0 0 Normal startup 1:
1 User prompted via Nios V/g console at each stage of startup
PWM_DEAD_TIME_NSEC 2000[VVE3] [WS4] This is the dead period between switching of the upper and lower power transistors.
SENSORLESS_STARTUP_COUNT 6400UL Count in sample periods to run in open loop before switching to sensor less.
MOTION_TMR_PERIOD 1 Period (in OS ticks) for speed or demo timer
DBG_DEFAULT DBG_INFO DBG_NEVER No console output.
DBG_ALWAYS Always output.
DBG_FATAL Debug level set to fatal errors.
DBG_ERROR Debug level set to non-fatal errors and above.
DBG_WARN Debug level set to warnings and above.
DBG_INFO Debug level set to information and above.
DBG_PERF Debug level set to performance data and above.
DBG_DEBUG Debug level set to debug messages and above.
DBG_DEBUG_MORE Debug level set to more debug messages and above.
DBG_ALL Debug level set to all messages.