-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems that this fork does not support STEP_PULSE_DELAY #48
Comments
Does this option not supported in the current version? |
It seems me clear that the file stepper.c has not been adapted in this STM32 version to support this functionality. Current vesion would not take care of the parameter. |
Ok. the problem is obvious. |
Ok, I hope I've done it (in native arduino GRBL style (idea) ). |
I did not test your code (no board currently available) but I checked the code. b) |
a) I will think about it. |
It is very strange to get 890ns without using STEP_PULSE_DELAY because there is only one instruction between the instruction to set the direction bits at line 484 and the instruction to set the step bits at line 503. |
in my case: |
About "a)": |
about "a)": The other way (even safier) would be to write in the SET and RESET registers provided by the STM. |
reasonably |
about 890 ns. |
thanks for the comments! New iteration in the archive. If there is an opportunity to see it, I will be very grateful. |
about the new archive, I think it should work but I have a few comments:
|
Ok! Some critical changes done, and now it's work fine. Now we use interrupt priority.
|
in st_reset you begin with Still I notice that you enable the interrupt on CC1 a few lines after the while with Does it really make sense? |
When STEP_PULSE_DELAY is not defined, I expect that you could reduce the width of the step pulse changing line If you want to get very short step delay and step width, you could add a new parameter and some lines of code in order to totally avoid TIM3 interrupt and so let stm32 generates the pulse totally in TIM2 |
st.step_pulse_time = (settings.pulse_microseconds - 1 )*TICKS_PER_MICROSECOND + 1; TIM2 interrupt takes 7us, in worst case 9us, may be in very rare cases it will take 12 or 15us, but this will not have a significant impact on the program execution time and will not lead to failure. |
I have to think. May be it used to need for debug. |
If STEP_PULSE_DELAY is activated, each SETP pulse width will be + STEP_PULSE_DELAY time, so the maximum pulse frequency will be limited? Can I add the judgment that DIR PIN starts STEP_PULSE_DELAY only when the direction changes? This means that DIR PIN is a continuous SETP pulse with the original pulse width after switching. Namely: It doesn't really matter if the delay time increases after adding judgement statements, because STEP_PORT-> ODR output pulses are executed directly when st.dir_outbits do not change. The delay time between DIR and SETP must be available. The DM556 driver manual I used shows that DIR must advance SETP by 5 microseconds to ensure that it does not lose its step. This is what I think, but I'm not very good at programming code. I hope I can make some improvements in providing this advice. In addition, can I add STEP_PULSE_DELAY setting interface, 6-axis start-stop setting interface, synchronous axis setting, configuration interface, electronic handwheel, etc. instead of pre-compiling to open and configure? Because performance and many functions can be added under STM32, unlike AVR328 resource constraints, these functional interfaces cannot be implemented. |
Normal (AVR) GRBL code supports #define STEP_PULSE_DELAY (in stepper.c)
This parameter allows to add a delay between setting the DIRECTION pins and the start of the STEP pulse in the stepper.c file.
This can be important because many stepper drivers ask for such a delay.
I would like to use some cheap clone of TB6600 drivers and I noticed that the used optocoupler on the DIR signal is much lower than the optocoupler on the STEP signal. I expect I need a delay of about 10usec to let the driver get the right direction when the pulse start.
Do you plan to support this parameter in the future?
Note: I think it could be done without using a new timer, just by using an interrupt on a compare of an existing timer.
Thanks in advance for your reply.
The text was updated successfully, but these errors were encountered: