Hang a current probe on the motor leads and the supply. Something is not r= ight. Denny Esterline wrote: >Ok, I've got dents in my wall and lumps on my forehead. It's time to tap >the collective wisdom of the list. > >I'm building a system to control a sensored NEMA23 size brushless motor >based on a dsPIC33F128MC804. >I've got the motor spinning and I'm working out my control loops (speed an= d >position). >Earlier, when I was doing simple bench testing, the motor >was noticeably smoother in one direction >than the other. Now that I have the gearbox and a load connected to it, >it's _much_ worse. >Clockwise, it's smooth as silk and moves my load at about 1.5 Amps. >Counter-clockwise it's noticeably >noisier and draws upwards of 7 Amps. The load is very close to the same in >both directions. > >I'm completely at a loss for why it would behave differently depending on >direction of rotation. > >I'm using brand new, Electrocraft motors, (two different motors, >from different production batches have been tried with the same results) > >The board is our design. I've run several tests on it and I'm confident >that the FET drivers and FETs are operating correctly. >I've got a small logic analyzer and I've looked at the halls (clean, well >sequenced, uniform widths - both directions) and the control lines to the >FET drivers (exactly the expected sequence). >I've scoped the gates of the FETs and I don't see anything odd. > >The Hall sensors and commutation is managed with the CN interrupt. >Assembled into a three bit value and used as lookup in a sector table. >The sector value is then incremented or decremented (CW vs CCW) and used t= o >lookup the OVDCON value. This is all very much strait out of the appnotes. > >I'm fresh out of ideas. Any good suggestions? > >-Denny > > > > >Here's some snips of the relevant code sections: > >//globals >char SectorTable[] =3D {0,6,2,1,4,5,3,0}; >unsigned int StateLoTable[] =3D { 0x0000, /* All off, guards from bad hal= l >data*/ > 0x0204, /* PWM2L -> 1, PWM1H -> PWM */ > 0x0210, /* PWM3L -> 1, PWM1H -> PWM */ > 0x0810, /* PWM3L -> 1, PWM2H -> PWM */ > 0x0801, /* PWM1L -> 1, PWM2H -> PWM */ > 0x2001, /* PWM1L -> 1, PWM3H -> PWM */ > 0x2004, /* PWM2L -> 1, PWM3H -> PWM */ > 0x0000}; /* All off, guards from bad hall >data*/ > > > > > >//and in the CN interrupt > >tempC =3D PORTC; //grab the pins as quick= as >possible >tempB =3D PORTB; //according to stopwatch= , >assembly takes 15 cycles >HallValue =3D (0x0007 & (((tempC & 0x0040) >> 4) | ((tempB & 0x0200) >> 8)= | >((tempB & 0x0100) >> 8))); > >CurrentHallSector =3D SectorTable[HallValue]; //linearize hall reading= to >sector number > >if (MotorDirection =3D=3D CW) //Calculate the next s= ector >based on current sector and direction > { > NextHallSector =3D CurrentHallSector + 1; > if (NextHallSector =3D=3D 7) //the numbers wrap aro= und... > NextHallSector =3D 1; > } >else > { > NextHallSector =3D CurrentHallSector - 1; > if (NextHallSector =3D=3D 0) > NextHallSector =3D 6; > } > >P1OVDCON =3D StateLoTable[NextHallSector]; //Load a value into OVDC= On >based on next position >--=20 >http://www.piclist.com PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .