Welcome to Our Community

Unlock hidden features. Sign Up for Free Today!

Spindle Controller for Brushless DC Motor

Discussion in 'Controller Boards' started by The Dude, Jan 25, 2014.

  1. The Dude

    The Dude Veteran
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    98
    I'm working on building the Pulse Width Modulator (PWM) generator which is required to control an Electronic Speed Controller (ESC) which controls a brushless DC motor. I'm learning a lot and wanted to share it with everyone. If you're trying to make your own spindle based on the 890KV OX RC spindle then this is for you. I'm working on the parts list and so far I needed a 555 timer and I found some 15 year old timers in my storage. I wanted to test them to see if they are good and here is a circuit which works to test these timers:
    555-tester-circuit.JPG
    Now on to using the <good> timer to generate a signal for the ESC. :) If you have a good timer the lights will alternately blink. They stay on for about 1s each and then turn off and the other one comes on. Anything else means a bad timer or miswired circuit. Also, smoke coming from an LED means a miswired circuit too ;).
     
    #1 The Dude, Jan 25, 2014
    Last edited: Jan 25, 2014
    TMG likes this.
  2. JustinTime

    JustinTime Master
    Builder

    Joined:
    Dec 18, 2013
    Messages:
    829
    Likes Received:
    165
  3. The Dude

    The Dude Veteran
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    98
    So let me get this straight... Someone in Hong Kong is willing to sell you something for cheaper than you can make it yourself. They are also willing to give free shipping for this $1.67 item. Have you ever heard of dumping? And when your $1.67 part goes bad do you just shut down your cnc machine and wait for 3 weeks for a new one from Hong Kong?

    For me, this is about having control over my machine. I can fix it, troubleshoot it, etc. As time goes by, I will build my own ESC and eventually a motor controller. These will be sitting on-hand as replacement parts and when they get used another will be made. I'll never have any down time unless I want it. See how that works?

    FYI, my dad build a TV back in the 60s... We replaced one resistor in the 80's and it was used almost every day for 30 years. I think he still has it.
     
  4. JustinTime

    JustinTime Master
    Builder

    Joined:
    Dec 18, 2013
    Messages:
    829
    Likes Received:
    165
  5. The Dude

    The Dude Veteran
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    98
    That site always gives me an error going to a url if I'm not logged in to phlatforum.
     
  6. JustinTime

    JustinTime Master
    Builder

    Joined:
    Dec 18, 2013
    Messages:
    829
    Likes Received:
    165
    Thanks for letting me know. In the future I will not reference them, I'll upload them.
     

    Attached Files:

    Robert Hummel likes this.
  7. The Dude

    The Dude Veteran
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    98
    OIC now. I am looking at the parts for a PWM controller and it looks like I need the 555, 2 capacitors, 2 resistors, and a potentiometer. Another reason I'm doing this is because I'd like to be able to get a readout of the actual RPM on the spindle by using an optical switch. I have to fab 8 switches already so one more is no problem.

    Another option I'm looking at for the pwm is to use pin15 off my parallel port. I don't like this because it reduces the overall bandwidth of the port which means slower stepper speeds. A separate controller which can send an updated speed less frequently is ideal until I can resolve the bandwidth.
     
  8. JustinTime

    JustinTime Master
    Builder

    Joined:
    Dec 18, 2013
    Messages:
    829
    Likes Received:
    165
  9. The Dude

    The Dude Veteran
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    98
    Ideally the computer will set and read the RPMs. For now I can just do the timer thing to get it running and calculate the RPM by hand. Later, I can replace the potentiometer with a device that communicates on pin 15 of the parallel port via serial data. This device will take a digital number, probably 8 bits, and convert that to a resistance and act as the pot. Even later, this device will read the RPMs of the motor and send that value over pin 15 every couple seconds. The computer has it's own RPM display and panel for setting the speed.

    FYI I have both an analog-to-digital converter and a digital-to-analog chip from an old fiber optics hobby board that I no longer use so the parts could be reused. ADC0804LCN and CD4516BE
     
    #9 The Dude, Jan 28, 2014
    Last edited: Jan 28, 2014
  10. JustinTime

    JustinTime Master
    Builder

    Joined:
    Dec 18, 2013
    Messages:
    829
    Likes Received:
    165
    If you are so inclined, you could have the computer read the RPMs. If you connect a probe to one of the three motor wires and hook up a counter to it, the counter could sent it's results to the computer. That's basically what the above unit does only it sends the results to the LCD readout.

    Yeah, it would be nice if you can come up with a way that will eliminate the ESC and have the computer control the speed.
     
  11. The Dude

    The Dude Veteran
    Builder

    Joined:
    Jan 2, 2014
    Messages:
    243
    Likes Received:
    98
    The problem with that is you have the motor turning at 10k RPM so you must sample the port at 10k Hz which lowers the bandwidth by as much. I don't really care about having realtime RPM readouts if it slows my steppers down. Each motor takes like 30kHz when I adjust for the PC jitter.

    But anyway, I do have this arduino sitting around. They're like $40. I could use it to do the spindle functionality as well as give me a real-time readout on an an LCD and connect pin 15 to the parallel port for serial comms. It's a little bit of overkill but if I later add a heated bed it could control that... maybe it could be used for a lathe...
     

Share This Page

  • About Us

    The OpenBuilds Team is dedicated helping you to Dream it - Build it - Share it! Collaborate on our forums and be sure to visit the Part Store for all your Building needs!
  • Like us on Facebook

  • Support Open Source FairShare Program!

    OpenBuilds FairShare Give Back Program provide resources to Open Source projects, developers and schools around the world. Invest in your future by helping others develop theirs!

    Donate to FairShare!