587,518 active members*
3,155 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2009
    Posts
    46

    SnapAmp brushless motor example

    I ordered a Kflop and Snapamp after reading this in the snapamp web page:

    "SnapAmp works best with 1kW Brushless motors with differential encoders".

    I was thinking if this was the best use case this configuration would have at least one implementation example. Since my boards came in I've been looking through the documentation but haven't been able to find one so far, just stepper and brushed motor examples. Is there a brushless example out there that I'm missing?

    TIA

  2. #2
    Join Date
    Oct 2009
    Posts
    46

    Re: SnapAmp brushless motor example

    OK, I'll ask another question - has anyone successfully used a SnapAmp with a brushless motor??? So far the only documentation I have found so far is how to attach the 3 phase motor inputs. Zilch on how to configure it.

  3. #3
    Join Date
    Jun 2013
    Posts
    1041

    Re: SnapAmp brushless motor example

    There are several threads in the dynomotion forum where people have used brushless motors. Also look through the dynomotion yahoo group. There are many people there doing similar stuff that are not on cnczone. Right now there is someone on the Yahoo group setting up brushless linear motors.

    Ben

  4. #4
    Join Date
    May 2006
    Posts
    4049

    Re: SnapAmp brushless motor example

    Hi frontrange,

    What type of motor do you have? Does it have differential encoder outputs? Is there an index pulse? Do you have the signals interfaced to SnapAmp? What is your background? Do you understand 3phase sinusoidal commutation? Do you understand servo tuning? Have you looked at the AutoPhaseFind.c example? Did you read the Thread Ben suggested?
    https://groups.yahoo.com/neo/groups/...messages/11031

    Regards
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Oct 2009
    Posts
    46

    Re: SnapAmp brushless motor example

    What type of motor do you have?

    Kollmorgen h344, 700W with internal hall commutation

    Does it have differential encoder outputs?

    No single ended but the cable run is short and I don't expect a noise issue

    Is there an index pulse?

    Yes

    Do you have the signals interfaced to SnapAmp?

    Not yet

    What is your background?

    EE

    Do you understand 3phase sinusoidal commutation?

    Yes

    Do you understand servo tuning?

    I can follow a manual, but have no experience yet

    Have you looked at the AutoPhaseFind.c example?

    Haven't found any mention of it in the documentation, where do I find it?

    Did you read the Thread Ben suggested?

    Yes, where is autophasefind in the documentation???

  6. #6
    Join Date
    May 2006
    Posts
    4049

    Re: SnapAmp brushless motor example

    Hi frontrange,

    Thanks for the information and for answering the questions.

    To perform sinusoidal commutation you shouldn't need to make use of the Hall Sensors. What method of commutation do you intend to use? I'll assume sinusoidal commutation from the encoder and index pulse.

    KFLOP has single ended encoder inputs on JP7. Do you understand how to interface those? See:
    KFLOP Connectors

    The Index pulse can be interfaced to any available input.

    Do you understand how to wire the Motor Phases? See JP1 described here:
    SnapAmp Connectors

    There is no documentation on AutoPhaseFind.c other than what is in the example. Run KMotion.exe, open the C Programs Screen, Open AutoPhaseFind.c and take a look. I've included it below for your reference. Can you see how it works and how to modify it for your application?

    Regards


    Code:
    #include "KMotionDef.h"
    
    // Drive a 3 Phase motor that has a Z index by
    // 3 phase driving the coils (like a stepping motor)
    // two revs each direction (two z pulses)
    // monitor how many counts/cycle and counts/rev 
    // (including direction)and also determine the commutation
    // offset by recording the phase angle at the index 
    // (which will be where zero is set) and offsetting by 1/4 of a cycle 
    //
    // Set the following parameters according to your situation
    // See the report generated on the Console Screen
    
    #define PWM_CHAN 8		// which pair of PWM channels used 
    #define ENCODER_CHAN 4		// which encoder we are connected to
    #define ENCODER_GAIN 1 		// Set to -1 if desired to reverse axis direction
    #define AMPLITUDE 10   		// Set how hard to drive the coils pwm counts
    #define Z_BIT_NUMBER 68		// What bit the Z index is connected to
    #define CLAMP_VOLTAGE 85  	// volts - set a few volts higher than your supply
    #define AXIS_CHAN 4       	// Axis channel to be used and configured
    #define Ncycles 4		// don't change this
    
    void main() 
    {
        float mid,A=AMPLITUDE;   // set coil current amplitude
        int k=0,i,dk=1,WhichSnap,WhichClamp,WhichClampEnable,ignore=300,kpos[Ncycles],zmark,m=0;
        double cnts_per_cycle,p0[Ncycles];
        CHAN *ch = &chan[AXIS_CHAN];
    
        if (PWM_CHAN < 12)
            WhichSnap=SNAP0;
        else
            WhichSnap=SNAP1;
    
        if (PWM_CHAN==8 || PWM_CHAN==12)
        {
            WhichClamp=SNAP_SUPPLY_CLAMP0;
            WhichClampEnable=SNAP_SUPPLY_CLAMP_ENA0;
        }
        else
        {
            WhichClamp=SNAP_SUPPLY_CLAMP1;
            WhichClampEnable=SNAP_SUPPLY_CLAMP_ENA1;
        }
    
    
        WriteSnapAmp(WhichSnap+WhichClamp ,SNAP_CONVERT_VOLTS_TO_ADC(CLAMP_VOLTAGE));
        WriteSnapAmp(WhichSnap+WhichClampEnable,1);
        WriteSnapAmp(WhichSnap+SNAP_PEAK_CUR_LIMIT0,10);  // current limit
        WriteSnapAmp(WhichSnap+SNAP_PEAK_CUR_LIMIT1,10);  // current limit
    
        Delay_sec(1);  // wait for any fault to clear
    
        // rotate until we find the index mark
    
        ch->Enable=FALSE;
        ch->OutputChan0=PWM_CHAN;
        ch->InputMode=ENCODER_MODE;
        ch->InputChan0=ENCODER_CHAN;
        ch->OutputMode=BRUSHLESS_3PH_MODE;
        ch->InputGain0=ENCODER_GAIN;
    
        for (;;)
        {
            Delay_sec(0.001);  // wait a millisecond 
            k+= dk;
    
            Write3PH(ch,A, k/1000.0);  // move the pole 
    
            zmark = ReadBit(Z_BIT_NUMBER);
    
            if (!zmark && ignore>0) ignore--;
    
            if (ignore==0 && zmark)  // check for index mark
            {
                p0[m]=ch->Position; // save position
                kpos[m]=k;           // save phase angle
    
                if (++m == Ncycles) 
                {
                    ch->Position=0;  // set current position to Zero
                    break;
                }
    
                if (m==2) dk = -dk;
                ignore=300;
            }
        }
    
        Write3PH(ch,0,0);    // turn off the coil    
    
    
        //			ch4->CommutationOffset = 3*8000/2.0/12.0 * 1.02;
    
        printf("\nREPORT\n------\n");
        for (i=0; i<Ncycles; i++)
            printf("%d Position = %6.0f PhaseAngle = %f\n",i,p0[i],kpos[i]/1000.0);
    
        printf("Counts per rev = %6.0f\n",p0[1]-p0[0]);
        cnts_per_cycle = (p0[1]-p0[0])/(kpos[1]-kpos[0])*1000.0;
        printf("Counts per cycle = %6.0f\n",cnts_per_cycle);
    
        // round to 10
        if (cnts_per_cycle>0)
            cnts_per_cycle = ((int)(cnts_per_cycle/10.0 + 0.5))*10.0;
        else
            cnts_per_cycle = ((int)(cnts_per_cycle/10.0 - 0.5))*10.0;
    
        printf("Counts per cycle (rounded)= %6.0f\n",cnts_per_cycle);
    
        ch->invDistPerCycle = 1.0/cnts_per_cycle;
        printf("invDistPerCycle (rounded)= %15.12f\n",ch->invDistPerCycle);
    
        mid = (kpos[2]+kpos[1])/2000.0;
        mid = mid - (int)mid;
        ch->CommutationOffset = mid*cnts_per_cycle + 0.25*fast_fabs(cnts_per_cycle);
        printf("Commutation offset = %6.0f\n",ch->CommutationOffset);
        printf("Input Gain Specified = %6.3f\n",ch->InputGain0);
    }
    TK
    http://dynomotion.com

  7. #7
    Join Date
    Oct 2009
    Posts
    46

    Re: SnapAmp brushless motor example

    OK Tom, while I'm still not really sure why we aren't just using the 3 hall signals, setting that aside where do I input the encoder offset number and once I'm done with that is the tuning just as with a brush type motor?

  8. #8
    Join Date
    May 2006
    Posts
    4049

    Re: SnapAmp brushless motor example

    Hi frontrange,

    OK Tom, while I'm still not really sure why we aren't just using the 3 hall signals
    As described in the previous link there are different methods of commutation. We normally prefer sinusoidal commutation using the encoder rather than Hall Sensors for the reasons described in that post.

    where do I input the encoder offset number
    The CommutationOffset is normally set by the program that phase finds your motors after power up. See the HomeBrushless.c example.

    But the motor should be interfaced and the AutoPhaseFind.c program working correctly before attempting to do that.

    once I'm done with that is the tuning just as with a brush type motor?
    Yes

    Regards
    TK
    http://dynomotion.com

  9. #9
    Join Date
    Oct 2009
    Posts
    46

    Re: SnapAmp brushless motor example

    Thanks Tom, hope I didn't come off as an ass. I think you have somewhat talked down to me as if I were and idiot, which I'm really not. I have only seen brushless motors commutated off of the Hall sensors, I know it's not ALWAYS done that way because I have seen a single BLDC that had an encoder but no Hall outputs, so I won't open a can of worms on the virtues of one approach vs another.

    I'm just saying a couple of sentences on the SnapAmp document would have saved me hours of wasted time. I just needed to know how you index a BLDC for commutation and where the program lives.

Similar Threads

  1. Brushless Motor for X2?
    By skmetal7 in forum Benchtop Machines
    Replies: 42
    Last Post: 06-26-2010, 11:42 AM
  2. brushless dc motor
    By microstep1 in forum CNC Machine Related Electronics
    Replies: 0
    Last Post: 09-06-2008, 01:34 PM
  3. Brushless Motor Driver
    By JNFSWE in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 08-25-2008, 10:51 PM
  4. a brushless motor...
    By andy55 in forum Community Club House
    Replies: 2
    Last Post: 08-16-2006, 09:54 PM
  5. Need brushless motor maker
    By Pete-C in forum Hobby Discussion
    Replies: 0
    Last Post: 07-24-2005, 04:36 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •