-
Notifications
You must be signed in to change notification settings - Fork 22
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
Maximum frequency 375 kHz. #87
Comments
To be sure: you are talking about the If it is the If it is the
Can you share me your HAL-file or HAL commands you used to generate your data? |
Is it possible to remove the frequency limit? |
Please clarify exactly what does not work.
From our conversation in a local telegram group I assume that you cannot
set maximum velocity over than that produces specified output frequency
because it causes "following error"
вт, 20 февр. 2024 г., 15:28 lex27087 ***@***.***>:
… at 40 MHz
more than 306 kHz
does not work.
staplen 200ns
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABP7HCCIY3ZT45OIGDXJADTYUR3D3AVCNFSM6AAAAABDQYNQXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJTHEYTAMJYGQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Just to acknowledge: the combination of You have also found a bug: the maximum frequency of the FPGA is not taken into account in the driver. So it is possible to push the FPGA harder then it can count from LinuxCNC. This will cause all kind of issues on its own and thus lead to a possible Joint following error. EDIT: Still has to check why at 306 kHz an error occurs. These are frequencies beyond my equipment. |
Thank you very much) |
when I tested - the limit is set to 312500kHz(1/3200E-9) for 40MHz clock and 390625(1/2560E-9)kHz for 50MHz clock. |
@Peter-van-Tol |
When using 40 MHz, overflow in the speed register occurs. Sending a value of 0 to the FPGA. The FPGA uses fixed point math. To determine the location of the decimal point, a value Which version of LitexCNC are you using? In the current version ( |
@Peter-van-Tol |
Changing this bug will lead to a required recompilation of the firmware. Otherwise re-installing the driver will cause the stepper to move too slow with respect to the commanded speed if user do update the driver, but not their firmware. Therefore, changing this will be done in the upcoming version 1.3.0. This release is estimated to be available beginning of March. As an intermediate solution I'm going to cap the frequency on the driver side. Such an error may lead to dangerous situations, how unlikely they are to happen. Capping the frequency is driver side only, so can be safely done. I'll can test this on my own setup. Proposed solution:
|
compilation is not a problem. |
Will make a new version you can test. As soon as finished, I give instructions on how to install. When testing is OK, the branch will be merged and released as 1.3.0. With some luck, you can test tomorrow. |
Thank you very much. |
The maximum frequency is now correctly reported in the HAL. The maximum frequency is determined based on the config on the FPGA. Could you please test whether you can achieve higher speeds with this modification? To install this version: pip install git+https://github.com/Peter-van-Tol/LiteX-CNC/issues/87@87-maximum-frequency-375-khz
sudo env "PATH=$PATH" litexcnc install_driver You have to recompile your firmware and upload it to the card. |
@Peter-van-Tol |
@Peter-van-Tol |
In the config there are two parameters:
The actual frequency depends on the FPGA clock and the scaling. For example: when using a 50 Mhz clock and 400 kHz max frequency, the scale factor is 2^5 and the actual maximum frequency is 790 kHz. If you want to obtain a specific frequency, you should set the I will add a snippet with an example configuration later. |
@Peter-van-Tol |
Just committed some more code:
The changed module does compile and run my machine. @lex27087 : could you do some more high speed testing. If the system is working, then I will merge this into |
An example of a stepgen which supports 800 kHz stepping: {
"module_type": "stepgen",
"instances": [
{
"pins" : {
"stepgen_type": "step_dir",
"step_pin": "j1:1",
"dir_pin": "j1:2"
},
"max_frequency": 800000
"soft_stop": true
},
...
} |
@Peter-van-Tol |
@Peter-van-Tol
|
I checked commit 35d5607 At a higher frequency, you need to select timings more carefully. Although there are some problems... here it seems bool and not float? is max_frequency always a multiple of clock_frequency? Then I tried timings individual per stepgen instances, but this commit broke step generation) |
@Peter-van-Tol |
I think that the modification for the max frequency has been succesful. Thanks for testing. The edges are definitely due to the electric system. Reminds me of my old BOB called @hmnijp : still some work to do to get the individual timings correct. Will look into that! To answer your question: the clock frequency is always a multiple of the max frequency, because the max frequency is calculated with:
The shift is determined so overflow of the velocity command, as sent to the FPGA, will not overflow. With 40 MHz clock frequency and a desired 400 kHz step frequency the The practical step frequency is also limited by the
My setup uses a drive with 5000 ns timing for both |
@Peter-van-Tol |
I and another friend have an idea for a simple lathe spindle but with servo step-dir and c-axis mode. (10000ppr) Previously I thought that this was a hardware limitation of 400e3 hz. The ability to switch analog spindle/step-dir c-axis, or use a mesa 7i92 was suggested, but now I think the 5a-75 can handle this only in step-dir mode. This will be an interesting challenge) Also, many servos, together with position feedback, require a high frequency. It will never be superfluous. |
I just added a commit to this branch which solves the error of the broken stepgen when individual timings are applied. The stepper here was nicely spinning... @hmnijp : if you can verify that it is also working in your setup, then this issue can be closed and merged into |
no prob, I can check it little later ) |
Hello Peter. I tried to compile the firmware from the latest commit and configured the ini with different timings. gateware has new csr registers, but I still don’t see steps on all channels. The driver also transmits the position and receives feedback, but only Dir changes on the pins... Later I tried to reduce the number of stepgens to 4 pieces and remove the remaining modules. This led to the board not being detected via ethernet. |
Thank you. Back to the drawing board it is |
Dear friend, you have done a great job.
Thank you for that.
I would really like to know why it is possible to generate the maximum 375 kHz?
And this is at a FPga frequency of 50 MHz.
I tried to set the maximum frequency to 55 MHz - 200 kHz.
60 MHz - 200 kHz
70MHz -200KHz
80MHz - 306 kHz
100 MHz - 200 kHz.
I would really like to know what the limitation is?
Thank you.
The text was updated successfully, but these errors were encountered: