Quantcast
Viewing all articles
Browse latest Browse all 21837

MCF8329A: Cannot get motor spinning on custom hardware

Part Number: MCF8329A

Tool/software:

Hi,

I am trying to get going with a motordriver based around mcf8329a. However there seems to be a few issues in my setup. 

I have bought and tested everything with ti:s evaluation board for this device, and it is really working well with my motor. I have tuned and exported all the settings in a json.

Now however I am trying the same code on our own hardware and I am getting no expected results. The motor does not start spinning. Once scoped the phases ABC I can see that the driver is doing something, beginning with switching the phases with a 50kHz square on all phases, but after that nothing, no movement, no faults reported or anything. So I am a bit stuck. Do you have any idea of what could be the issue?

I have communication and I can talk to the mcf8329a, but I cannot get the motor turning over. I am using Arduino as a test platform.

Theese are my register settings;

    Register registers[] = {
        {0x00000080, 0xE2EBD667},
        {0x00000082, 0xC0E89EE6},
        {0x00000084, 0x50A24EC2},
        {0x00000086, 0x93372007},
        {0x00000088, 0x16788328},
        {0x0000008A, 0x9AAD5721},
        {0x0000008C, 0x1BF4182A},
        {0x0000008E, 0x60980960},
        {0x00000094, 0x00000000},
        {0x00000096, 0x00000000},
        {0x00000098, 0x80000004},
        {0x0000009A, 0x00000000},
        {0x0000009C, 0x00000000},
        {0x0000009E, 0x00000000},
        {0x00000090, 0x26483186},
        {0x00000092, 0x71402888},
        {0x000000A0, 0x0946027D},
        {0x000000A2, 0x02008165},
        {0x000000A4, 0x40032310},
        {0x000000A6, 0x40100000},
        {0x000000A8, 0x03E8C00C},
        {0x000000AA, 0x06A045C0},
        {0x000000AC, 0x80008079},
        {0x000000AE, 0x80000102},
        {0x000000E0, 0x00000000},
        {0x000000E2, 0x00000000},
        {0x000000E4, 0x24318C94},
        {0x000000E6, 0x00000000},
        {0x000000E8, 0x3A000000},
        {0x000000EA, 0x00000000},
        {0x000000EC, 0x80000000},
        {0x000000EE, 0x00000018},
        {0x000000F0, 0x030503A0},
        {0x000000F2, 0x02600160},
        {0x000000F4, 0x00000000},
        {0x00000196, 0x00000000},
        {0x0000019C, 0x045C1DE8},
        {0x0000040E, 0x00197857},
        {0x0000043C, 0x00440000},
        {0x0000043E, 0x00680000},
        {0x00000440, 0x00CC0000},
        {0x00000450, 0x00000002},
        {0x00000458, 0x00020002},
        {0x0000045C, 0x01FDA000},
        {0x00000460, 0x00033F62},
        {0x00000462, 0x000376CF},
        {0x00000464, 0x000261AE},
        {0x000004AA, 0xFA88A300},
        {0x000004AC, 0xF86B7264},
        {0x000004CC, 0x00A80000},
        {0x000004CE, 0x00A89616},
        {0x000004D0, 0xFFADDE8B},
        {0x000004D2, 0x008D6DC2},
        {0x000004DC, 0xFFA8A1F4},
        {0x000004DE, 0x0075FB02},
        {0x000004E0, 0x000BB21E},
        {0x000004E2, 0x008FFF8F},
        {0x0000051A, 0x00000000},
        {0x00000532, 0x00E9C550},
        {0x00000542, 0x04CCBAB0},
        {0x000005D0, 0x00000000},
        {0x0000060A, 0x00000000},
        {0x0000060C, 0x005F3E12},
        {0x000006B0, 0x00000005},
        {0x000006BA, 0x00000172},
        {0x000006E4, 0x0004000B},
        {0x0000071A, 0x00A737C2},
        {0x0000075C, 0xFFFFFEA1},
        {0x0000075E, 0x008E5BE6},
        {0x0000076E, 0x00000000},
        {0x00000774, 0x58830AD3}
    };

This is my layout;

Image may be NSFW.
Clik here to view.

I am interested in how startup and speed command is set over i2c with the evaluation kit. Which pins are asserted high/low to startup? 

I have tried to clear all faults, but no difference.

This is my code for setting speed;

// Function to set the motor speed using ALGO_DEBUG1 register
void setMotorSpeed(uint8_t address, uint16_t speed) {
    // Read the current value of ALGO_DEBUG1 register (address 0xEC)
    uint32_t currentValue = MCF8329AReadRegister(address, 0xEC);

    // Modify the SPEED_OVER_RIDE and DIGITAL_SPEED_CTRL fields
    currentValue |= 0x80000000; // Set SPEED_OVER_RIDE to 1 (bit 31)
    currentValue &= ~(0x1FFFF << 16); // Clear DIGITAL_SPEED_CTRL bits (30-16)
    currentValue |= ((speed & 0x1FFFF) << 16); // Set DIGITAL_SPEED_CTRL bits (30-16)

    // Split the modified value into bytes
    uint8_t byte4 = (currentValue >> 24) & 0xFF;
    uint8_t byte3 = (currentValue >> 16) & 0xFF;
    uint8_t byte2 = (currentValue >> 8) & 0xFF;
    uint8_t byte1 = currentValue & 0xFF;

    // Write the updated value back to ALGO_DEBUG1 register
    MCF8329AWriteRegister(address, 0xEC, byte4, byte3, byte2, byte1);
}

I am not sure if this is the correct way to set the motor rpm. Seems odd that it is a debug register.

Any help appreciated!


Viewing all articles
Browse latest Browse all 21837

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>