pwm to esc converter
04 Jan 2016 12:42 - 04 Jan 2016 12:48 #67818
by billykid
pwm to esc converter was created by billykid
Hello
I built the PWM converter to esc motor with pic 12F629 designed for Mach3.
I wanted to use it to drive a spindle speed but I can not set it well
the instructions say: PWM frequency 350 Hz active high 3 ms max pulse.
now I only set PWM frequency to 350 but still fits
Thank you in advance someone helps me to set good
linuxcnc version 2.7.3
Mauro
I built the PWM converter to esc motor with pic 12F629 designed for Mach3.
I wanted to use it to drive a spindle speed but I can not set it well
the instructions say: PWM frequency 350 Hz active high 3 ms max pulse.
now I only set PWM frequency to 350 but still fits
Thank you in advance someone helps me to set good
linuxcnc version 2.7.3
Mauro
Last edit: 04 Jan 2016 12:48 by billykid. Reason: add version
Please Log in or Create an account to join the conversation.
04 Jan 2016 13:50 #67820
by cncbasher
Replied by cncbasher on topic pwm to esc converter
can you give more details of the esc , this is similar to a RC servo ? , but a rc servo is 1ms - 2ms
attach your config as an archive , will help too
attach your config as an archive , will help too
Please Log in or Create an account to join the conversation.
04 Jan 2016 14:05 #67824
by billykid
Replied by billykid on topic pwm to esc converter
exactly
1.5 ms 20 ms off engine stopped
from 1.5 to 2 ms from zero to maximum speed.
but this makes him a pic programmed to do this.
I just have to set the pwmgen to 350 Hz maximum pulse 3ms
I'm using the 5i23 and already works but not well.
thank you
Mauro
1.5 ms 20 ms off engine stopped
from 1.5 to 2 ms from zero to maximum speed.
but this makes him a pic programmed to do this.
I just have to set the pwmgen to 350 Hz maximum pulse 3ms
I'm using the 5i23 and already works but not well.
thank you
Mauro
Please Log in or Create an account to join the conversation.
04 Jan 2016 14:49 #67828
by cncbasher
Replied by cncbasher on topic pwm to esc converter
they use 350Hz as this suits Mach3 , however the pwm is not fixed in Linuxcnc , so you can change this
especialy as your using a 5i23 , everything is configurable .
it all depends on the steps of pwm you have over the range divided by the freq , so you will either get steps that make the increments either unstable or over or under shooting the rpm you require.
if the source is available for the pic , this may well be able to be modified , although i cannot find it .
post your config others may have ideas etc
especialy as your using a 5i23 , everything is configurable .
it all depends on the steps of pwm you have over the range divided by the freq , so you will either get steps that make the increments either unstable or over or under shooting the rpm you require.
if the source is available for the pic , this may well be able to be modified , although i cannot find it .
post your config others may have ideas etc
Please Log in or Create an account to join the conversation.
04 Jan 2016 15:14 - 04 Jan 2016 15:14 #67832
by billykid
Replied by billykid on topic pwm to esc converter
the circuit is this: www.cnczone.com/forums/general-cnc-machi...terface-arduino.html
pages on there is also the source for the pic 12F629 c.
however I think that the problem is the pic ..
by 5i23 signal controlled with the analog oscilloscope and the signal it is clean and in the limit of 3 ms
thanks now try again to program the pic
Mauro
pages on there is also the source for the pic 12F629 c.
however I think that the problem is the pic ..
by 5i23 signal controlled with the analog oscilloscope and the signal it is clean and in the limit of 3 ms
thanks now try again to program the pic
Mauro
Last edit: 04 Jan 2016 15:14 by billykid.
Please Log in or Create an account to join the conversation.
04 Jan 2016 15:56 #67841
by andypugh
Replied by andypugh on topic pwm to esc converter
Something isn't right here. You can't do a 350Hz PWM with a 20mS off-time.
You will need to set the PWM frequency to 50Hz, then set a scale and offset so that 0rpm is 1.5mS and 6000 rpm is 2mS.
1.5mS is 7.5% of 20mS and 5mS is 2.5%
So, if you have a 6000 rpm spindle.
loadrt scale
addf scale.0 servo thread
setp scale.0.gain 0.4166 (6000 * 0.4166 = 2.5%)
setp scale.0.offset 7.5
setp hm2_5i23.0.pwmgen.00.scale 100 (so the pwmgen is working in %)
setp hm2_5i23.0.pwmgen.00.pwm_frequency 50
You might want to add a "limit" HAL component so that the command can't go above 2mS
You will need to set the PWM frequency to 50Hz, then set a scale and offset so that 0rpm is 1.5mS and 6000 rpm is 2mS.
1.5mS is 7.5% of 20mS and 5mS is 2.5%
So, if you have a 6000 rpm spindle.
loadrt scale
addf scale.0 servo thread
setp scale.0.gain 0.4166 (6000 * 0.4166 = 2.5%)
setp scale.0.offset 7.5
setp hm2_5i23.0.pwmgen.00.scale 100 (so the pwmgen is working in %)
setp hm2_5i23.0.pwmgen.00.pwm_frequency 50
You might want to add a "limit" HAL component so that the command can't go above 2mS
Please Log in or Create an account to join the conversation.
04 Jan 2016 16:19 #67844
by billykid
Replied by billykid on topic pwm to esc converter
thanks but then you can do without pic?
I try now
I try now
Please Log in or Create an account to join the conversation.
04 Jan 2016 17:20 - 04 Jan 2016 17:21 #67855
by billykid
here is the ini file and hal, I have the impression that there are many things wrong.
however as he said Andy is working better as time.
spindle_9 section at the end of the .ini file is correct?
thank you all
Replied by billykid on topic pwm to esc converter
here is the ini file and hal, I have the impression that there are many things wrong.
however as he said Andy is working better as time.
spindle_9 section at the end of the .ini file is correct?
thank you all
Last edit: 04 Jan 2016 17:21 by billykid.
Please Log in or Create an account to join the conversation.
04 Jan 2016 17:25 #67856
by andypugh
Replied by andypugh on topic pwm to esc converter
[SPINDLE_9] was "invented" by pncconf and has no special meaning to any module in LinuxCNC.
So, if it is used in the HAL, then that is all there is to worry about.
So, if it is used in the HAL, then that is all there is to worry about.
Please Log in or Create an account to join the conversation.
04 Jan 2016 17:28 #67857
by billykid
Replied by billykid on topic pwm to esc converter
but it can be removed?
Please Log in or Create an account to join the conversation.
Time to create page: 0.082 seconds