This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Dual motor implementation question: using single or dual interrupt?

Other Parts Discussed in Thread: TMS320F28069F

Hi,

Currently we implemented a second motor on a single controller using InstaSPIN on a TMS320F28069F. Both motors are controlled and turning independently, but currently we have some issues with motor 2 regarding the learning process. We are not sure if this is caused the way we implemented the second motor. We would like feedback on what is the best way to implement the second motor.

This is how the current implemented looks like, using a single control loop interrupt:

- Motor 1 PWM 1 triggers SOC-A and fills all ADC-SOC's with values including Motor 1 and 2.

- A single interrupt is triggered (on ADC int 1) which handles the control loop for both motors.

We could also implement the second motor with use of an separate interrupt per motor:

- Motor 1 PWM triggers SOC-A and fills all SOC's needed for Motor 1.

- Motor 2 PWM triggers SOC-B and fills all SOC's needed for Motor 2.

- Each motor get their own interrupt handling their control loop.

What is your opinion on both implementations? And what is the correct way to implement two motors using 1 controller?

  • One thing to consider is the CPU bandwidth. Please check the user's guide for the number of cycles it takes to control one motor, and make sure your interrupt period is enough to have double the number of cycles, so it has time to control both motors.

    As far as the trigger source, one thing to consider also is the minimum duty cycle on the low side PWM to allow the corrent sampling of both motors. The current is the one tied to the low side pulse, so I would recommend setting the conversion order as follows:

    1. Current A of motor 1
    2. Current B of motor 1
    3. Current C of motor 1
    4. Current A of motor 2
    5. Current B of motor 2
    6. Current C of motor 2
    7. Voltage A of motor 1
    8. Voltage B of motor 1
    9. Voltage C of motor 1
    10. Voltage A of motor 2
    11. Voltage B of motor 2
    12. Voltage C of motor 2
    13. Vbus of motor 1 and motor 2 (assumming both motors run from the same dc bus

    Could you describe the problem you are seeing in motor 2? Does motor 1 run ok?

    -Jorge

  • Hello Jorge,

    Thanks for your reply.

    We run at 9kHz ISR speed and monitor the interrupt time with use of an oscilloscope. The interrupt period is enough to fit the double number of cycles.

    As for the trigger source: we indeed mapped the current first, as your example shows.

    The main question was: what is the best way to implement the second motor: using a single motor interrupt or separate interrupts per motor.

    Yesterday I changed our implementation from single interrupt (and SOC trigger) to separate motor interrupt (and separate SOC trigger). This seems to work better. Motor 2 is now also able to successfully finish a learning procedure.

  • Yes, absolutely use a 2nd interrupt. They should be completely independent.