MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.27k stars 19.23k forks source link

[FR] Input Shaping with I2S_STEPPER_STREAM #25605

Open ahmetcemturan opened 1 year ago

ahmetcemturan commented 1 year ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

If Input shapıing is enabled, the printer will home x and then y axis. Then stops responding (does not home z). Homing works fine if I send "M593 F0" before homing

Bug Timeline

It is existent in the 2.1.2 and the latest bugfix

Expected behavior

I expect it to home

Actual behavior

It stops responding during the homing routine.

Steps to Reproduce

enable input shaping and set it to a value >=1 Home the printer

Version of Marlin Firmware

2.1.2 or 2.1.bugfix

Printer model

Prusa clone (Bedslinger)

Electronics

Tinybee v3

Add-ons

Z-probe as Z-endstop

Bed Leveling

ABL Bilinear mesh

Your Slicer

Prusa Slicer

Host Software

Pronterface

Don't forget to include

Additional information & file uploads

>>> M593 F0

echo:DEBUG:ECHO,INFO,ERRORS,COMMUNICATION
echo:M105
echo:M105
echo:M105
echo:G28
echo:busy: processing
echo:busy: processing
echo:G92 E0
echo:M114
echo:M105
echo:M105
echo:M105
echo:M105
>>> M593 F22
SENDING:M593 F22
echo:M593 F22
echo:M105
echo:M105
echo:G28
echo:busy: processing
>>>>>Becomes Unresponsive....

will only respond after a reset.

Only other modification is That I have changed the ADC voltage to 2.585 as that gives correct values

Marlin.zip

ahmetcemturan commented 1 year ago

Some additional observations:

tombrazier commented 1 year ago

IS is not supported with ESP32. My naive guess is the FT is not either. We should add a sanity check.

ESP32 works around some of the core stepper logic. We really need a refactor of stepper.cpp that puts all the step generation in one place and prevents more than one step being generated per pass through the loop. Then ESP32 could be integrated with IS properly. (Not to mention baby stepping and really getting it working with LA.)

when trying to compile Marlin with SHAPINGFREQ =0, I get an error. (not a big problem as it makes basically no sense)

You could want to compile with SHAPING_FREQ_[XY]=0 so that IS defaults to disabled. That is possible if you define SHAPING_MIN_FREQ. There should be a sanity check error which tells you this.

thisiskeithb commented 1 year ago

IS is not supported with ESP32. My naive guess is the FT is not either.

I'll mark this as a feature request for I2S_STEPPER_STREAM instead.

We should add a sanity check.

Added:

cbagwell commented 1 year ago

when trying to compile Marlin with SHAPINGFREQ =0, I get an error. (not a big problem as it makes basically no sense)

You could want to compile with SHAPINGFREQ[XY]=0 so that IS defaults to disabled. That is possible if you define SHAPING_MIN_FREQ. There should be a sanity check error which tells you this.

I created #25358 to apply the related AVR sanity check to everything.

vfbank commented 1 year ago

All hardware currently using the ESP32 chipset is experiencing the same issue. This is because the ESP32 chipset communicates through the I2S Stream. Unfortunately, most EPS32s can't handle Marlin's I2S stream properly.

Therefore, the following features are currently not implemented:

1.Incompatible with INPUT_SHAPING

2.Incompatible with Babystep

3.Incompatible with FT motion

4.Incompatible with Linear Advance

And there are currently issues with inaccurate temperature sensors and layer shift issues.

The ESP32 chipset has powerful processing performance, but unfortunately, only ARM or STM32 series are mainly developed in Marlin, so it's better not to use the ESP32 chipset until a capable person comes out. The reason why this board is inexpensive is because of the above reasons, and the manufacturer will no longer update after version 2.0.9.

(There were some translation errors, so I re-edited some phrases.)

EvilGremlin commented 1 year ago

@vfbank you weren't paying attention, LA and babystep are supported now

ellensp commented 1 year ago

@vfbank Your thinking is backwards, Need more controllers using esp32 to attract esp32 developers to the project

vfbank commented 1 year ago

Unfortunately, when I activate the extension, it compiles, but Babysteps still doesn't work.

EvilGremlin commented 1 year ago

INTEGRATED_BABYSTEP still don't work on i2s? Someone send Tom TinyBee already! :laughing:

vfbank commented 1 year ago

INTEGRATED_BABYSTEP 여전히 i2에서 작동하지 않습니까? 누군가 이미 Tom TinyBee를 보냅니다! 😆

Enabling the INTEGRATED_BABYSTEPPING definition compiles but babystep doesn't work. No matter how much you turn the dial, only the value changes and the Z-axis does not move. Same goes for other features. The 2.1.2 key features listed above compile but do not actually work.

If it works, please share the video and setting file that works for me. please.

This issue has already been answered by asking the same issue in the TinyBee thread.

https://github.com/makerbase-mks/MKS-TinyBee/issues/92

Again, the problem is caused by the ESP32 chipset not properly supporting I2S streams. I2S function is not the problem. This issue should be addressed by the hardware manufacturer.

vfbank commented 1 year ago

Your thinking is backwards, Need more controllers using esp32 to attract esp32 developers to the project

For reference, the ESP32 hardware should control all communication with 32 pins. About 2-4 times less compared to ARM or STM32 processors. This causes layout configuration issues. The EPS32 chipset operates at an amazing 180Mhz speed and has Bluetooth/WIFI functions, but due to the size of the chipset, there is a problem in configuring the communication interface.

The reason I think of it negatively is that I actually tried to improve it, but eventually gave up due to a lot of limitations. Improving the features won't be easy unless you're an engineer or developer with great skills.

First of all, the Arduino core of the EPS32 chipset is still in the development stage, and there are numerous functional problems and hardware compatibility issues. The qualitative difference between ARM and STM32 chipsets and libraries with a long history is quite large.

Marlin firmware works with Arduino to maintain compatibility with AVR boards. Therefore, in order to develop EPS32, efforts of hardware developers are desperately needed. However, they are not very interested in updating the Arduino core of the EPS32 (to be precise, the ESP-IDF development tools are too slow to update). The reason is probably financial. This is very sad.

EvilGremlin commented 1 year ago

ESP32 chipset not properly supporting I2S streams

Maybe you meant framework? Though as general stepping works, problem lie in forming pulse train which is 100% marlin code. Or could it be FreeRTOS messing with interrupts somehow?

vfbank commented 1 year ago

ESP32 chipset not properly supporting I2S streams

It seems to me that the ESP32 chipset's G-code processing part is the problem. Probably a data exchange problem (not sure)

For better understanding, let's compare them in the same way as the G-code slicing program.

Let's assume that the existing pure G-code (original source via SD card or USB) is modified with the desired function through post-processing.

I need to intercept the original data (sorry English is not my native language, so I don't know how the translation will work) and replace that part with new G-code to get what I want. However, this part doesn't seem to work properly due to some problem.

So, while the existing data is being processed, it seems that all related functions do not work because it cannot be changed in the part where it is to be changed by modulating it with other data.

This is speculative, so it may not be correct. So I can't give you any good advice on this matter. sorry.

*Once this issue is resolved, there will be many 3D printer motherboards using the ESP32 chipset.

tombrazier commented 1 year ago

INTEGRATED_BABYSTEP still don't work on i2s? Someone send Tom TinyBee already!

First I have some X axis improvements to make on my printer so I can print a 15ish minute benchy on 8 bit and 12V just to showcase how awesome Marlin is.

Then I need to finish fixing my coffee machine and make a very niche youtube video for anyone else wanting to to do the same fix.

And I want to get on with my variation on rq3's TAP-XXX bed sensor.

Then it would be really great to look into why bugfix is still causing stepper issues for some users.

And there's a weird E stepper thing that might be related to a backlash correction bug.

And some memory improvements I've had in mind for ages.

And smooth multistepping.

And I've started contributing to another github project for head tracking for simulators.

And I really should look over the FT stuff.

And having a life.

How did I get in so deep? :open_mouth:

EvilGremlin commented 1 year ago

At least you deserve some new shiny toys :stuck_out_tongue:

thinkyhead commented 1 year ago

First I have some X axis improvements to make on my printer so I can print a 15ish minute benchy on 8 bit and 12V just to showcase how awesome Marlin is.

I'll be very happy to post a video of that to Twitter to steal a little of the limelight from Prusa who are arriving late to this party but getting all the jellybeans.

tombrazier commented 1 year ago

Great, thanks Scott. I'll let you know.