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.
Hi
I am using TMS320F28379D controller for motor drive PWM geneartion. However sometimes middle of the motor run, I got constant GPIO output of 3.3 V when i operate 90% duty ratio and 0 V when it below 20 % duty ratio. I am curiosity to know at what condition this will happen and under TMS freeze condition, What value will TMS320 send ?
Thanks in advance for your help.
Hello Malakondareddy,
Can you explain in more details of the conditions you are experiencing this issue.
What are your epwm configuration settings ? It is most likely missing the action qualifying event for set/clear of the PIN.
Thanks,
Prarthan.
Thanks for reply
epwm configuration settings:
EALLOW;
// Disable pull-up on and gonfigure as EPWM
ATI_HUBMOTOR_PULL_UP = 1;
ATI_HUBMOTOR_MUX = 1;
EDIS;
hubmotor->TBCTL.bit.CTRMODE = TB_COUNT_UP; // Count up
hubmotor->TBPRD = REARMOTOR_TIMER_TBPRD; // Set timer period
hubmotor->TBCTL.bit.PHSEN = TB_DISABLE; // Disable phase loading
hubmotor->TBPHS.bit.TBPHS = 0x0000; // Phase is 0
hubmotor->TBCTR = 0x0000; // Clear counter
hubmotor->TBCTL.bit.HSPCLKDIV = TB_DIV2; // Clock ratio to SYSCLKOUT
hubmotor->TBCTL.bit.CLKDIV = TB_DIV1;
//
// Setup shadow register load on ZERO
//
hubmotor->CMPCTL.bit.SHDWAMODE = CC_SHADOW;
hubmotor->CMPCTL.bit.SHDWBMODE = CC_SHADOW;
hubmotor->CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
hubmotor->CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;
//
// Set Compare values
//
hubmotor->CMPA.bit.CMPA = 0; // Set default A value
hubmotor->CMPB.bit.CMPB = 0; // Set default A value
//
// Set actions
//
hubmotor->AQCTLA.bit.ZRO = AQ_SET; // Set PWM1A on Zero
hubmotor->AQCTLA.bit.CAU = AQ_CLEAR; // Clear PWM1A on event A,
// up count
hubmotor->AQCTLB.bit.ZRO = AQ_SET; // Set PWM1B on Zero
hubmotor->AQCTLB.bit.CBU = AQ_CLEAR; // Clear PWM1B on event B,
// up count
}
From the figure it was observed that from 12 sec to 17 sec we missed the communication from delfino (TMS320F2837) (UART to USB ) and observed vehicle stop. However it restarted communication and went until 30 sec, after 30 sec again we observed delfino communication and observed vehicles moving more fast (This will happen only when motor driver receives constant 3.3 V) .
In the first incident our PWM value was very low and might be due to that the GPIO pin settled at zero and second incident GPIO might be settled at high since our pwm value was max at that condition.
We want to know at what condition this will happen and at what condition the TMS320 will automatically reset.
In any case TMS320 will hang (frozen) ?
We have been working on the same hardware and firmware from more than 5 years and observed only one time this incident.
Thanks for the details.
Above mentioned are the initialization code for the epwm module and I think you might be modifying the CMPA and CMPB values later in the code and shadow loading at counter zero.
The communication loss at the time window mentioned above how does that fit in your system. Are there any dependencies for the C2000 Mcu OR epwm module that I should be aware of ? Have you configured your MCU to react in a certain way in case comms are lost ?
How do you know MCU froze, do you have Wathdog timer configured and MCD(Missing clock detection) set for precautions so we know what is the cause of the issue here ?
I would suggest you to use the Trip zone submodule of the epwm module to put the system in fail safe stateUpon a fault condition, outputs EPWMxA and EPWMxB can be forced to one of the following- Low, High or High Impedance. Seems like the comms stopped and GPIO signals were stuck at last state when comms were lost but I would like to understand how you detected the state and cause of this loss if you can share with me to better understand the issue.
Thanks for quick response and sorry for the delay reply
Are there any dependencies for the C2000 Mcu OR epwm module that I should be aware of ? Have you configured your MCU to react in a certain way in case comms are lost ?
Reply: Yes, We will bring low all GPIO’s if code is alive and comms fails.
How do you know MCU froze, do you have Wathdog timer configured and MCD(Missing clock detection) set for precautions so we know what is the cause of the issue here ?
Reply : We don't have any data to prove the MCU froze. We are only suspecting because during this period comms failed and GPIO’s did not come Low (here we have seen vehicle high speed) and also the MCU draws a required amount of current.
Further the boot up sequence started when comms started talking (Comms back).
I would suggest you to use the Trip zone submodule of the epwm module to put the system in fail safe stateUpon a fault condition, outputs EPWMxA and EPWMxB can be forced to one of the following- Low, High or High Impedance.
Reply : How to detect fault condition and how to implement Trip zone submodule. Is this possible under MCU Froze ?
Seems like the comms stopped and GPIO signals were stuck at the last state when comms were lost but I would like to understand how you detected the state and cause of this loss if you can share with me to better understand the issue.
Reply: we have seen vehicle run with more speed when comms fail. However as per code all GPIO should be low when comms fail but that didn't happen I think. Also the MCU draws a required amount current.
If possible could we have a call or virtual meeting for better understanding. I am also interested to visit your office if it is in bangalore. Thanks
We don't have any data to prove the MCU froze. We are only suspecting because during this period comms failed and GPIO’s did not come Low (here we have seen vehicle high speed) and also the MCU draws a required amount of current.
Vehicle speed maybe be dependent on the type of motor and vehicle speed at which this phenomenon happens. Out of curiosity what type of motor is this PMSM (IPMSM OR SM-PMSM) ? I would recommend to capture pwm pulses at this instant of time.
Can you also monitor XRSn pin ? That should tell if the device goes in Reset and comes out of it in boot up sequence
Lets find out what state the MCU is in when comms are lost then we can determine the solution to it. What was the reason for comms down ? Any noise interference issues ?
How to detect fault condition and how to implement Trip zone submodule. Is this possible under MCU Froze ?
Please refer to Trip Zone section in Technical Reference Manual it will show you how to route internal and external signals to take actions on GPIO pins.
If the device goes into reset before Trip Zone can act then it wont be useful but better to set it up for protection.
If possible could we have a call or virtual meeting for better understanding. I am also interested to visit your office if it is in bangalore. Thanks
Let me know if you have any FAE contact else I can connect you to FAE and he can help setup virtual meeting.
Vehicle speed maybe be dependent on the type of motor and vehicle speed at which this phenomenon happens. Out of curiosity what type of motor is this PMSM (IPMSM OR SM-PMSM) ? I would recommend to capture pwm pulses at this instant of time.
Reply: we are using 1.5kW BLDC motor with corresponding controller. Currently we do not have any provision to capture PWM and also we could not recreate same issue again.
Can you also monitor XRSn pin ? That should tell if the device goes in Reset and comes out of it in boot up sequence
Lets find out what state the MCU is in when comms are lost then we can determine the solution to it. What was the reason for comms down ? Any noise interference issues ?
Reply : How to monitor XRSn pin and where store this data if the comms fails. We really dont why comms failed and we have been running many vehicles in same area from fast 2 years.
Let me know if you have any FAE contact else I can connect you to FAE and he can help setup virtual meeting.
Reply : No idea on this, if we guide me I will do required formalities or Please setup virtual meeting whenever you are available for that . Our office at Bangalore, India.
How to monitor XRSn pin and where store this data if the comms fails
This can be routed to external pin monitor refer datasheet diagrams based on what package you have. Example shown below
If you see any other instance of this please continue monitoring this pin and implement the safety mechanism like I mentioned above. I suspect there should be some noise interfernec or power supply issue of some kind the device might go into BOR or reset and boot up again but this is again my guess.
We would need to try and repeat this and find the exact state of device when it does this.
I will talk to local FAE and connect with you we can have virtual session for any further questions you may have.
Thanks!
We could not reproduce the issue and also our have some more doubts on this. Please arrange virtual session for the same if possible for you. Thanks!
Sure I will have an FAE assist in setting up a call. Meanwhile feel free to create E2E post here for any issues