[Grbl_Esp32 Issue#266] During the movement of any axis, the ECS spindle stops.

未分类 bolang 4个月前 (10-14) 41次浏览

Issue #266 | 状态: 已关闭 | 作者: hedon77 | 创建时间: 2019-10-25

标签: bug


What version of the firmware are you using?
1.1f (20191023) (ESP32)

Is the problem repeatable?
Yes.

Under what conditions does the bug occur?
During the movement of any axis, the ECS spindle stops.
The ECS controller is still issuing 2 beeps.
Everything worked in version 1.1f (20190708) (ESP32).

Best regards


评论 (11)

#1 – bdring 于 2019-10-25

I’ll look into that tomorrow. Could you paste in your cpu_map (just the text of the one you use) and your $$ settings?


#2 – hedon77 于 2019-10-26

Hi,

This is corexy system.

C++
#ifdef CPUMAPESP32ESCSPINDLE
// This is the CPU Map for the ESP32 CNC Controller R2

// It is OK to comment out any step and direction pins. This
// won't affect operation except that there will be no output
// form the pins. Grbl will virtually move the axis. This could
// be handy if you are using a servo, etc. for another axis.
#define CPUMAPNAME "CPUMAPESP32ESCSPINDLE"

#define XSTEPPIN GPIONUM12
#define XDIRECTIONPIN GPIONUM26
#define XRMTCHANNEL 0

#define YSTEPPIN GPIONUM14
#define YDIRECTIONPIN GPIONUM25
#define YRMTCHANNEL 1

#define ZSTEPPIN GPIONUM27
#define ZDIRECTIONPIN GPIONUM33
#define ZRMTCHANNEL 2

// OK to comment out to use pin for other features
#define STEPPERSDISABLEPIN GPIONUM13

// * the flood coolant feature code is activated by defining this pins
// * Comment it out to use the pin for other features
#define COOLANTFLOODPIN GPIONUM16
//#define COOLANTMISTPIN GPIONUM21

// If SPINDLEPWMPIN is commented out, this frees up the pin, but Grbl will still
// use a virtual spindle. Do not comment out the other parameters for the spindle.
#define SPINDLEPWMPIN GPIONUM17
#define SPINDLEPWMCHANNEL 0

// RC ESC Based Spindle
// An ESC works like a hobby servo with 50Hz PWM 1ms to 2 ms pulse range
#define SPINDLEPWMBASE_FREQ 50 // Hz for ESC
#define SPINDLEPWMBIT_PRECISION 16 // 16 bit required for ESC
#define SPINDLEPULSERES_COUNT 65535

#define ESCMINPULSE_SEC 0.001 // min pulse in seconds (OK to tune this one)
#define ESCMAXPULSE_SEC 0.002 // max pulse in seconds (OK to tune this one)
#define ESCTIMEPERBIT ((1.0 / (float)SPINDLEPWMBASEFREQ) / ((float)SPINDLEPULSERES_COUNT) ) // seconds

#define SPINDLEPWMOFFVALUE (uint16t)(ESCMINPULSESEC / ESCTIMEPERBIT) // in timer counts
#define SPINDLEPWMMAXVALUE (uint16t)(ESCMAXPULSESEC / ESCTIMEPERBIT) // in timer counts

#ifndef SPINDLEPWMMIN_VALUE
#define SPINDLEPWMMINVALUE SPINDLEPWMOFFVALUE // Must be greater than zero.
#endif

#define SPINDLEENABLEPIN GPIONUM22

// if these spindle function pins are defined, they will be activated in the code
// comment them out to use the pins for other functions
//#define SPINDLEENABLEPIN GPIONUM16
//#define SPINDLEDIRPIN GPIONUM16

#define XLIMITPIN GPIONUM35
#define YLIMITPIN GPIONUM4
#define ZLIMITPIN GPIONUM15
#define LIMIT_MASK B111

#define PROBEPIN GPIONUM_32

//#define CONTROLSAFETYDOORPIN GPIONUM_35 // needs external pullup
#define CONTROLRESETPIN GPIONUM34 // needs external pullup
#define CONTROLFEEDHOLDPIN GPIONUM_36 // needs external pullup
#define CONTROLCYCLESTARTPIN GPIONUM_39 // needs external pullup

#endif
`
`
$$
$0=3
$1=250
$2=0
$3=0
$4=0
$5=1
$6=0
$10=15
$11=0.010
$12=0.002
$13=0
$20=0
$21=1
$22=1
$23=4
$24=2000.000
$25=100.000
$26=250
$27=3.000
$30=1000.000
$31=0.000
$32=0
$100=100.000
$101=100.000
$102=400.000
$110=2000.000
$111=2000.000
$112=400.000
$120=200.000
$121=200.000
$122=200.000
$130=300.000
$131=300.000
$132=300.000

Best regards


#3 – hedon77 于 2019-10-26

Hi,

My schemat. https://cloud.24box.pl/index.php/s/miGBAwqJxYicC4W


#4 – bdring 于 2019-10-26

@hedon77

I think I may have found the problem. Original Grbl only supports 8 bit PWM. 16 bit PWM is needed to accurately run Servo/ESC type PWMs. The stepper module was storing and resetting the PWM using an 8 bit value, so it was corrupting the number.

I need to do some more testing and cleanup the debugging code I added to make sure.

I don’t know when/how the problem got in. My ESC test rig takes a long time to setup, so I don’t use it very often.


#5 – bdring 于 2019-10-26

@hedon77

I pushed some fixes to the devt branch. Can you try them? I made some changes to the “CPUMAPESP32ESCSPINDLE” cpu map. If you were using that, you will need make a new one.

There is also a wiki page for the feature now.

I noticed your schematic had “ANT” in the title. Is this for an ANT PCB Maker. I would love to see some photos when you get it running.


#6 – hedon77 于 2019-10-27

Hi,

After uploading the dev repository, the Y axis motor stopped working. The spindle also does not work.

This is how I submit an “Ant”, as soon as I finish sharing a film about the action: D

best regards


#7 – bdring 于 2019-10-27

I changed the cpu map. Could that be the problem? Use the cpumap you used before. Copy the old one into cpumap.h with a new name. Change to that name in config.h

I had to change it to the hardware I use.


#8 – hedon77 于 2019-10-30

After mapping the pins, the axes work. The spindle works but still makes a sound. Is this splicing procedure necessary? Earlier operation of the spindle was simpler and more convenient for me, maybe you could do this new procedure optionally?
On the weekend I will write a video from the machine’s operation.


#9 – bdring 于 2019-10-30

What splicing? What sound? What procedure?


#10 – hedon77 于 2019-10-30

What splicing?

Turn on sequence necessary?

What sound?

The film will show, the spindle after turn on sequence makes constant sound.

What procedure?

Turn on sequence.

Sorry for my english this is not my native language.

thx best regards


#11 – bdring 于 2019-10-31

For my ESC, the turn on sequence only needs to be done once to learn the PWM range. After that you only need to wait for the ready beeps.

I don’t know what your noise is. Mine is fine. I watched a scope and the PWM is stable at all times.

!image

Are you running via battery or power supply. Power supplies might not have the peak current needed.


原始Issue: https://github.com/bdring/Grbl_Esp32/issues/266

喜欢 (0)