Need Help! Mach3 ---> Brushless ESC interface with arduino?


Page 1 of 2 12 LastLast
Results 1 to 20 of 35

Thread: Mach3 ---> Brushless ESC interface with arduino?

  1. #1
    Registered
    Join Date
    Dec 2005
    Location
    USA
    Posts
    430
    Downloads
    0
    Uploads
    0

    Default Mach3 ---> Brushless ESC interface with arduino?

    Problem: Control a brushless ESC through Mach3

    Idea: Program an Arduino microprocessor to convert mach3's PWM spindle output to a brushless ESC's 1-2ms input signal. A brushless ESC needs a 1-2ms on time every 20ms.

    _____-_____-_____-
    ____--____--____--

    Also have the Arduino ramp up from zero to the set speed in mach3.

    Conundrum: I don't know how to program

    Similar Threads:
    Shaun
    my x2 conversion ------> http://www.cnczone.com/forums/showthread.php?t=36403


  2. #2
    Registered
    Join Date
    Dec 2005
    Location
    USA
    Posts
    430
    Downloads
    0
    Uploads
    0

    Default

    kinda getting somewhere with this in this arduino forum: http://www.arduino.cc/cgi-bin/yabb2/...=1226292633/30 (bottom of page)

    i guess programming knowledge would go a long way here :/

    Shaun
    my x2 conversion ------> http://www.cnczone.com/forums/showthread.php?t=36403


  3. #3
    Registered
    Join Date
    Oct 2008
    Location
    US
    Posts
    116
    Downloads
    0
    Uploads
    0

    Default

    A digital solution like a microcontroller would be the most stable, but you could also do this in an FPGA or in straight analog.

    BobH



  4. #4
    Registered
    Join Date
    Sep 2006
    Location
    romania
    Posts
    218
    Downloads
    0
    Uploads
    0

    Cool one possible solution

    I would do ths way:
    1. smoth PWM signal from parallel port (Mach controlled) with a RC filter (you will get 0V for 0% PWM and 5V(or 3.3V) for 100% PWM);
    2. read this signal with ADC module of any available PIC;
    3. compute in PIC the "servo signal" needed to control the brushless ESC.

    you will need:
    - R+C filter, 5V PICxxFXXX, a filtering 100nF capacitor on the PIC supply, optional LED+R
    - maxim 50 code lines, writed in a high level programming language for PIC (I recommend Mikropascal/MikroC/Mikrobasic - free verion is powerfull enough for this application)



  5. #5
    Registered
    Join Date
    Feb 2011
    Location
    Russian Federation
    Posts
    25
    Downloads
    0
    Uploads
    0

    Default

    Still actual?
    I was wondering about the same problem last summer. I haven't managed to find an existing design quickly, so I decided to make the converter myself. The PIC controller was chosen because it was the only MCU type I had a programmer for
    The device is very simple. It sonsists of PIC16F629 controller, a capacitor and a LED to indicate its operation.
    Mach3 ---> Brushless ESC interface with arduino?-img_4270_small-jpg
    The converter is connected between any available LPT output pin and ESC. Provided that large speed controls for large brushless motors usually do not have BECs, the ESC's BEC is not used and not connected. The device uses +5V power supply from BOB or PC.
    The scheme and PCB layout are simple. I have used my CNC mill to engrave the PCB
    Mach3 ---> Brushless ESC interface with arduino?-escconverter-scheme-png Mach3 ---> Brushless ESC interface with arduino?-escconverter-pcb-png
    The recommended PWM frequency setting for Mach 3 is 350, active is high.
    You can see here how it works: http://www.youtube.com/watch?v=DUzuEt8fmJ8]Mach3 to brushless ESC PWM converter - YouTube
    The firmware file for PIC is in the attachment.

    Attached Files Attached Files


  6. #6
    Registered
    Join Date
    Dec 2005
    Location
    USA
    Posts
    430
    Downloads
    0
    Uploads
    0

    Default

    This is cool. It kind of sounds like the motor is revving up and down, how stable is the RPM? You could probably put a disk with a hole and an interrupt switch to let mach know the actual speed.

    Shaun
    my x2 conversion ------> http://www.cnczone.com/forums/showthread.php?t=36403


  7. #7
    Registered
    Join Date
    Feb 2011
    Location
    Russian Federation
    Posts
    25
    Downloads
    0
    Uploads
    0

    Default

    I haven't performed a research of how stable RPMs are, but can say for sure that I haven't noticed any difference in motor's behavior under control of this device and Futaba receiver
    I think that for mill RPM sensing is not that important as for lathe, for example. Hovever, supplying RPM measurement is one of my nearest tasks, and it looks rather easy. I will post an updated device once I'll get to it.



  8. #8
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default

    kretov

    Thanks for sharing & great job with your design, I know someone that can use this for there spindle control

    Mactec54


  9. #9
    Registered Viumau's Avatar
    Join Date
    Mar 2005
    Location
    Brazil
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default Help-me...

    Hello to all friends, Mr. Kretov or a friend can help me? I mounted this your converter, but I have doubts on the Mach3 setup, follow my settings. Is that correct? Thank you.

    The converter is connected to pin 16 of the LPT on my computer.

    Attached Thumbnails Attached Thumbnails Mach3 ---> Brushless ESC interface with arduino?-1-jpg   Mach3 ---> Brushless ESC interface with arduino?-2-jpg   Mach3 ---> Brushless ESC interface with arduino?-3-jpg  


  10. #10
    Registered
    Join Date
    Feb 2011
    Location
    Russian Federation
    Posts
    25
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Viumau View Post
    Hello to all friends, Mr. Kretov or a friend can help me? I mounted this your converter, but I have doubts on the Mach3 setup, follow my settings. Is that correct? Thank you.

    The converter is connected to pin 16 of the LPT on my computer.
    Hello Vimau,

    Lets change the following settings:
    1. Motor Outputs page: set "Dir pin" and "Dir port" pin to 0 - it is not needed for PWM control.
    2. Spindle setup page: uncheck "Step/Dir motor", check "PWM motor".
    3. If you are not using relays to power the spindle, you can check "Disable spindle relays".
    4. I think that "Motor tuning" section has not much influence on PWM control. Just in case, here is a screenshot of mine:
      Mach3 ---> Brushless ESC interface with arduino?-motor_page-png
    5. It makes sense to set-up "Spindle pulleys" setting in order to set maximum PWM that would be used in your part programs. Mach3 will scale the PWM according to this setting. Of course, it is a good idea to measure actual PWM, if possible. But if not, you can set it up empirically, either based on your motor's Kv. Personally I have set the maximum PWM to 1000, while actual RPM is somewhere around 10000. It is not so important if you are not using RPM sensing. Here is a screenshot.
      Mach3 ---> Brushless ESC interface with arduino?-pulleys-png
      If you are using a belt or gearbox, you can specify the ratio.

    I hope it helps. Just let me know if you have more questions.



  11. #11
    Registered Viumau's Avatar
    Join Date
    Mar 2005
    Location
    Brazil
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default

    Thank you Mr. Kretov by responding quickly, I will test and post the results. Can I help with a circuit I developed a tachometer low cost, can be added to your circuit.



  12. #12
    Registered Viumau's Avatar
    Join Date
    Mar 2005
    Location
    Brazil
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default

    Hello, Mr. Kretov I did the setting in Mach3 and seems now is working properly, but I have to say what it is output pin for the PWM, I can not leave without informing a particular pin is not the program will not know which pin should send the signal. I can not disable all relays because I'm using a breakout with my controllers for wrapping other functions too. I'm only doing bench testing because, I'm hoping to get some components that I ordered to finish of mount my ESC for brushed motor, this link - http://norbique.rchomepage.com/esc/. Thanks again for help me.

    The setup was so:

    Attached Thumbnails Attached Thumbnails Mach3 ---> Brushless ESC interface with arduino?-5-jpg   Mach3 ---> Brushless ESC interface with arduino?-6-jpg   Mach3 ---> Brushless ESC interface with arduino?-7-jpg   Mach3 ---> Brushless ESC interface with arduino?-8-jpg  

    Last edited by Viumau; 12-08-2012 at 10:45 AM.


  13. #13
    Registered
    Join Date
    Feb 2011
    Location
    Russian Federation
    Posts
    25
    Downloads
    0
    Uploads
    0

    Default

    Hello Viumau,
    I am glad it worked.
    It seems that I haven't got your idea from the previous message. Anyway, didn't mean you have to disable spindle relays if you are using the PWM converter. However, if both relay and converter are configured to use the same pin, a conflict will happen, most likely (but I haven't tested it).
    In the future designs of the converter I am planning to use the spindle relays option and the rotation direction. So, it will add an extra trigger to avoid accidental engine starts. In my setup a pin used for PWM is not used by any other settings.
    Please let me know if you have more questions.



  14. #14
    Registered Viumau's Avatar
    Join Date
    Mar 2005
    Location
    Brazil
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default

    Mr. Kretov I have another question, because the PWM base frequency in Mach3 for this you controller is its 350Hz?



  15. #15
    Registered
    Join Date
    Feb 2011
    Location
    Russian Federation
    Posts
    25
    Downloads
    0
    Uploads
    0

    Default

    Sorry for such a delayed answer.
    Yes, base PWM frequency is 350Hz. This is the setting you should set in Mach 3 setup. This frequency is used because it appeared to provide enough intermediate speed positions and fits into both PIC's timers.
    And I need to make a correction: the device needed for the controller is, of course, PIC12F629.



  16. #16
    Registered Viumau's Avatar
    Join Date
    Mar 2005
    Location
    Brazil
    Posts
    29
    Downloads
    0
    Uploads
    0

    Default

    Thank you Mr. Kretov, and I look forward with great interest the update of your project.



  17. #17
    Registered
    Join Date
    Feb 2011
    Location
    Russian Federation
    Posts
    25
    Downloads
    0
    Uploads
    0

    Default

    As per some requests, here are the source codes of the converter in C. For pic12f629 and pic12f675. Enjoy!

    Attached Files Attached Files


  18. #18
    Registered
    Join Date
    May 2008
    Location
    malaysia
    Posts
    10
    Downloads
    0
    Uploads
    0

    Default

    Hi, Kretov..

    I don't know much about programing, but can i make this interface with PIC16F84A? its the only PIC a have from my previous LED blinking tutorial....really wanna try this interface to control my ESC....

    Thank...



  19. #19
    Registered
    Join Date
    Feb 2011
    Location
    Russian Federation
    Posts
    25
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by nuai View Post
    I don't know much about programing, but can i make this interface with PIC16F84A? its the only PIC a have from my previous LED blinking tutorial....really wanna try this interface to control my ESC....
    Unfortunately, you cannot use this chip without major modifications of the microcode.
    The problem is that 16F84A chip has only one timer (TMR0), but my microcode is using interrupts from two independent timers (TMR0 & TMR1).



  20. #20

    Default

    Hello Kretov

    i have burned a pic12f629 with your hex file. I used microbrn and i have to say that i have never burned a pic or other processor before. I get a message saying this" The oscal value should be in the form of a RETLW instruction [34xx] currently [3fxx] i build the pcb after your instructions, but i have some problems. When i Mount the pcb to 5v + and - from the supply that feeds all the drivers, and signal on pin 14. Then the led is not on. if i try to take a new power supply and only connect the 5v+ and - (no signal) then the led is rapid flashing in different frequenses
    I do not have any ocilloscope so i can´t check the signal from pin 14 on the breakout board. If i messure the voltage the signal pin is 0v.
    I hope you can help me out....



Page 1 of 2 12 LastLast

Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Mach3 ---> Brushless ESC interface with arduino?

Mach3 ---> Brushless ESC interface with arduino?