AN 773: Drive-On-Chip Design Example for Intel® MAX® 10 Devices

ID 683072
Date 7/26/2023
Public
Document Table of Contents

4.5.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).
  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 with resolvers:
    motor_t * motors[] = {&tamagawa_resolver[1], &tamagawa_resolver[1], NULL, NULL};
    The resolver interface on the Tandem Motion-Power 48 V board 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.