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.1. Defining a New Motor or Encoder Type

  1. To use a different motor type or position feedback encoder with the Drive-on-Chip Designs, declare a new motor type array of type motor_t in motor_types.c.
    The structure of motor_t is defined in motor_types.h. The array length must match the number of axes available (e.g. two for the Tandem Motion-Power 48 V Board motor model).
  2. Provide C source code for the three functions encoder_init_fn, encoder_service_fn and encoder_read_position_fn if none of the existing functions are suitable.
  3. Use the functions provided with the design as templates to write your own functions.
  4. Initially, use the gain constants from an existing motor type and then determine new values when you first run the motor by following a standard PI controller tuning process.
    Refer to the declaration of tamagawa_resolver software source file as an example.
  5. Edit the declaration of the motors[] array in demo_cfg.c to use your motor.
    The default motors[] definition for the Tandem Motion-Power 48 V Board is two Tamagawa motors (DSP Builder motor model) with resolvers:
    //Example for Tandem Motion Power with 2x Tamagawa motors
    motor_t * motors[] = (&tamagawa_resolver(0), &tamagawa_resolver(1), NULL, NULL);
    The resolver interface on the Tandem Motion-Power 48 V board (DSP Builder motor model) converts the resolver output into quadrature equivalent or Hall equivalent encoder signals. The design supports a maximum of two axes so the third and fourth elements of the motors[] array are set to NULL for clarity.