584,833 active members*
5,596 visitors online*
Register for free
Login
Page 1 of 6 123
Results 1 to 20 of 113
  1. #1
    Join Date
    Aug 2008
    Posts
    573

    PIC based DRO

    Continued from Welcome thread

    Look like you haave been busy. The engraver looks great.
    Thanks

    I would be interested in how you used the PICs for your DRO`s. Did you design them yourself?
    I wonder if they could work using encoders ?

    Mario
    The DRO (still work in progress) uses one 12F675 per channel to read the digital scale. The outputs of four PIC are multiplexed into one serial port of a PC. The PC runs a VB5 application that displays the readings (see attached).

    The layout of the main form is designed to match my homebrew PC's touchswitches that are arranged down the left and right sides of the display

    I spent sometime getting every thing to talk to each other neatly, so for instance, you can plug an extra vernier/scale into the adapter block and it just pops up on the screen.

    As to using the PICs with quadrature encoder, I'm sure the little 8 pinners I've used lack the necessary hardware (you'd need a couple of fast counters to ensure no pulses were lost). The ones to use would be the dsPIC devices like the 30F4012 (?) which have the quadrature hardware inside.
    Attached Thumbnails Attached Thumbnails VB.jpg   DRO adapter.jpg   DRO PPC.jpg  

  2. #2
    Join Date
    Nov 2003
    Posts
    154
    Could you post more metails on the project. I have been playing in various pics of the past year and would like to get a little more advanced in reading other pulses.

  3. #3
    Join Date
    Aug 2008
    Posts
    573
    Quote Originally Posted by mc_n_g View Post
    Could you post more metails on the project. I have been playing in various pics of the past year and would like to get a little more advanced in reading other pulses.
    What pulses are you trying to read?

  4. #4
    Join Date
    Nov 2003
    Posts
    154
    I am trying to do a better job in understanding teh analog and digital side of the processing. I have played with temp sensors and other simple items for input. I have not worked with any encoders at all. This is where I am lacking examples and expereience.

  5. #5
    Join Date
    Aug 2008
    Posts
    573
    I'm not actually reading encoders. I'm decoding the digital data outputs of those cheap Chinese digital calipers (see :examples here). To keep my circuit simple, I'm using the PICs onboard comparitor and reference to convert the low level (~1.5v) signal to one that the PIC can read.

    This circuit is of a single device reader powered by the serial port.



    The LEDs (D1,2,3) limit the voltage to about 1.2v when the PIC drives the scale's inputs.

  6. #6
    Join Date
    Jun 2007
    Posts
    20

    Unhappy

    As to using the PICs with quadrature encoder, I'm sure the little 8 pinners I've used lack the necessary hardware (you'd need a couple of fast counters to ensure no pulses were lost). The ones to use would be the dsPIC devices like the 30F4012 (?) which have the quadrature hardware inside.[/QUOTE]


    Hi Bill. It all looks impressive. You have certainly done a good job. I wish I had your talents. Unfortunately I am just a Trial and error learner at both electronics and Cnc`ing If i had one wish it would be that there was a way to verify my steppers with an encoder in Mach 3. A task too difficult for me with my limited experience.

    Marz

  7. #7
    Join Date
    Aug 2008
    Posts
    573
    If i had one wish it would be that there was a way to verify my steppers with an encoder
    The usual method is to mark the motor's starting position accurately, then run a torture test (i.e. a test that runs the motor at various speeds back and forth until finally return ing to the start point), then check the motor has returned to the start postition correctly.

  8. #8
    Join Date
    Jun 2007
    Posts
    20
    The usual method is to mark the motor's starting position accurately, then run a torture test (i.e. a test that runs the motor at various speeds back and forth until finally return ing to the start point), then check the motor has returned to the start postition correctly.

    Yer Bill. I have done all that. I set up a dial indicator on both axis and then ran a g code program with rapid moves for a 1/2 hr. I tuned the motors for 10% under the max revs before it misses pulses. Its just sometimes if I push the toolbit too hard it misses a few steps. I know thats my fault, but it would be nice if it could correct itself. If only I had the money to run servos....


    Marz

  9. #9
    Join Date
    Aug 2008
    Posts
    573
    but it would be nice if it could correct itself.
    I see. Can mach3 do that, if it has encoder/count inputs?

    What sort of input does Mach3 need?

  10. #10
    Join Date
    Jun 2007
    Posts
    20
    Quote Originally Posted by BillTodd View Post
    I see. Can mach3 do that, if it has encoder/count inputs?

    What sort of input does Mach3 need?
    I`m not really sure.I was thinking along the lines of another pic or such countin pulses and comparing the result with an encoder (sort of like a virtual closed loop system) and if it misses steps using one of the inputs to signal a positioning error

    Marz

  11. #11
    Join Date
    Mar 2007
    Posts
    534
    I'm brewing up much the same but with a home made computer board reading scales and stepping motors.

    The step timer interrupt compares "where I am" with "where I want to be" and steps accordingly.

    The "where I am" can change at any moment should a report be received from any of the 3 scale interrupts. (I read them with hardware because any lag will only serve to confuse it).

    At the end of an x,y,z stepping sequence it works out the error on all 3 axes. Should any be outside tolerance it doesn't update the "where I want to be" to a new position. This means I get remedial steps to put it back on course.

    Questions are, wil it do more remedial steps than moving steps, and, how tight can I put the tolerance

    I only have to mount the scales and I can find out

  12. #12
    Join Date
    Aug 2008
    Posts
    573
    Quote Originally Posted by Robin Hewitt View Post
    I'm brewing up much the same but with a home made computer board reading scales and stepping motors.

    The step timer interrupt compares "where I am" with "where I want to be" and steps accordingly.

    The "where I am" can change at any moment should a report be received from any of the 3 scale interrupts. (I read them with hardware because any lag will only serve to confuse it).

    At the end of an x,y,z stepping sequence it works out the error on all 3 axes. Should any be outside tolerance it doesn't update the "where I want to be" to a new position. This means I get remedial steps to put it back on course.

    Questions are, wil it do more remedial steps than moving steps, and, how tight can I put the tolerance

    I only have to mount the scales and I can find out
    Interesting idea Although,the missed steps may not be able to be corrected until the cause has been removed.

    i.e. if it drops steps because of excess speed v load, will there be time to correct them before the next motion without increasing the frequency of the pulses thus exacerbating the speed v load problem?

    (Well worth trying though )

  13. #13
    Join Date
    Mar 2007
    Posts
    534
    The fast traverse is a completely separate interrupt handler, precise placement only happens at speeds where the motors can handle an instantaneous reversal.

    There is more work to do. When it encounters back lash it will tend to trail by the tolerance and I will need extra remedial steps. OTOH I'm not going to try to fix anything until it has had a chance to tell me what needs fixing.

    I'm writing the code and everything runs in SRAM. I can recompile and upload all new in a matter of seconds. I am in control

  14. #14
    Join Date
    Jun 2007
    Posts
    20
    Hi Robin. What a brilliant idea. When you get it right you will have solved one of the major issues with using steppers. i would be interested in the outcome.I had another thought that if i had the knowhow would be worth pursuing. What if you had a PIC counting pulses sent my Mach 3 and then the PIC moved the stepper motor using the encoder to go to the correct position? Its probably complicated, and you would get some lag,but i would gladly put up with lag for accuracy.

  15. #15
    Join Date
    Aug 2008
    Posts
    573
    What if you had a PIC counting pulses sent my Mach 3 and then the PIC moved the stepper motor using the encoder to go to the correct position?
    Hmmm , That wouldn't be too difficult.

    I use a PIC (16F84 and an L6219) to drive the Z motor on my engraver, it'll happily keep up with the step inputs from the controller using interrupts. It even has has a couple of unused timer/counters that could be used to track an encoder. Might be worth a look

    [I still wonder, if you're going to add all this complexity you might be better of using proper servo-motors]

  16. #16
    Join Date
    Jun 2007
    Posts
    20

    Smile

    Quote Originally Posted by BillTodd View Post
    Hmmm , That wouldn't be too difficult.


    [I still wonder, if you're going to add all this complexity you might be better of using proper servo-motors]
    Yeah. you could be right, but steppers and encoders on ebay are a lot cheaper than servos, and if a cheap PIC could be made to act as a Pseudo closed loop it would be just as good for a lot less money for the DIYers

  17. #17
    Join Date
    Aug 2008
    Posts
    573
    Yeah. you could be right, but steppers and encoders on ebay are a lot cheaper than servos, and if a cheap PIC could be made to act as a Pseudo closed loop it would be just as good for a lot less money for the Dyer's
    "just as good.." No, I'm afraid not.

    If a servo system requires speed to catch-up with the commanded steps all it has to do is dump more power into the servo motor (right up to the point it/something goes bang or hits a power limit) . A stepper motor driver cannot do this. The best a closed loop stepper system could do is to wait until the overload event has passed then add pulses to get back on track.

    Now let's assume the above error occurred while cutting material with multiple passes ( caused by a knot in a piece of wood for example) ; both would have left a 'bump' of uncut material. The servo system would have probably left a smaller bump than the stepper (since it had more power available to attack the bump), so subsequent passes would likely reduce the bump. The stepper system would have to leave the bump untouched and add to the bump while it waited to correct the error. Subsequent passes are very likely to stall again at the initial bump and... well you can see where it's going.

  18. #18
    Join Date
    Mar 2007
    Posts
    534
    Quote Originally Posted by BillTodd View Post
    Now let's assume the above error occurred while cutting material with multiple passes ( caused by a knot in a piece of wood for example) ; both would have left a 'bump' of uncut material.
    If you overload a stepper to the point where you lose steps everything thereafter is garbage. That's why us stepper people tend to drive them way below capacity. I have more than enough power to snap the tool but I try not to use it

    With the scales attached, theoretically if it can't cut the material all 3 axes stop, possibly within 0.02 seconds depending on the tolerance. The repeating step pattern will cause it to back off and then try again and again until it succeeds, or not as the case may be.

  19. #19
    Join Date
    Aug 2008
    Posts
    573
    With the scales attached, theoretically if it can't cut the material all 3 axes stop, possibly within 0.02 seconds depending on the tolerance. The repeating step pattern will cause it to back off and then try again and again until it succeeds, or not as the case may be.
    That would be the advantage of taking control at an earlier stage in the system.

    Although, If your steppers aren't losing steps (because you're driving them well within limits) why do you need the recovery system?

  20. #20
    Join Date
    Mar 2007
    Posts
    534
    Not so much a recovery system, more an external reference to locate the table without depending on everything staying in adjustment on a cheap mill

    I have a certain amount of spring in the system. The Gibbs are tighter at the ends where I rarely stray making backlash a variable. Changing pressure from the tool makes it unpredictable.

    Aiming to better 1 thou accuracy has become a sort of Grail quest... Not quite sure what I'd do with it if I found it but I feel compelled to try

Page 1 of 6 123

Similar Threads

  1. Is water based
    By cncadmin in forum Safety Zone
    Replies: 45
    Last Post: 10-19-2022, 05:10 PM
  2. Need help with CNC UK based
    By ciscoe in forum European Club House
    Replies: 1
    Last Post: 07-21-2008, 12:03 PM
  3. Pic based Oscilloscope
    By thegimpster in forum PIC Programing / Design
    Replies: 0
    Last Post: 01-25-2008, 07:48 PM
  4. PC Based Controls
    By zimbricd in forum News Announcements
    Replies: 0
    Last Post: 12-12-2007, 09:38 PM
  5. dos based cnc software
    By flyingmike in forum Computers / Desktops / Networking
    Replies: 14
    Last Post: 11-25-2005, 08:29 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
  •