Need Help! KFLOP Stepper Motor Encoder Set up


Results 1 to 20 of 20

Thread: KFLOP Stepper Motor Encoder Set up

  1. #1
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default KFLOP Stepper Motor Encoder Set up

    Hi Tom

    After getting my Kstep/Kflop working fine a few months ago with external jog buttons and being away with work for 3 months in the US . I have decided to get the Kanalog connected after a few hiccups with which bits the step/dir controls are through JP5/JP26 connectors it is all working now as it was before adding the Kanalog

    i have now added a 200 PPR optical encoder to Channel 0 but i am not sure how to set up the counts , i know it is the channel input gain setting and i have read posts that show the command and position traces on top of each other but i cant seem to achieve this . see attached picture

    Also i cannot untick the output boxes on the digital I/O screen for bit 2 and 3 ( i have probably set it as an output somewhere by mistake )

    Regards

    Sean

    Similar Threads:
    Attached Thumbnails Attached Thumbnails KFLOP Stepper Motor Encoder Set up-kflop-encoder-setup2-jpg  
    Last edited by sean69_uk; 07-11-2021 at 08:57 PM.


  2. #2
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Sean,

    It looks like the plots would overlay if you zeroed both the command and encoder position before the move so they both started at zero.

    I think you have

    KStepPresent=TRUE; // enable KSTEP input multiplexing

    still set in your INIT Program which tells KFLOP to use bits 2 and 3 to control the multiplexing of the 16 KStep Opto inputs. Remove that and re-boot KFLOP.

    HTH

    Regards
    TK http://dynomotion.com


  3. #3
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Tom

    Thank you for your speedy reply , zeroed the plots and overlayed perfectly

    i have commented out the ,

    KStepPresent=TRUE; // enable KSTEP input multiplexing

    saved the file and rebooted

    But channel 2 and 3 are still ticked ,if i click on them the tick disappears for a millisecond then re-enables as an output

    Thank you so much for your help


    Sean



  4. #4
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Sean,

    Maybe you Flashed KStepPresent into KFLOP. Reset KFLOP to its default state by re-Flashing New Version.

    HTH

    Regards
    TK http://dynomotion.com


  5. #5
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Tom

    Thank you ,that was the problem have re-flashed new version and can no set 2 and 3 as inputs

    I have attached encoder output trace from channel 0 (x axis) if you wouldn't mind having a look to see if i'm on the right track as i'm not 100% sure what i am looking at :-)


    Sean

    Attached Thumbnails Attached Thumbnails KFLOP Stepper Motor Encoder Set up-encoder-output-jpg  


  6. #6
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Tom

    this topic seems to have been hijacked with spam

    I have added error v output plot

    sean



    Quote Originally Posted by sean69_uk View Post
    Hi Tom

    Thank you ,that was the problem have re-flashed new version and can no set 2 and 3 as inputs

    I have attached encoder output trace from channel 0 (x axis) if you wouldn't mind having a look to see if i'm on the right track as i'm not 100% sure what i am looking at :-)


    Sean


    Attached Thumbnails Attached Thumbnails KFLOP Stepper Motor Encoder Set up-encoder-output-error-screen-jpg  


  7. #7
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Sean,

    See how the error oscillates about 25 steps peak-peak? I don't think it is caused by the closed loop feedback. You might do an open loop move to verify that (set PID gains to zero). We don't know anything about your machine or how it is constructed or what the resolution is. Looks like there are about 16 oscillations. If you have a lead screw does it rotate about 16 times for that size of move?

    Note Alt-PrintScreen will capture a single window.

    Its good to attach the raw data so we can re-plot it and zoom in to see things. You may need to zip it to reduce the size so cnczone will allow it.

    Regards
    TK http://dynomotion.com


  8. #8
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Tom

    Sorry for Delay i'm still on central time

    My machine is a retro fit to a Boxford VMC
    Stepper motors are STC HY200-2232-190 200 Step hybrid running on 48v Supply
    16 T pulley on motor to a 20T pulley on a 2.5mm pitch Ball Screw
    200 ppr optical encoder mounted to motor shaft with channel A connected to A0+ and channel B to B0+ on kanalog

    Table moves approximately 35mm during the test 14 turns of ball screw , hard to measure accurately as its all enclosed

    hope this helps

    SEAN

    Attached Thumbnails Attached Thumbnails KFLOP Stepper Motor Encoder Set up-open-loop-error-png   KFLOP Stepper Motor Encoder Set up-open-loop-position-command-png   KFLOP Stepper Motor Encoder Set up-configuration-screen-png  
    Attached Files Attached Files
    Last edited by sean69_uk; 07-13-2021 at 11:18 AM.


  9. #9
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Sean,

    Sorry for Delay i'm still on central time
    No rush from our end


    Stepper motors are STC HY200-2232-190 200 Step hybrid running on 48v Supply
    16 T pulley on motor to a 20T pulley on a 2.5mm pitch Ball Screw
    If I did the math right that comes out to 3200 steps/motor rev and 1600 steps/mm (40640 steps/inch)


    So the move of 50000 would be 50000/3200 = 15.625 motor revs which matches the number of oscillations. Strange to have 25 micro steps of error when measured at the motor shaft. If we were measuring at the lead screw or with linear scales at the stage then an off center pulley or lead screw wobble could be the cause. But this is measured right at the motor shaft. A poorly mounted encoder disk (off center) can cause something like this.

    This corresponds to +/-12 steps / 1600 step/mm = +/- 7.5um

    You might try moving very slowly or to specific motor rev angles and stopping to see if the error is purely a function of motor angle as opposed to time.

    channel A connected to A0+ and channel B to B0+ on kanalog
    I'm surprised this works. Connecting to one differential signal only and leaving the other floating is normally unreliable. But loosing counts and such would show up differently than an oscillation like this.

    Regards
    TK http://dynomotion.com


  10. #10
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Tom

    Thanks for the quick reply , i will re check the encoder wheel as its one of the Broadcom ones where the wheel is tiny and not part of the assembly you have to use a setting tool to align the sensor housing .


    i did try connecting the A-B channels to A0+ and A0- firstly on the kanqlog but didn't get an output signal .it is a single-ended quadrature encoder as only has A and B channels

    Sean



  11. #11
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    i did try connecting the A-B channels to A0+ and A0- firstly on the kanqlog but didn't get an output signal .it is a single-ended quadrature encoder as only has A and B channels
    You should add a differential driver such as this or connect to KFLOP's single ended inputs.

    Regards
    TK http://dynomotion.com


  12. #12
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    KFLOP's Single ended inputs on JP7 that is connected to the kanalong JP14 , break into the ribbon cable ?

    "JP1 converts 8 of the signals and connects them to Kflop I/O bits 0-7 (Kflop JP7 Pins 7-14) which are Kflop's 4 encoder A/B input channels"



  13. #13
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    The encoder inputs can be moved from JP7 and JP5 to JP4 and JP6. See the MuxEncoders.c example.

    Regards
    TK http://dynomotion.com


  14. #14
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Tom

    Couldn't see any wobble in encoder wheel so replaced the whole encoder , larger wheel diameter with 500ppr

    attached are screen shots and file , all settings the same except input gain changed to 1.6 from 4 so command and position traces align

    Attached Thumbnails Attached Thumbnails KFLOP Stepper Motor Encoder Set up-open-loop-error-new-encoder-png   KFLOP Stepper Motor Encoder Set up-open-loop-position-command-new-encoder-png  
    Attached Files Attached Files


  15. #15
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Sean,

    That looks good to me. I think its time to go closed loop to see if you can reduce the errors. Low Pass filter, I gain, and Feed Forward.

    Regards
    TK http://dynomotion.com


  16. #16
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Thanks tom

    glad thats ok , because enabling the MUX for encoder inputs on JP4 and JP6 messed everything up and all the bits stayed high regardless

    Am i adjusting I gain to get output trace to match the command and position traces as attached picture

    Attached Thumbnails Attached Thumbnails KFLOP Stepper Motor Encoder Set up-closed-loop-position-command-new-encoder-png   KFLOP Stepper Motor Encoder Set up-closed-loop-error-load-new-encoder-png  


  17. #17
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Sean,

    glad thats ok , because enabling the MUX for encoder inputs on JP4 and JP6 messed everything up and all the bits stayed high regardless
    That doesn't make sense. Maybe you were missing a GND or miss wired?



    Am i adjusting I gain to get output trace to match the command and position traces as attached picture
    No. The goal is make the error plot as close to zero as possible. Right now the position is lagging behind by about -30 counts while moving positive and +30 counts while moving negative. The output should be going to 30 steps to correct this. The Integrator works by looking at the error and based on the magnitude of the error and the magnitude of the I gain and ramps correction (output) based on their product. In your case the Integrator is correcting the error but ramping so slowly it has only corrected 2 steps of the needed 30 by the time the move is over. Then on the move back the error is +30 so the Integrator ramps negative but only gets back to zero by the time that move is over. The idea is to make the Output correct the error as quickly as possible without over-correcting and going unstable.

    Regards
    TK http://dynomotion.com


  18. #18
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Tom

    attached image seems to be about as good as i can get it.

    Vary much from the settings and the start/stop error goes up or the motor stalls

    Thank you so much for todays help


    sean

    Attached Thumbnails Attached Thumbnails KFLOP Stepper Motor Encoder Set up-closed-loop-error-best-reading-png  


  19. #19
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4043
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Hi Sean,

    That looks reasonable. The equivalent of 5um of error on starts/stops and near zero while moving (of course this is theoretical at the motor, we don't know what the stage actually does).

    This is much slower than before though. You might consider lower acceleration to avoid stalls and errors. I'm not sure what your preferences are, speed or precision?

    Here are your parameters in our TripsWPF.exe tool. Note the Acceleration is Jerk limited so triangular. Peak acceleration is 264575 steps/sec2

    KFLOP Stepper Motor Encoder Set up-seanprofile-jpg

    Regards
    TK http://dynomotion.com


  20. #20
    Activation process sean69_uk's Avatar
    Join Date
    Jul 2018
    Posts
    47
    Downloads
    0
    Uploads
    0

    Default Re: KFLOP Stepper Motor Encoder Set up

    Thanks Tom

    Have assembled the Y axis and have what i think are good settings . the Y axis is identical to the X-Axis , so i am thinking the higher start stop error maybe something mechanical on the slides.

    Now that i know that it all works i will invest in some differential drivers , which will hopefully help if there is any noise

    Thank you so much again for your amazing support

    Sean

    Attached Thumbnails Attached Thumbnails KFLOP Stepper Motor Encoder Set up-y-axis-error-png  


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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

KFLOP Stepper Motor Encoder Set up

KFLOP Stepper Motor Encoder Set up