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.

How to modify TMS570LS31 InstaSPIN BLDC code to talk to two MCUs

Other Parts Discussed in Thread: LAUNCHXL-F28027F, MOTORWARE

I want modify the code to be able to connect to a DRV8301-LS31-KIT (TMS570LS31 MCU) and to a LAUNCHXL-F28027F at the same time.  So controlling two motors from one GUI.

Another option is to control multiple LAUNCHXL-F28027F from one GUI. (This may be a better idea.)

Are there reference design code and can you poin tme on what sections have to be changed.

Thanks

Alan

  • Hi Alan,

    Sorry I don't think we have anything like this done already.   But I'm having a difficult time picturing what you want to do.
    Do you want to develop your own custom GUI based on one of the GUI's that comes with one of the motor kits and you just want to connect to two different boards simultaneously?

  • Hello Anthony,

    I want to modify the GUI to control two motor assemblies with the same start/stop/speed instructions.  The motors will be ganged together. 

    I believe that for the system to work, each motor assembly must have sensor or sensorless feedback to the MCU.  If one motor did not have such feedback, it would not spin consistently.  Is this correct?

    How do I reconfigure the DRV8301-LS31-KIT to run with sensor feedback?   Do I run TMS570LS31 SMO with Encoder instead of TMS570LS31 InstaSPIN?

    Thank you

    Alan

  • Hi Alan,

    Sorry this one of the kits I haven't had a chance to work with. 

    I am not sure what you mean by ganged together w. regards to the motors.  Are they just sharing the same power rails or are the windings connected in parallel or are the shafts coupled?

    Your statement is probably right w. respect to the need for feedback - you can drive a BLDC motor without any feedback but it won't spin well and anyway you wouldn't need a TMS570 for that purpose.

    From skimming the quick start guides included in the motorware installer (buried in the solutions directory tree) InstaSPIN is sensorless but that doesn't mean no feedback loop - just means the feedback comes from measuring phase currents through a shunt resistor - so there isn't a physical sensor to purchase (which is a big cost savings).   But it is still closed-loop and will perform as such.

    The other solution in the motorware installer is 'foc_encoder_speed' and this uses the encoder that is on the Technic motor according to the quick start guide.  Actually the quick start guide in the 'drv8301-ls31-kit_README_FIRST' document explains in step 5 where to connect the encoder to the board, and in step 6 it mentions that the board supports hall sensor feedback as well although there isn't a project example that uses it.

  • The motor shafts are connected.

    What do you mean "you wouldn't need a TMS570 for that purpose"?

    So there is no project example that uses the hall sensor feedback?  Does that mean I have to modify code to make this work?

  • Alan,

    Alan Lindner said:
    The motor shafts are connected.

    Ok. Are you using one motor as a load for the other on a test bench - or are you driving the same load w. both motors and need them to be coordinated with each other?

    Alan Lindner said:
    What do you mean "you wouldn't need a TMS570 for that purpose"?

    Without feedback there's no real computation to perform - you just need a signal generator of sorts.  Anyway I am assuming that because you're looking at using an MCU or DSP you want feedback.

    Alan Lindner said:
    So there is no project example that uses the hall sensor feedback?  Does that mean I have to modify code to make this work?

     

    The motor that comes with the kit has an optical encoder *and* hall sensors for feedback.  So you can use the optical encoder if you want encoder feedback, and there is an example project for it.   This will perform the best out of all three options (optical, hall, shunt-current).    The kit only ships with software examples for optical and shunt-current feedback so if you do want to use the hall sensor then yes you'd need to modify one of the projects.

  • I am driving the same load with both motors. 

    The optical encoder would work great.  So there is a disk on the end of the motor that uses optical detection?  That would have to be calibrated first. I ran the project "SMO w Encoder" and the motor spins.  I see there is a Commutation Angle Offset that is tied to Calibrate Enable.  How does that work?

    Is there a minimum speed limit that the motor can turn at?

    Please explain the two graphs:   SMO Mot. Elec. Ang. (PU)/DC Bus Voltage (V)

    and Enc. Mot. Elec. Ang (PU)/Phase A PWM (PU)

    Thank you