584,850 active members*
4,237 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 21
  1. #1
    Join Date
    Apr 2007
    Posts
    7

    Vibration sensor

    Hi all,
    I'm building a vibration sensor for mills and Lathes.
    I'm using a basic stamp and a Hitachi H48C Tri-Axis Accelerometer Module from Parallax.
    I can receive values from the accelerometer to VB6 application.
    I'm trying to send a keystroke to Mach3 to reduce the feed rate if the vibration comes over a limit.
    I'm using this to send the keystrokes from VB6 to Mach but it does not work.
    AppActivate "Mach3"
    SendKeys "%{up}", True 'for the up arrow
    or
    AppActivate "Mach3 CNC Control Application"
    SendKeys "%{up}", True 'for the up arrow

    Any ideas?:drowning:
    Thanks

  2. #2
    Join Date
    Feb 2007
    Posts
    1084
    Not a clue, but I love your idea! Please let us know how it works out! That is kind of one thing that sucks about programming with CAD/CAM, there are many places in the program where you could increase the feedrate because the chip load is much lighter, yet your stuck with one constant feedrate for that particular operation...
    Michael

  3. #3
    Join Date
    Jan 2007
    Posts
    197
    could you use a recorded (like a marco) key stroke pattern and then tell the stamp to send it to a USB controller when the limit has been exceeded?

    anotehr other option: if your controller board has some inputs for home switches, limit switches, etx. you could configure the stamp to operate within parameters of a switch (i.e. give a high signal when the vibration limit is exceeded.) and then tell you your controller software to perform a feed rate reduction when that switch is giving a high value.

    i'm just learning to program in C, so i'm afraid i'm pretty much useless as software goes.

  4. #4
    Join Date
    Apr 2007
    Posts
    7
    I can use the basic stamp to send keystrokes to a PC but I use the VB to collect "samples" every second (20 samples), after that I make an average and I compare this number with the samples of a previous reading (previous second) If there are lot vibrations I need to send keystrokes to reduce the feed rate else I'm increase it. That the idea.....

  5. #5
    Join Date
    Jan 2007
    Posts
    197
    if you have a second basic stamp, have the first one send a high signal to the second one. the second one then does the keystroke send. the other thing is that the single stamp should be able to execute the keystroke send after the limit has been exceeded. if you set the program up to do its monitoring phase, then once the limit is exceeded, it takes half a second to send the keystrokes, then resumes its monitoring phase, you might be able to do it with a single stamp.

  6. #6
    Join Date
    Aug 2007
    Posts
    1
    Hi, dear Sir/Madam
    Thank you for your site and your information .

    your sincerely : hassan

  7. #7
    Join Date
    May 2006
    Posts
    10
    A hardware solution would be the simplest, but you could use a low level windows API call or Assembly language to go into low level os keyboard functions.

  8. #8
    Join Date
    Dec 2005
    Posts
    94
    Quote Originally Posted by ibwood2 View Post
    A hardware solution would be the simplest, but you could use a low level windows API call or Assembly language to go into low level os keyboard functions.
    THAT is a good idea. Have an app that listens to the serial/usb port for the data and then send a signal or message to the Keyboard device driver which has been modified so that it can then forward a down arrow or.. whatever you want, to the mach3 program which would think it just got it from the keyboard.

    now then, my only comment on this other than that is that the basic stamp PROBABLY does not relaly run fast enough to make good measurements. I'm thinkint this way...

    If you have a system that is vibrating (cutting) you need to make sure that the rate of acceleration measurement (ie, position that relates to the vibrations) is at least the nyquist rate of teh chattering that you are trying to avoid. If the chattering is at about 10khz, you need to be sampling at twice that to be able to determine that the 10khz signal is occuring, otherwise you get aliasing on the signal. The basic stamp is a SLOW device. To do this 'right' you should probably be sampling the data at the nyquist rate for the chattering, and then performing a DFT on it to pull out the harmonic components. the DFT would show a spike at the chattering frequency such that you could then easily decide if it was chattering or not and then reduce the feed rate.

    Pics aren't that hard to program, and there are basic compilers out there that would generate code that runs much faster than on a basic stamp!

    Good luck.
    Rick

  9. #9
    Join Date
    Jun 2005
    Posts
    334
    apache405's second suggestion is the optimal solution IMO. Trigger an input when vibration exceeds preset limits.

    You should also try to off load the vibration analysis in the basic stamp. Though having programmed basic stamps it's not very powerful for this use; but it doesn't mean you can't do it or get creative.

    I also wouldn't want something inserting keystrokes.
    I feel you would be asking for an accident... bump the machine and it does something unexpected.

    Jack

  10. #10
    Join Date
    Dec 2005
    Posts
    80
    Hello Efrag

    You can achieve this by adding the required string to the keyboard buffer in the BIOS area of memory, and moving the pointers to suit. With VB you can Peek and Poke and the locations are:

    0x041a is the next character in the buffer
    0x041c is the last character in the buffer
    0x041e is the first character of the 16 byte circular buffer

    I have used this several times in the pre-windows area and I can see (via the old dos program debug) that it is still used today with XP.

    As for programming a PIC I am using Source Boost in C, which is excellent, and I know they have a Basic compiler but as I have not used it I cannot comment on it.

    If any of this is unclear please email me direct and I will attempt VB code which you can correct!

    Regards

    rgammage

  11. #11
    Join Date
    Dec 2005
    Posts
    94
    Quote Originally Posted by jhudler View Post
    apache405's second suggestion is the optimal solution IMO. Trigger an input when vibration exceeds preset limits.

    You should also try to off load the vibration analysis in the basic stamp. Though having programmed basic stamps it's not very powerful for this use; but it doesn't mean you can't do it or get creative.

    I also wouldn't want something inserting keystrokes.
    I feel you would be asking for an accident... bump the machine and it does something unexpected.

    Jack
    True... Hmmm... How about a circuit that's like a 'tuneable' filter.. where it takes output from the accelerometer (a voltage, i beleive) and just uses some op amps to apply like.. a notch filter to it that centers around a certain frequency? Might be doable that way. A bit of front end preprocessing with some hardware bitses would make the basic stamp program MUCH much much simpler to implement.

    I R intrigued now.

  12. #12
    Join Date
    Feb 2006
    Posts
    82
    Efrag

    A couple of thoughts on the principle-
    1. I think you will find that this approach is very similar in concept to knock detection in modern automobiles/ecus. That is, you are looking for a vibration signature that is buried within a lot of machine noise. Without any benefit of test, I suspect that you will find it very difficult to differentiate 'offending' signatures like chatter from other signatures like drive harmonics or system coupling/resonance. Even varying the spindle speed, the cutter geometry, or the stock material will have a significant effect. Long story short, my guess is that without a whole lot of effort, you are going to get a ton of false positives. So far as I know, the big machines do not leverage this approach- they use path speed optimization from the toolpath generator, and also strain gauges on the drives. If an accelerometer was simple and effective, it would be in common use.
    2. I dont believe a stamp has the power required to oversample and interpret the vibration signatures. You will probably need to look at the dsPic or equivalent that is designed to do digital signal processing. Or, there are a number of OEM knock detection chips for automotive that you can repurpose- assuming that they are configurable enough to catch the events in question.

    I have done a lot of work in knock detection in engines- and it is far more complicated than just looking for a voltage spike. And, the signature of the event changes for each engine geometry and placement of the sensor.

    Good luck-
    Rob

  13. #13
    Join Date
    Dec 2005
    Posts
    94
    Quote Originally Posted by extrapilot View Post
    -
    1. I think you will find that this approach is very similar in concept to knock detection in modern automobiles/ecus. That is, you are looking for a vibration signature that is buried within a lot of machine noise.Rob

    Wellll.. yes and no, right? I mean an engine knock sensor is a microphone that is not axis specific. While an accelerometer *IS* axis specific, so if you mount it to the spindle collar you can already guarantee that the vibrations you are detecting along the axis of interest is generated by the cutter.

    Though the last time I did anything like this was over twenty years ago and it was only peripherally in that it was a side project in a company I worked for. I only listened into conversations about it. however, they used a dual 68000 based system running at 10mhz to implement it. I left before it was done so i don't know if they succeeded or not.

  14. #14
    Join Date
    Apr 2007
    Posts
    7
    thanks everyone for your input, I think I'm going to turn on PICs. Extrapilot thanks for the idea on "knock detection" I'm looking for it now.

  15. #15
    Join Date
    Jan 2007
    Posts
    197
    Horsedorf is right, some signal conditioning will help reduce the load on the stamp's program. maybe use some logic gates and an RC circuit tuned to the desired frequency that is detected. I think if you use a two channel AND gate with the accelerometer and the RC on the inputs, when the RC circuit and the vibration are at the same frequency the gate will open. That will create a high signal that the stamp could process. Then in software there could be a counter tied to a timer so that in effect you have a number of high outputs per second limit that would then trigger a high output to your controller or the keyboard interface.

  16. #16
    Join Date
    Feb 2006
    Posts
    82
    HD-

    I dont think axis is really a factor in this. That is, this is a coupled system- would chatter always be in the same axis? What if you were cutting Y vs X, assuming a cut with the same 'side' of the cutter (now 90deg out of phase). Or, on a 45deg?

    On the PIC stuff, this sort of work is not trivial. If all you are looking for is a peak acceleration, this is really simple- just use a nice opamp with the accel chip and charge a small cap in parallel with the ADC input on the PIC. But, I dont think that you can just say 'if accel voltage on X or Y axis > 2.64V then 'chatter detected.'' I hope Im wrong here and just a simple peak voltage detector alarm will work- and it might for a particular cutter/table geometry/stock combination. But I think you want a generic solution for different cutters (and flute counts), machine positions, and spindle speeds, which in combination implies substantially different chatter frequencies. I dont think you can count on any static RC filtering approach if the fingerprint can have 1+ order of magnitude difference in frequency. You are probably going to need to sample the noise as a large number of events and then use FFT or some other filtering approach to characterize it

    Regards,

  17. #17
    Join Date
    Jan 2007
    Posts
    197
    The axis of motion is critical in acceleration because it is a vector. A subroutine in the software could be used to determine the magnitude of the vector using the Pythagorean theorem in 3D. That way it detects vibration in the three axises of motion of the spindle.
    Oh and who said the RC circuit had to be fixed? With a digital pot, the circuit can be tuned in software to match the material/cutter.

  18. #18
    Join Date
    Feb 2006
    Posts
    82
    Apache

    Im fairly certain that the line of inquiry here is 'is it feasible to use an accelerometer to detect chatter- and adjust Mach3's feed rate in a closed loop, without a lot of complexity?' So if that is correct, my perspective on this is- no, and probably not without dsp regardless. If one has to predefine resonance points per cutter/mill geometry, map that into a uC to control a digital pot, and then manually or digitally define the condition of the mill (cutter/spindle speed/stock/etc) for each change of configuration so that the uC can control the RC circuit tuning- that does not seem to me very practical- even if the chatter vibration is fully transmitted to the spindle vs. dissipated in the tool or stock/table (that is- the vibration at the accel chip is substantially above background noise).

    Again, I could be horribly wrong in my assumption here- maybe chatter is always the same frequency regardless of config. That has not been my experience, however. I look forward to hearing the results of some tests- if it does work, it would be a nice failsafe

    Best,

  19. #19
    Join Date
    Jan 2007
    Posts
    197
    Extrapilot:

    Point taken.

  20. #20
    Join Date
    Apr 2006
    Posts
    362

    Question

    Quote Originally Posted by efrag View Post
    Hi all,
    I'm building a vibration sensor for mills and Lathes.
    I'm using a basic stamp
    I'm sure I'm the only one who doesn't know. But what's a "stamp"?

Page 1 of 2 12

Similar Threads

  1. fanuc magnetic sensor
    By keithmech in forum Fanuc
    Replies: 12
    Last Post: 07-08-2013, 08:56 AM
  2. magnetic sensor
    By keithmech in forum CNC Machine Related Electronics
    Replies: 0
    Last Post: 07-29-2007, 12:04 AM
  3. non ARC height sensor
    By sunmix in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 11-05-2006, 06:51 PM
  4. Help with Irda sensor on computer
    By jtree83 in forum Computers / Desktops / Networking
    Replies: 0
    Last Post: 04-18-2005, 03:35 AM
  5. Optical sensor...
    By aghobby in forum DIY CNC Router Table Machines
    Replies: 1
    Last Post: 09-08-2004, 05:17 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
  •