586,036 active members*
3,663 visitors online*
Register for free
Login
Results 1 to 14 of 14
  1. #1
    Join Date
    Oct 2009
    Posts
    230

    4th axis C-code good?

    i put together another dual DAC output motor (ac brushless) and drive (copley) to use on my 4th axis. i got the C code put together and seems to work. i just want to make sure it looks good and are not missing something before i start the motor tuning.

    i believe i got the commutation offset all buttered up and all the bits and channels right.
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: 4th axis C-code good?

    Hi turbothis,

    Looks reasonable to me.

    Regards
    TK
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    great thanks
    the tuning was kinda wonky today but i think i can get some work done on it in the morning
    matt
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  4. #4
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    so i seem to get a little noise or something on my dac2 and dac3 outputs. the motor has a noticeable drag or bumping over as i turn it by hand.
    i unplug the dac output wires and this goes away.
    the analog output page says no voltage outputting when i feel the drag.?
    i get this with both v4.31j and v4.33j
    i measure no DC volts with my meter on the dac pins when the drag is present

    tuning is garbage and i think it might be due to this issue

    hmmmm, loaded v4.33a and now i get an error on the analog screen?

    "no options with analog
    analog screen closed"
    Attached Thumbnails Attached Thumbnails fail.jpg  
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  5. #5
    Join Date
    Jun 2013
    Posts
    1041

    Re: 4th axis C-code good?

    At the top of the screen in kmotion exe there is a options menu. Make sure there is a check Mark next to the boards you are using. That is most likely what's causing the no options error.

    Ben

  6. #6
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    i deleted my old dynomotion stuff and downloaded v4.33j again and are now back on track.
    the 4th axis motor still is very much not responding to tuning.
    noise seems to have gone away mostly though
    the motor is in the vice for tuning purposes right now. i dont think it would be impossible to get some control with no load on the servo?
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  7. #7
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    motor is not too responsive by my hand. i am thinking one of the IIR filters is needed? lol
    Attached Thumbnails Attached Thumbnails run.jpg  
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  8. #8
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    from the phase find c code

    0 Position = 3512 PhaseAngle = 0.494500
    1 Position = 3112 PhaseAngle = 4.494800
    2 Position = 3512 PhaseAngle = 0.479400
    3 Position = 3912 PhaseAngle = -3.520300
    Counts per rev = -400
    Counts per cycle = -100
    Counts per cycle (rounded to 16)= -96
    invDistPerCycle (rounded)= -0.010416666667
    Commutation offset = -23
    Input Gain Specified = 1.000
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  9. #9
    Join Date
    May 2006
    Posts
    4045

    Re: 4th axis C-code good?

    Hi turbothis,

    I think the issue is with the commutation. Notice how things work pretty well in the plot (red plot follows blue) until after a few hundred counts, then I believe the commutation gets off and the motor torque reverses (green plot goes way positive but red plot goes negative) and the motor drives the wrong direction.

    Try with invDistPerCycle set at exactly -0.01

    I think the Auto Phase Find program found this exactly correct, but then rounded to a multiple of 16 because most encoders are powers of 2 like 512 counts/ rev. Measuring the number of counts/rev can be off by several counts which is the reason for the rounding. The counts/cycle must be exactly correct otherwise after enough cycles the commutation will eventually drift off to cause a problem. We should probably make the Auto Phase Finding program smarter and try rounding off to multiples of 16 and multiples of 10 and choose whichever is closer.

    Make absolutely sure the commutation is correct before proceeding to tuning and other things. When the servo is enabled with the output limited to a small value to allow you to force the motor away from the target position, the restoring torque of the motor should increase to a constant saturated torque level and remain constant regardless of how far away (multiple revs) from the target the motor is moved. This demonstrates the motor is being commutated properly and able to maintain constant torque regardless of commutation angle.

    HTH
    Regards
    TK
    http://dynomotion.com

  10. #10
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    nice
    i will try this in the morning and report back here
    thanks matt
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  11. #11
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    the -0.01 invdutypercycle did nothing better. looked worst
    i did the phase find a couple times in a row and got 2 different sets of info

    REPORT
    ------
    0 Position = -400 PhaseAngle = 0.932200
    1 Position = -800 PhaseAngle = 2.931900
    2 Position = -400 PhaseAngle = 0.926500
    3 Position = 0 PhaseAngle = -1.073600
    Counts per rev = -400
    Counts per cycle = -200
    Counts per cycle (rounded to 16)= -208
    invDistPerCycle (rounded)= -0.004807692308
    Commutation offset = -141
    Input Gain Specified = 1.000

    REPORT
    ------
    0 Position = -400 PhaseAngle = 1.928300
    1 Position = -801 PhaseAngle = 3.928700
    2 Position = -401 PhaseAngle = 1.923700
    3 Position = -1 PhaseAngle = -0.077400
    Counts per rev = -401
    Counts per cycle = -200
    Counts per cycle (rounded to 16)= -208
    invDistPerCycle (rounded)= -0.004807692308
    Commutation offset = -141
    Input Gain Specified = 1.000

    REPORT
    ------
    0 Position = -400 PhaseAngle = 1.927800
    1 Position = -800 PhaseAngle = 3.928400
    2 Position = -400 PhaseAngle = 1.923100
    3 Position = 0 PhaseAngle = -0.077100
    Counts per rev = -400
    Counts per cycle = -200
    Counts per cycle (rounded to 16)= -192
    invDistPerCycle (rounded)= -0.005208333333
    Commutation offset = -130
    Input Gain Specified = 1.000

    REPORT
    ------
    0 Position = -400 PhaseAngle = 1.928300
    1 Position = -800 PhaseAngle = 3.928300
    2 Position = -400 PhaseAngle = 1.922800
    3 Position = 0 PhaseAngle = -0.076000
    Counts per rev = -400
    Counts per cycle = -200
    Counts per cycle (rounded to 16)= -208
    invDistPerCycle (rounded)= -0.004807692308
    Commutation offset = -141
    Input Gain Specified = 1.000

    REPORT
    ------
    0 Position = -400 PhaseAngle = 1.928600
    1 Position = -800 PhaseAngle = 3.927900
    2 Position = -400 PhaseAngle = 1.922600
    3 Position = 0 PhaseAngle = -0.077100
    Counts per rev = -400
    Counts per cycle = -200
    Counts per cycle (rounded to 16)= -208
    invDistPerCycle (rounded)= -0.004807692308
    Commutation offset = -140
    Input Gain Specified = 1.000



    REPORT
    ------
    0 Position = -400 PhaseAngle = 1.928300
    1 Position = -800 PhaseAngle = 3.928500
    2 Position = -400 PhaseAngle = 1.923200
    3 Position = 0 PhaseAngle = -0.077200
    Counts per rev = -400
    Counts per cycle = -200
    Counts per cycle (rounded to 16)= -192
    invDistPerCycle (rounded)= -0.005208333333
    Commutation offset = -130
    Input Gain Specified = 1.000

    REPORT
    ------
    0 Position = -400 PhaseAngle = 1.927500
    1 Position = -800 PhaseAngle = 3.928000
    2 Position = -400 PhaseAngle = 1.922700
    3 Position = 0 PhaseAngle = -0.077500
    Counts per rev = -400
    Counts per cycle = -200
    Counts per cycle (rounded to 16)= -192
    invDistPerCycle (rounded)= -0.005208333333
    Commutation offset = -130
    Input Gain Specified = 1.000
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  12. #12
    Join Date
    May 2006
    Posts
    4045

    Re: 4th axis C-code good?

    Hi Matt,

    Strange the reports now all show 200 counts/cycle which would be an InvDistPerCycle of 0.005.

    Did you change something?

    Regards
    TK
    http://dynomotion.com

  13. #13
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    well, i jumped the encoder up to 1024 and now this is starting to work good
    the motor is much more like it should be and tunable now
    it has a sorta bearing screech sound while running. i think this is at about the full 2800 rpm limit though.
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

  14. #14
    Join Date
    Oct 2009
    Posts
    230

    Re: 4th axis C-code good?

    encoder at 1024 setting


    REPORT
    ------
    0 Position = 53248 PhaseAngle = 0.187600
    1 Position = 49152 PhaseAngle = 2.186900
    2 Position = 53248 PhaseAngle = 0.179300
    3 Position = 57344 PhaseAngle = -1.820300
    Counts per rev = -4096
    Counts per cycle = -2049
    Counts per cycle (rounded to 16)= -2048
    invDistPerCycle (rounded)= -0.000488281250
    Commutation offset = 137
    Input Gain Specified = 1.000

    REPORT
    ------
    0 Position = 0 PhaseAngle = 0.187200
    1 Position = -4096 PhaseAngle = 2.186600
    2 Position = 0 PhaseAngle = 0.179200
    3 Position = 4096 PhaseAngle = -1.820700
    Counts per rev = -4096
    Counts per cycle = -2049
    Counts per cycle (rounded to 16)= -2048
    invDistPerCycle (rounded)= -0.000488281250
    Commutation offset = 137
    Input Gain Specified = 1.000

    REPORT
    ------
    0 Position = 0 PhaseAngle = 0.186700
    1 Position = -4096 PhaseAngle = 2.186700
    2 Position = 0 PhaseAngle = 0.178700
    3 Position = 4096 PhaseAngle = -1.820700
    Counts per rev = -4096
    Counts per cycle = -2048
    Counts per cycle (rounded to 16)= -2048
    invDistPerCycle (rounded)= -0.000488281250
    Commutation offset = 138
    Input Gain Specified = 1.000
    Position = 0.000000

    - - - Updated - - -

    Quote Originally Posted by TomKerekes View Post
    Hi Matt,

    Strange the reports now all show 200 counts/cycle which would be an InvDistPerCycle of 0.005.

    Did you change something?

    Regards
    i dont think so
    that was all at the 400 counts on the encoder settings
    shizuoka an-s knee mill=kflop/kanalog running nema 34 dc brushed servos
    cincinnati sabre 750=kflop/kanalog building now with ac brushless servos

Similar Threads

  1. Replies: 14
    Last Post: 07-19-2014, 05:55 AM
  2. How to work arc good into code?
    By panozeng in forum Waterjet General Topics
    Replies: 1
    Last Post: 11-28-2010, 11:15 PM
  3. Need good code!
    By dave6 in forum Mazak, Mitsubishi, Mazatrol
    Replies: 2
    Last Post: 11-29-2008, 06:01 PM
  4. Looking For a good cad/cam w/ 4th axis
    By fc911c in forum Uncategorised CAM Discussion
    Replies: 1
    Last Post: 10-03-2005, 02:20 PM
  5. Help G-code No Good
    By chrisw765 in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 5
    Last Post: 03-18-2005, 05:55 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
  •