Setting up Feed, Rapid and Spindle override with potentiometers...


Page 1 of 4 1234 LastLast
Results 1 to 12 of 37

Thread: Setting up Feed, Rapid and Spindle override with potentiometers...

  1. #1
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    351
    Downloads
    0
    Uploads
    0

    Default Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi guys looking for some help with setting up override knobs on my machine. First of all what resistance potentiometer is best to work with the Kanalog analog inputs? I have 5v and 12v supplys available.

    Next question, is there a c-program floating around for rapid override? If not what is the command to change it? I found an example of FRO and SSO here: http://www.cnczone.com/forums/dynomo...c-program.html

    And Im just learning basics of C programming so just want to confirm im on the right track. Both of these programs need to be merged into my init program right? Everything above main() goes above main in my init program and everything in the for (;;) loops gets added to my for (;;) loop right? How about the line in between main() and the for (;;) loop? In this case the FRO program reads: double Pot,FRO,T; and the SSO program reads double Pot,SSO,T; Do i need both lines before my for (;;) loop or could i just use double Pot,FRO, SSO,T; ?

    Similar Threads:
    Attached Files Attached Files


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

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi mmurray70,

    First of all what resistance potentiometer is best to work with the Kanalog analog inputs?
    I'd suggest around 2K Ohms.

    I have 5v and 12v supplys available.
    The Kanalog ADC Inputs are +/-10V. So 12V would require a series resistor of ~20% to reduce the range to 0-10V. Otherwise 5V could be used and you would get 1/4 of the range (4096/4=1024 count range).

    is there a c-program floating around for rapid override? If not what is the command to change it? I found an example of FRO and SSO here: Setting Feed and spindle by C program?
    The interface for Rapid Rate Override hasn't been added to KMotionCNC. We will try to add it into the next Test Version. If you are capable of adding the code to KMotionCNC please post the changes for us to merge.

    And Im just learning basics of C programming so just want to confirm im on the right track. Both of these programs need to be merged into my init program right?
    Yes

    Everything above main() goes above main in my init program
    Yes these are called global variables/defines. The same defines can be used for both functions so only include those once.

    and everything in the for ( ; ; ) loops gets added to my for ( ; ; ) loop right?
    Yes except for any redundancies (you only need/want one WaitNextTimeSlice() in the loop)

    How about the line in between main() and the for ( ; ; ) loop? In this case the FRO program reads: double Pot,FRO,T; and the SSO program reads double Pot,SSO,T; Do i need both lines before my for ( ; ; ) loop or could i just use double Pot,FRO, SSO,T; ?
    Yes these are local variables for the main function.

    double Pot,FRO, SSO,T;

    is correct as the same "Pot" and "T" variables can be used for both SSO and FRO.

    HTH
    Regards



  3. #3
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    351
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Quote Originally Posted by TomKerekes View Post
    The interface for Rapid Rate Override hasn't been added to KMotionCNC. We will try to add it into the next Test Version. If you are capable of adding the code to KMotionCNC please post the changes for us to merge.
    So are you saying KmotionCNC will not update the display for rapid override? Thats no big deal. So looks like i need to use the SetRapidFRO <F> command right? I think i can probably handle this. Just add code to check pot and output say SetRapidFRO 0.50 for 50% override? Sounds easy enough. Thanks again.



  4. #4
    Registered Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    440
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi murray,
    Did you get the potentiometers working for both Spindle Override and Feed Overrides? And did you do one for Rapid Override?
    Thanks,
    Troy

    http://www.homecncstuff.elementfx.com/


  5. #5
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    351
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Quote Originally Posted by Need TECH Help! View Post
    Hi murray,
    Did you get the potentiometers working for both Spindle Override and Feed Overrides? And did you do one for Rapid Override?
    Thanks,
    Troy
    Hi Troy,

    Yes I used potentiometers for all three and it works well, and best of all Its not too hard to setup. Just connect one side of the pot to ground, the other to 5v-10v and the wiper (middle pin) connects to Kanalog analog inputs. See attached for the code im using. I chopped this out of my init file, let me know if I missed something. You can also use the SetFROwithpot.c and SetSSOwithpot.c examples, but my example shows rapid too. You may have to tinker with the code a little, for example scale the input if a different voltage is used, and adjust maximum and minimum values to suit. I also added a deadband too so that 100% is easier to find. I found it annoying to see 0.99 or 1.02 on the screen, now it jumps to 100 if close. Good luck with it, let me know if you need anything else.

    Mark

    Attached Files Attached Files


  6. #6
    Registered Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    440
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hay Mark,
    Awesome, Will need to get some potentiometers as I only have 5k. Did you use a detent pot, linear, audio or?

    Thanks again,
    Troy

    http://www.homecncstuff.elementfx.com/


  7. #7
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    351
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    They were just normal rotary potentiometers, nothing special. Try and find one with a 1/4 shaft as this will be the easiest to get or make a knob for. Not a big fan of linear as they can get dirt inside. I didnt realize you could get them with detents until you just mentioned it. Might be handy to have a center detent at least so you know when your back at 100%.

    If your ordering new ones might as well get the 2k that Tom recommended, but if you have 5k already id try them. Im pretty sure they would work perfectly fine. Still going to vary the voltage the same way, and the input to Kanalog isnt going to draw any amount of current to throw anything off. Should be fine.



  8. #8
    Registered Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    440
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    I didnt mean linear as mechanical movement but as type of taper. Mechanically they will be rotary. Only have 2 right now so i will need to buy another for the rapid override and might as well get 3 new ones that are all the same.

    http://www.homecncstuff.elementfx.com/


  9. #9
    Registered Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    440
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    I have pots working. Wondering tho, if c code can be adjusted to bring feeds and spindle speed to 0? Or is this limited to the way KMCNC needs to work?
    Also, when FRO is over 100% it takes a couple seconds before feed updates. Is there some configuring I need to change? My look ahead is set to 1 and anything under 100% updates almost instantly when using potentiometer.

    Thanks again,
    Troy

    http://www.homecncstuff.elementfx.com/


  10. #10
    Registered
    Join Date
    May 2012
    Location
    canada
    Posts
    351
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    On my machine turning the feed to minimum pretty much stops it, but i guess it is creeping along at some speed.

    If you really wanted a complete stop you could probably set your init file to do a stopcoordinatedmotion command if the pot value was below a certain number. You could also have it set a variable or bit at the same time to indicate it was stopped by the potentiometer. And then it could be resumed automatically if the pot is over a certain range, and this variable is set. Shouldnt be too hard to do. The spindle could probably be done the same way, but it might take a few extra steps if you want to add delays for it to ramp up to speed.



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

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Troy,

    I have pots working. Wondering tho, if c code can be adjusted to bring feeds and spindle speed to 0? Or is this limited to the way KMCNC needs to work?
    You should be able to command FRO of 0 to stop, or even a negative value to reverse. The problem is probably due to the analog signal will never be exactly zero due to noise, offsets, etc. You might force 0 below some threshold.

    when FRO is over 100% it takes a couple seconds before feed updates. Is there some configuring I need to change? My look ahead is set to 1 and anything under 100% updates almost instantly when using potentiometer.
    You might read this.



  12. #12
    Registered Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    440
    Downloads
    0
    Uploads
    0

    Default Re: Setting up Feed, Rapid and Spindle override with potentiometers...

    Hi Tom,

    So far iam able to issue a Feed Hold when any override is below a certain amount but cant get a resume action to happen when override is above a certain amount, I must press my CycleStart button to resume, which isn't bad but would be better if the resume action would happen when override pot is turned back up a certain amount. There is also a conflict with the behavior of my physical CycleStart and FeedHold button.
    Should the code that would issue a stopcoordinatedmotion command be with the part of code that handles my physical Start and Feed hold buttons? I tried doing this but could not figure it out.

    You might read this.
    Ahh, ok, that's what the setting in the Feed Rate Override is for on the Trajectory Planner Tab. One of those settings I never gave any thought about what it might do.

    Command FRO of 0 causes a pop up stating Enter a value between .1 and 2. Which now that iam using override pots, can this pop up be turned off?

    I have attached my current INIT code.

    Thanks,
    Troy

    Attached Files Attached Files
    http://www.homecncstuff.elementfx.com/


Page 1 of 4 1234 LastLast

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

Setting up Feed, Rapid and Spindle override with potentiometers...

Setting up Feed, Rapid and Spindle override with potentiometers...