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.

F28335 controlCARD RELEASE 2.2: CAN communication and Control of BLDC motor doubt



Hello

I want to developt a project using "F28335 controlCARD RELEASE 2.2" where I control a BLDC motor (using ePWM, eCAP, ADC, GPIO) and communicate some control signals to a CANbus line via CANbus communication.

I want that CANbus communication works in 500kbps and algorithm period (carrier of ePWM and ADC) works in 100kHz.

My question is: Can I do both operations in parallel according the last comment?.

Best regards.

  • Miguel,

    How much data needs to be exchanged on the CAN bus per iteration of the control loop? On the CAN side, each frame is approximately 120 bits long (assuming STD_ID, 8 bytes/frame, no contention on the bus, not too many stuff bits), which would take about 240 uS, at the minimum.

  • Miguel,

    With a 100KHz PWM, if you want to update the duty cycle per carrier cycle, then the ISR timing is about 10uS, which is about the time it takes to cycle through an ADC conversion and FOC algorithm execution all the way to updating the duty cycle. If you choose to update every 2nd carrier cycle, then you can accommodate other tasks as well giving enough time margin. For  CAN, it looks like the update rate would be about 4KHz.

    rgds,

    ramesh

  • Hareesh and Ramesh

    Thanks for your answers.

    As I understand, I can't send a CAN message and operate at a control loop frequency at 100kHz. I want to send 8 bytes of data in each CAN communication. If I suppose that I only want to send 1 message per control loop and 120 bits long, the baud rate that I can send a message have to be at minimum:

    Baud Rate = BR = Txbits * 2 * freq_controlLoop -> BR = 24Mbps

    Trying to know the maximum control loop frequency, operating at maximum CAN baud rate (1Mbps), I can diminish the control loop frequency at:

    freq_controlLoop = BR / (120*2) = 1Mbps / (120*2) = 4166 or approx. 4kHz, as Ramesh said.

    According with that, if I can't send a CAN message and do the control loop at 100KHz in parallel, is not possible use both peripherals with this microcontroller.

    My question is: Can I do both operations in parallel according the last comment?.

    According with the "functional overview" of page 33 of document SPRS439M (datasheet f28335), I don't have different buses (Memory Bus of ePWM and CAN A/B are the same) for both peripherals. For this reason I can't do both things (I guess, I am not sure). I don't want to use this microcontroller in my project if I can't control the motor and send a message. Maybe other microcontroller could be a better option.

    Best regards.

  • Miguel,

    Just to clarify you do not want to use CAN for actively controlling the power stage, you only want to send some diagnostic control signals on the CAN bus for diagnostics???

    if this is the case then yes it is possible to operate the control loop at 100kHz , you can configure another interrupt at 4kHz which can handle CAN protocol.

    I believe we understood your question as you want to send the control signal over CAN and then wait for a command for the PWM, in which case the delay of the CAN layer will be too big to support a control loop.

    if the control loop is running on the F28335 and you are only sending diagnostic information over CAN at the specified rate, such operation is entirely possible.

    Let us know if there is more clarification needed.