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 :/
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
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
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
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)
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.
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
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.
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
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.
kretov
Thanks for sharing & great job with your design, I know someone that can use this for there spindle control
Mactec54
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:
- Motor Outputs page: set "Dir pin" and "Dir port" pin to 0 - it is not needed for PWM control.
- Spindle setup page: uncheck "Step/Dir motor", check "PWM motor".
- If you are not using relays to power the spindle, you can check "Disable spindle relays".
- I think that "Motor tuning" section has not much influence on PWM control. Just in case, here is a screenshot of mine:
- 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.
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.
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.
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:
Last edited by Viumau; 12-08-2012 at 10:45 AM.
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.
Mr. Kretov I have another question, because the PWM base frequency in Mach3 for this you controller is its 350Hz?
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.
Thank you Mr. Kretov, and I look forward with great interest the update of your project.
As per some requests, here are the source codes of the converter in C. For pic12f629 and pic12f675. Enjoy!
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...
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....