586,033 active members*
3,129 visitors online*
Register for free
Login
Page 1 of 3 123
Results 1 to 20 of 60
  1. #1
    Join Date
    Jun 2013
    Posts
    1041

    Lots of questions

    I have just received 3 inductive proximity switches from cnc4pc. They are pnp Nc according to there website. They have 3 wires coming from them. Brown is v+ , black is out and blue is 0v. They are 5-24v rated. How would I connect these to k-flop and is there a c program that will allow me to use them for homing? I will use the k-flop pins 15-17 listed for homing if I can for axis 0,1 and 2. I'm not sure how to go about wiring them though.

    Next question. I am helping a friend wire up a cnc router that uses animatics smart motors. I have spoken with animatics and have received a program to set the motors to step direction mode and make each encoder count equal 1 step. The encoder is 1000x4 so 4000 counts per rev. Would I just connect a step and direction pin to matching pins on the motor and wire a ground pin from there motor ground pin to a k-flop ground pin or am I misunderstanding something. They said k-flop would have to pull there pins low (whatever that means). There step direction inputs are lvttl 5v. If I can get the motors wired correctly I will then need to know what mode to set each axis to on the config screen. There will be 4 motors xyza with x slaved to a.

    Last question. I have a Chinese spindle and vfd on the way. Has anyone that you recall interfaced k-flop to one of these vfds to turn on/off and control speed. If so could you give a link to that thread or point me at where to look. This last question we really don't need to get into much right now since it will be a week or 2 before I receive things anyway.


    Thank you
    Ben

  2. #2
    Join Date
    May 2006
    Posts
    4045
    Hi Ben,

    Regarding the proximity switches. You didn't include complete specs. But basically I think they will operate as a 5-24V source. Do you have opto isolated inputs on a KFLOP or SnapAmp available? Those IO bits are only recommendations you can connect to any input. KFLOP IO should only be driven to about 3V. You could use a resistor divider to reduce a higher voltage to a lower voltage. KFLOP JP4 and JP6 have internal 150ohm pull down resistor (on first 8 IO each). If you use those you could use just a series resistance. So for example a 12V signal through a resistor R would drive a 150ohm resitor to a voltage of:

    150/(150+R) x 12 = 3

    solve R=450 ohm (1/4 watt)

    Regarding Step/Dir signals: You didn't provide enough information there are voltage, current, and timing requirements, but it sounds like our LVTTL mode would work.

    Regarding the VFD: you would need to determine what type of input it has to control the speed. 0-10V? +/-10V? Step pulses? PWM?

    Regards
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Jun 2013
    Posts
    1041
    Lets start with the home switches for now and will get specs for the other stuff and post it when I am on a real computer. I read somewhere on here that I can use the optos on snapamp. I may have this backwards but it said connect 5-24v to the opto negative and attach the opto positive to one side of the switch and the switch ground to the supply ground. My confusion is that it was for a two wire mechanical switch. The ones I have are 3 wire. Brown is v+, black is signal and blue is 0v. If I had to hazard a guess I would say put the v+ from the supply to the brown v+ wire, attach the black signal wire to opto positive and the blue 0v to the supply ground. This is probably wrong though because then nothing is connected to the opto negative. Sorry for the confusion but I'm terrified of shorting something out.
    Once I have figured out the wiring I would like to set things up for homing. I have looked at the simple home c program and think I know what's going on. I think I need to change the read bit for each axis to the ones I am attached to. Also I should change the distance to move inside of limits to the number of encoder counts I want to move off the switch. I want zero to be the distance I move off the switch not where the switch is triggered. Can I move the move(0,1000); line above the disableaxis(0); line. I have no limits other then soft limits. I will need to also check the watch negative limits box (positive for z) and change the bit numbers on the config screen as well. The switches are Nc do I check stop when low?
    There will be no far limits for now so I will leave those alone. Does this sound correct?

    Thank you and sorry for making something (most likely)simple so hard.

    Ben

  4. #4
    Join Date
    Jun 2013
    Posts
    1041
    I have one other issue that keeps coming up. On the y axis I have tried 2 motors and 4 different encoders. It is on snapamp channel 1. The plots show spikes throughout the move on the red encoder line. The output green spikes and limits because of the encoder spikes. This usually goes away after I make move commands on the step response screen over and over till I get a plot with no spikes and no limiting. After that I can run with no issues. Also I have found that if I turn on k-flop and wait for the status screen to read 2volts on supplies , then run snapamp initiate c, then turn on the dc supply(48v) and wait for the temperature to reach 25-30 degree c before downloading and enabling the issue and spiking encoder counts never happen. The only common denominators are snapamp and a differential line driver board from cnc4pc. Everything else both mechanical and motors/encoders have been changed but same problem is there. Do you think the line driver board could be causing the encoder spiking or something in snapamp?

    Thanks
    Ben

  5. #5
    Join Date
    May 2006
    Posts
    4045
    Hi Ben,

    Regarding sensors: Most 3 pin sensors sink current to ground like a switch. The current flows from the supply, through the opto, through the sensor, and back to the supply. So you would connect them like this:

    Attachment 216822

    The supply should be 12 or 24V. First wire them up and verify they toggle on the Digital IO Screen. And note their polarity.

    If you want to have Zero inside the limits then you could add another Zero after you inside the limits.

    Regarding encoder spikes: That is very strange. Could you post a plot (with the saved raw data) so we can look at it?

    Regards
    TK
    http://dynomotion.com

  6. #6
    Join Date
    Jun 2013
    Posts
    1041
    I will save a plot and post it. It will take a day or two because I am not around a computer and my phone as far as I know wont let me upload files to the zone. In the mean time I am bypassing the line driver as we speak. It will take a while to get the wiring done but since the new motors encoder has a+/- and b+/- it is really stupid to go through the line driver with just a and b anyway. If this doesn't fix the problem can I try connecting the encoder to snapamp encoder 3 instead of 1? It should let me determine if it is the channel 1 encoder inputs. I guess I would just connect to the channel 3 encoder pins and change the input channel on the config screen to 11 for axis 1?

    Thanks
    Ben

  7. #7
    Join Date
    Jun 2013
    Posts
    1041
    Ok I tried bypassing the line driver and no change. I then switched encoder inputs to channel 11 and same thing. I will now try changing the power wires to snapamp channel 3 and change axis 1 ouput to channel 11. Will let you know if this changes anything. I have saved data from a plot and will upload it later. Hopefully this will get it but if not I'm stumped. I know its not the encoder or motor so its got to be something else.

    Thanks
    Ben

  8. #8
    Join Date
    Jun 2013
    Posts
    1041
    I tried changing to the motor output 11 as well and still no change. I tried retuning from zero and that helped a lot but still the same spikes in encoder just not as bad of a reaction. I have decided its me that is the problem? Maybe resonance or vibration causing instability. Until I can post a plot and get an opinion its no telling. I will get it posted as soon as I can get the info to a online computer.

    Thanks
    Ben

  9. #9
    Join Date
    May 2006
    Posts
    4045
    Hi Ben,

    Yes please post a plot. If the Encoder position is "glitching" many counts and then coming back to the original position then it is unlikely to be the encoders or noise on the quadrature lines. As this would require a burst of quadrature cycles forward and reverse which is unlikely. Are these standard optical encoders? I've seen some specialized magnetic or capacitive encoders that use software interpolation do strange things like that.

    But otherwise it would be more likely a software bug, or configuration bug, or communication issue between KFLOP and SnapAmp.
    Regards
    TK
    http://dynomotion.com

  10. #10
    Join Date
    Jun 2013
    Posts
    1041
    Tom
    Here is a picture of the response screen and the data. Yes it is a standard optical encoder.(The third optical one I have tried) I have smoothed things out since this plot by retuning. The output spikes are greatly reduced but the encoder spikes are still there. This only happens on channel1 not on 0and2.

    Thank you
    Ben

  11. #11
    Join Date
    May 2006
    Posts
    4045
    Hi Ben,

    Thanks. The glitches are jumps to binary numbers that can't possibly be related to your encoder or quadrature signals. I also see huge glitches on the current measurements as well.

    I suspect it is errors happening on the the communication between KFLOP and SnapAmp. This is the short ribbon connector between KFLOP JP4 and SnapAmp. But it is very strange that the communication is common to all axes and channels.

    If you have something configured like a Step/Dir generator, or some code running that would do something to the IO on JP4 that might cause such a corruption in the communications.

    Please provide as much information as possible on your system as possible:

    Version you are running.
    Post your Initialization Program
    Verify the program configuration matches all you screen settings (Step/Config/Filter) for each axis.
    Are you using DC Brush motors?
    I assume 3 motors?
    Only one SnapAmp Correct?
    Have you extended the cable connecting KFLOP to SnapAmp?
    There should be a black Ground wire between KFLOP and SnapAmp. Is there?
    Maybe we should send a set of replacement boards in case it is a hardware problem. Where are you located?
    Have you flashed any programs into KFLOP.

    I don't fully understand what tests you have performed. It seems you swapped many things and it made no difference. But then you state it only happens on axis #1 (Y?). Could you be more clear on what was changed and what the results were. I would think if you switched X to use the "bad" SnapAmp Output and the "bad" encoder input then X KFLOP Axis Channel #0 would become the bad axis. Are you saying it doesn't?

    Sorry for all the questions.
    Regards
    TK
    http://dynomotion.com

  12. #12
    Join Date
    Jun 2013
    Posts
    1041
    Ok let's start at the basics. I have 3 brush servos. Only one snapamp. I have not ever touched the cable between k-flop and snapamp. I will remove and reseat the cable and check the ground wire is connected and tight. I do not have a initialization program. I start k-motion then turn on power to k-flop. Then I open the the config, analog status, c code and axis screen. When I open each one they open to the same place each time and are arranged so they are all visible. I then run the c program that sets current and voltage clamp for snapamp. This program also has the definecoordsystem(0,1,2,-1) at the end. I then turn on motor power. Lastly on the config screen I download each channel 0,1,and 2. Then I open k-motioncnc. It is not maximized and is moved down on the monitor so that the analog status and axis screen are visible above while it's running. This lets me monitor voltage and current while cutting.(probably not needed but I like to see what's going on).
    Now on to what I have done to try and figure out what's going on. I have changed the encoder input on channel 1 from 9 to 11 and moved the wires to those pins. There was no change. I then changed the output on channel 1 from 9 to 11 and moved the motor power wires to the
    terminals for that output. There was no change. This spiking only shows up on config screen channel 1 and doesn't change with different inputs or outputs specified. Could it be the config screen channel 1 that's the problem. Should I try using channel 3 with these inputs and outputs on the config screen?
    I believe I am using k-motion 431j. I won't be at the shop tonight so this may be wrong. I have not flashed anything into k-flop that I know of. When I flash a new version would it erase anything currently flashed? If not I don't remember flashing anything but it's possible. Is there a way to check what's there? Please note that this issue has been present across many different versions of k-motion.
    The reason I have not mentioned the issue is it has not been a hindrance so far. It is worse now with this new motor setup though. I really believe its something minor since it does not always show up. Could it be the USB cable or the computer I am using? I am using breakout boards from winford on the snapamp 50 pin also k-flop jp7 and jp6. Maybe I bumped something on jp4 when they were put in.
    I would really like to try every option possible before even considering changing hardware. Because of the large copper backplate everything in the cabinet is bolted to it would involve removing all components to get it out and get to the screws for the board on the backside.
    Last thing for now. Can you explain what "jumps to binary numbers" means?

    Thank you
    Ben

  13. #13
    Join Date
    May 2006
    Posts
    4045
    Hi Ben,

    Thanks for all the info.

    I believe I understand your steps. They are a bit abnormal but should work correctly.

    Yes using a different KFLOP Axis Channel for Y might be something to try. I can't imagine how that software object could be "bad" but stranger things have happened. Maybe use Axis channel 7 instead of 1. You should be able to save Axis 1 configuration into an *.mot file and the switch to Axis 7 and load it. Do not enable both 1 and 7.

    Flashing "New Version" again will erase any programs or changes. Please do this.

    I think this is a fairly serious issue. Data is being corrupted and may cause any manner of problems such as a position loss or crash.

    Binary numbers are the power-of-two numbers that computers use. The encoder position is passed from SnapAmp to KFLOP as an absolute binary number (4 bits at a time). I zoomed into some of the glitches and looked at the the numeric values of the glitches. In one case the encoder was clicking away at 1 or 2 counts per servo sample from 259 to 261. But then glitched to 320 between them. Look like the bits may have been shifted by 4.

    259=1 0000 0011
    320=1 0100 0000
    261=1 0000 0101

    Please send/post a copy of the C Program that you use to enable SnapAmp and define the coordinate system.
    Also please send screen shots of your Config and Step Response Screens for all your three axes.

    To simplify trouble shooting the problem please do the minimum steps and see if the problem exists. So on power up do not run KMotionCNC at all. Also do not download axes 0 and axis 2. Only Download Axis 1 and make Moves on the Step response screen to see if there is still a problem.

    Thanks for your patience.
    Regards
    TK
    http://dynomotion.com

  14. #14
    Join Date
    Jun 2013
    Posts
    1041
    I will do the tests you have asked in the next day or two and report back. I will also get the info you asked for and post it. Hopefully it is something that can be done without removing the boards. If it does come down to the boards do you think it more likely the k-flop or snapamp? The reason I ask is I know two people locally who have k-flop. One mentioned in the first post in this thread and the other who is not using it at this point. I may be able to borrow the second one for testing if that is needed.

    Ben

  15. #15
    Join Date
    May 2006
    Posts
    4045
    Hi Ben,

    It is hard to say which board might be the problem (or I suppose both is a possibility). The communication is performed from a few FPGA pins on KFLOP connected to a few FPGA pins on SnapAmp through the ribbon cable/connectors. This forms a bi-directional communication channel that communicates data at up to 65 Mbits/sec. It is hard to imagine how FPGA could be damaged in a way to still work most of the time but fail on other times. And especially hard to imagine how at that level it would be possible to only fail on Axis #1. That would be like a microphone that only fails when a certain person talks into it. Unless that person always uses the microphone a a certain time or something??

    There are also 150ohm termination resistor packs on KFLOP and SnapAmp that are involved and if damaged or unconnected could cause communication to be marginal. Maybe you could inspect those for signs of damage. They are R8 on KFLOP and R31 on SnapAmp.

    Regards
    TK
    http://dynomotion.com

  16. #16
    Join Date
    Jun 2013
    Posts
    1041
    I noticed something I am doing and wonder if it could be corrupting things. When I run my snapamp and coordinate program I always hit the save,compile,download,run button. Do I need to do this or will just hitting run work? Not sure if its an issue but im trying to really review my steps to see if I'm causing the problem unknowingly.

    Ben

  17. #17
    Join Date
    May 2006
    Posts
    4045
    Hi Ben,

    No that should not be a problem. You can not just hit run.

    Regards
    TK
    http://dynomotion.com

  18. #18
    Join Date
    Jun 2013
    Posts
    1041
    Ok I made some plots last night but haven't had a chance to put them up yet. Some things I noticed. The spiking did show up on x and z. After 1 or 2 moves on the step response screen they went away completely but persisted on y as usual. Today they did not show up at all on x and z plots just on y. I tried like you asked with the minimum steps possible and not downloading x and z but it still happens on y anyways. I only have backlash comp set on x. When I removed it things didn't go away on y it did not stop the spiking but for some reason greatly reduced it. I suspect from testing that removing the comp on x is why the spiking is not showing up on x and z today. One other strange thing occured. I started all axis like usual and opened k-motion cnc today. Y only acts up during long rapid moves but is very smooth in regular move of g1, g2 etc... At any speed even when equaling rapid speed. When rapiding or on the step response screen the motor is clunky at accel and deccel similar to a improperly tuned motor. I figure its from the spikes in counts. Also the wierdest thing I have ever seen happened. When I zeroed the y axis using the button you made for me instead of putting in a normal value it inserted -5e-006 I believe. The dro showed zero. When I changed it to 0 the dro changed to .0001.
    I have taken pics of all the screens and saved data from each axis and a pic of my snapamp program. I also tried changing the usb cable and made a copy of the small ribbon cable between boards with some connectors I had left over from making the cables to the winford boards. Nothing changed of course but I had to try. I now have a new k-flop board here but wanted to check with you before trying it. I wont blame you if something happens to it but thought I'd get your opinion before trying it.

    Thanks
    Ben

  19. #19
    Join Date
    May 2006
    Posts
    4045
    Hi Ben,

    Thanks for the info. It wasn't clear when you tried the minimum steps whether you did not run KMotionCNC but still saw spikes.

    BTW what is your power supply voltage and what voltage are you clamping at?

    It is sounding more like a hardware or maybe noise/grounding problem.

    I'm not sure how difficult this would be to do but you might check for glitches with motor power off. You would have to move the encoder or axis by hand some how while commanding a "Move" to get a plot.

    Yes please try a different KFLOP if you can.

    Regards
    TK
    http://dynomotion.com

  20. #20
    Join Date
    Jun 2013
    Posts
    1041
    When I tried the minimum steps I did not run k-motion cnc. I did still see spikes. I never open k-motion cnc at all during tuning. I only open it when I am testing coordinated motion or am actually cutting something.

    The voltage is around 50 volts but is clamped at 60.

    Ill disconnect the motor from the gearhead and try a plot by hand without motor power. I will also try the other k-flop.

    I can say that the only axis I have had these major issues with is y. The reason I have tried so many encoders and multiple motors is because it would run great for a while.(3-6 months) Then it would start not returningto zero correctly. After several hours of cutting it might be off .01-.05. Most of the time I can run for 8 hours doing all 3d profiling and return within .0005. It is worse now then it ever has been. One thing I have not done and now am wondering about is grounding the encoder sheilds. The motor power cables have the drain wires going to earth star ground in the enclosure. I tried at on time connecting the encoder cables drain wires to earth ground but it caused serious instability. Can I connect those drain wires to snapamp pin 49 or 50 and maybe get better results? Can they all 3 go to 1 ground pin like that? Also I have a wire from the pc supply for k-flops case connected to earth ground could this be causing noise as well?(screwed the wire to the power supply case and ran to ground). Its so hard to tell when I'm doing something wrong because issues come and go and are only sometimes big enough an issue to keep worrying about.

    Thanks
    Ben

Page 1 of 3 123

Similar Threads

  1. First CNC, Lots of Questions...
    By michael_giesbre in forum LinuxCNC (formerly EMC2)
    Replies: 2
    Last Post: 01-24-2022, 12:40 AM
  2. MWT RF-45: Lots of questions
    By mattmark in forum Benchtop Machines
    Replies: 442
    Last Post: 03-08-2013, 08:02 PM
  3. Newbie with lots of questions
    By ctrmass in forum Benchtop Machines
    Replies: 3
    Last Post: 12-10-2010, 03:53 PM
  4. Lots of Sherline questions..
    By Bowman in forum Benchtop Machines
    Replies: 0
    Last Post: 08-16-2008, 11:44 PM
  5. I'm new, Please help with lots of questions
    By I'm_Lost in forum Surfcam
    Replies: 4
    Last Post: 04-25-2007, 08:08 PM

Posting Permissions

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