Welcome to Our Community

Some features disabled for guests. Register Today.

890KV OX RC spindle

Discussion in 'Other Builds' started by Robert Hummel, Jan 13, 2014.

  1. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
    I'll suggest to use an ATtiny13
     
  2. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Looks like you are well on your way with the speed controller project Robert. :thumbsup:

    Tweakie.
     
  3. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    714
    Not sure if I have any tiny13's left only 85's.
    Are you thinking of using the internal clock ?
    I have done some reading up but for a none programing guy like myself it's over dive on the nerd :)
    Seems like there are many ways to skin this cat, software and hardware wise ;)
     
  4. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
    Even the 85 it's OK (the 13 is cheaper)

    Yes, for this project is enough

    Yes for a little more code complexity it's possible to directly analyze the pwm signal (removing the RC filter).
    In this case I think it's the best solution, whith the 85 because it have two separate Timers inside
     
  5. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    714
    I'm not sure but correct me if I'm wrong, how I see it since there are many different input voltage ranges I think a voltage divider circuit before the input would be a good idea.
    It would be a little more work code wise but this way anything above 5vdc could be adjusted then calculated in code to convert to the proper ms output based on the input voltage.

    In sence three or four diffent codes to work with the supplied input
    Know your input volts
    Adjust divider
    Upload code for said divider setting
     
  6. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
    It's better to use an optoisolator, the voltage divider is not so useful

    But i think to make the siplest (and cheaper) circuit it's better to not use the RC fiter

    I'll start to think a little on the code...
     
  7. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    I agree.

    It does seem a bit pointless to convert a digital signal to analog in hardware only to convert it back to digital again in software.

    It would be a simple enough task to sample the Mach3 PWM waveform, measuring the width of a duty cycle pulse then scaling the value found into the 1 mS – 2 mS range then outputting this pulse - all done in a continuous loop repeating at a 20 mS interval.


    Tweakie.
     
  8. bit53b

    bit53b New
    Builder

    Joined:
    Mar 4, 2014
    Messages:
    24
    Likes Received:
    5

    Did you mean by using Timer Capture? This might do the trick...
    http://www.atmel.com/Images/doc8014.pdf
     
  9. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Hi Bit53b,

    Thank you for the information and link :thumbsup: (a chip that I didn't even know existed).

    I think the processing power of the ATtiny and similar R.I.S.C. chips will allow an incoming PWM to be measured quite easily without having to resort to a specialist chip. Of course, the proof of the pudding is always in the eating, so it has yet to be proven but I have every confidence. :)

    Tweakie.
     
  10. DSardano

    DSardano New
    Builder

    Joined:
    Apr 21, 2014
    Messages:
    6
    Likes Received:
    1
    quick question for you gents...
    I know the IPM and spindle speed are the main control points, but do you feel this spindle will handle the task of milling steel? Id love to hear your response; thanks in advance.
     
  11. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    714
    Ok I must have miss understood something as I thought mach3 put out a 0-10 anolog signal
    Now that I re-read things it's the G540 that puts out the 0-10 based on mach3s PWM signal that works with the chin VFDs.
    So yes my idea is pointless ;)
     
  12. bit53b

    bit53b New
    Builder

    Joined:
    Mar 4, 2014
    Messages:
    24
    Likes Received:
    5

    Hi Tweakie,

    Sorry I was a little hurried this morning and could have made my explanation/link a lot clearer.
    The document I linked isn’t a new chip exactly, it’s an Atmel application note explaining how to use the input capture module found in some of the Atmel micro controllers. This is a peripheral feature of the chips, and not a separate, specialist chip. It allows you to calculate frequency, duty cycle of an applied signal using edge-triggered interrupts.

    I was a bit hasty though, I don’t think it appears on the above devices after all!
     
  13. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
    The ATtiny85 dont have the Input Capture feature ^^

    The solution is to use the pin change interrupt + a timer to measure the lengthof the UP signal & DOWN signal to calculate the value of the PWM

    PWM_value = T_UP / (T_UP + T_DOWN)

    Concurrently another timer interrupt is used to generate the new PWM signal
     
  14. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    714
  15. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
    I think the circuit could be something like this
    schem.png
     
    Robert Hummel likes this.
  16. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    714
    I
    have all said parts needed to construct the circuit shown mind you it's a 85 not 45 but that really don't matter other then cost
     
  17. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
    :p it's the same chip (only the amount of memory change ) and in the cad one symbol is enough to make the design
     
  18. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    714
    Do you think a PC817 would also work in place of the 4n35, may not be fast enough :/
     
  19. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
    If the max freq is 4 Khz (as tweakie said) the pc817 can be used, but R2 have to be a 1K
     
  20. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Hi Guys,

    Having babbled on about it, I thought I would just have to give it a try - I had a bit of spare time so connected up a test rig yesterday afternoon.
    I am using a spare pcb (made for another project), the Microchip PIC12f683 and TTL gates for I/O buffering.

    For the initial tests I have set a Mach3 spindle range of 0 to 100 to indicate percentage of motor speed so 0% is off and 100% is full speed (GCodes: S0 to S100).

    I don’t have a spare outrunner (without stripping down one of my models and that is not going to happen) but I am assuming that if we can control a servo then we can control a bldc controller in a similar manner.

    For those that are interested, here is a short video; http://www.graytel.talktalk.net/bldcPWM.wmv


    Tweakie.
     
    Jestah likes this.
  21. Jestah

    Jestah Well-Known
    Builder

    Joined:
    Dec 4, 2013
    Messages:
    148
    Likes Received:
    84
    Wow Well done Tweakie!

    Was that using the circuit a few posts above? I think I understand the principals about reading and then translating the PWM from Mach3 but I am also well out of my depth on how to code this.

    Am I correct in assuming I need to build a small programming rig to program the required small IC ?
     
  22. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Hi Jestah,

    Thanks.

    I used a different circuit to that posted above but it is not dissimilar.
    I think that learning to program these R.I.S.C. chips can be regarded as 'where there is a will...' certainly with the 12f683 there are only 35 instructions that can be used and it does not take too long to get familiar with their use - in some ways it is just a great adventure. :)

    Yes, a programmer and associated drive software is necessary if you were planning on using the Microchip PIC devices but they are cheaply obtained on the bay (probably all made in China).

    Tweakie.
     
  23. bit53b

    bit53b New
    Builder

    Joined:
    Mar 4, 2014
    Messages:
    24
    Likes Received:
    5
    Tweakie that's great!

    (I really like the PIC devices, and especially the development/debugging tools from Microchip)
     
  24. Tweakie

    Tweakie OpenBuilds Team
    Moderator

    Joined:
    Jan 18, 2014
    Messages:
    784
    Likes Received:
    326
    Thanks Bit53b.

    (I was fortunate enough to get all the associated Microchip software paid for, a few years back, when working on a ‘smart card’ access system so, for me at least, programming PIC chips is now relatively painless :) ).

    Tweakie.
     
  25. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
  26. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    714
  27. Robert Hummel

    Robert Hummel Custom Builder
    Moderator

    Joined:
    Nov 14, 2013
    Messages:
    978
    Likes Received:
    714
    All that's left for the stinger is spindle control ;)
    image.jpg
    image.jpg
     
    Serge E., Jestah and Mark Carew like this.
  28. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
  29. bit53b

    bit53b New
    Builder

    Joined:
    Mar 4, 2014
    Messages:
    24
    Likes Received:
    5
    Hi Robert,
    How will you vary the speed of the Stinger spindle without Mach3/PWM ? Does GRBL support this?
    (or did you mean spindle off/on?)
     
  30. oni305

    oni305 Well-Known
    Builder

    Joined:
    Jan 16, 2014
    Messages:
    106
    Likes Received:
    85
    GRBL don't support PWM natively
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice