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.

TMS320F280039C: Implement safey reactions

Part Number: TMS320F280039C


Hello,

I am implementing safety reactions in a motor control firmware. I would like to monitor electrical variables by means of ADCs and trigger the safety reaction depending its value. Would it be posible to receive some guidelines on how the microcontroller hardware is intended to be used in this case and how could i structure the code?

Thanks in advance,

David

  • Hi David,

    Our Subject Matter Expert is out of office for this week. Please expect a response by later half of the next week. Thank you for your patience.

    Regards
    Srikanth

  • Hi David,

    Have you looked at some of our MotorControl SDK projects? Most of them implement overcurrent protection schemes using the CMPSS and its ability to send a trip signal to the EPWMs. Is that the type of functionality you are looking for?

    Whitney

  • Hello Whitney,

    Yes, I am looking for hardware reactions and software programmed reactions. I have seen the examples and studied the technical reference manual. If i am not wrong, there are hardware reactions based on the Digital compare, CMPSS and trip zone module. The CMPSS module requires the signal to be already filtered. The same applies to the post processing blocks of the adc where you can route a trip signal by means of the ePWM xBAR. The question comes from the need of knowing which are the solutions and why should be chosen one over another.

    Also, I would like to know which firmware reactions are the better ones and in which situations should be used.

    Finally, I would like to know which is the best way(fastest) to implement these software reactions i.e. implementing interrupts, adding functions to ram, the use of static inline. In other words, how do I have to program the code to be as fast as posible. I found an application note about optimizing code that I have already read and another one about improving peripheral management with bit field registers. However, i still do not know how should i acces the peripherals and can i do to improve the performance and reduces further processing time. I am still learning about microcontroller programming and I do not have much experience. I would love to better understand how can I obtain the maximum profit of the hardware.

  • The CMPSS has the advantage of being continuously comparing where using the PPB or just monitoring an ADC result in software is going to be comparing periodically (like at the ADC sampling frequency). So CMPSS gets you a faster response to the trip event. I'm not sure what you mean about the CMPSS requiring the signal to be filtered, but I'll point out that there is a configurable filter block in the CMPSS to protect against spurious trips.

    It sounds like you read this C2000 Optimization Guide? That's definitely the best source for that kind of guidance. As far as how to program the peripherals, I'd recommend using driverlib. Most of our example software uses driverlib and it optimizes pretty well when you turn on optimization in the compiler settings since so much of it is inlined.

    Whitney

  • Hello Whitney,

    Yes, I was refering to that guide. I am glad I chose correctly the guide. So is there any other guide or application notes that can be useful for that matter?

    David

  • I can't think of any others that focus on optimization specifically, but in general, the C2000 Software Guide has links to most of our other software-specific guides on various topics.

    Whitney

  • Thanks a lot for the inputs. I will study them.