bdring / Grbl_Esp32

A port of Grbl CNC Firmware for ESP32
GNU General Public License v3.0
1.66k stars 525 forks source link

Problem command X and Y axis Polar Coaster V2 #928

Open Project3334 opened 3 years ago

Project3334 commented 3 years ago

We have a problem to control the Polar coaster v2.

The X axis works, but if we give a command to the Y axis it doesn't work. Also the Z axis from the servo motor isn't working.

First we changed the motors of the X and Y to check if the problem was in the motor of the Y axis. After that we changed the Stepper driver drv8825. This wasn't the problem either.

If we give a command to the Y axis the X axis receives a command and starts rotating.

The post about the inverse kinematics we already read and added/changed the part in both files. We already measured with an oscilloscope and removed the stepper driver of the Y axis to check if the problem is into the software or maybe a hardware problem. The X axis still receives commands when the Y axis gets a command.

@MitchBradley @bdring Hopefully you can help us or someone else over here.

EsserPrototyping commented 3 years ago

Hi, maybe this is the same problem I found.. (also a polar coaster, but I don´t think it´s related to polar only).

If you are using I2S and

define I2S_OUT_NUM_BITS 16 and

define DEFAULT_STEPPER ST_I2S_STREAM

You´ll get wrong pulsing for (at least) DIR and the wrong motor moving. (On my oscilloscope it looks like the update of the shift registers is not performed right).

However when I #define DEFAULT_STEPPER ST_I2S_STATIC and 16 bits, it´s working fine. If you´re not using 16 bits, it should work fine too, but I don´t tested it.

Project3334 commented 2 years ago

Hi @EsserPrototyping

in which file did you changed this? We found more files where the keyword i2s_static is written when we use cntrl+F to search in the GRBL_ESP32 map. In a few documents the #define DEFAULT_STEPPER ST_I2S_STATIC is already implemented, but disabled by //.

To summarize and please correct me if I'm wrong: We only have to define:

define I2S_OUT_NUM_BITS 16

define DEFAULT_STEPPER ST_I2S_STATIC (enable)

and disable:

define DEFAULT_STEPPER ST_I2S_STREAM

or is #define DEFAULT_STEPPER ST_I2S_STATIC the only part that should be enabled?

EsserPrototyping commented 2 years ago

First, it only applies if you´re using I2S. If not, i don´t think this will help. If so.. are you using only two shift registers? If yes you should only need 16 bits. But 32 bit should run fine out of the box, if i´m right. What i mean is, that the combination of 16bit and STREAM seems to be broken. It worked for me by just putting

define I2S_OUT_NUM_BITS 16

define DEFAULT_STEPPER ST_I2S_STATIC

in my configuration. To give a little hint on that.. when i checked it with my oscilloscope, i could see that the DIR output of the reigsters was not asserted at the right times (for example it only updated the DIR pin when i moved another axis).