- Posts: 2
- Thank you received: 0
Remora - ethernet NVEM / EC300 / EC500 cnc board
- Jaragua
- Offline
- New Member
-
Less
More
7 months 2 weeks ago #344327
by Jaragua
Replied by Jaragua on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Também estou com o mesmo problema.aparentemente precisa editar o arquivo .hal no LinuxCNC. Conseguiu resolver?
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
-
Less
More
- Posts: 22011
- Thank you received: 7491
7 months 2 weeks ago #344329
by tommylight
Replied by tommylight on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Did you try to lower the jog velocity to something really slow and jog?
Please Log in or Create an account to join the conversation.
- Felsenbart
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
7 months 1 week ago #344579
by Felsenbart
Replied by Felsenbart on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
I get it to work finally. Idk what im doing wrong. After flashing newest beta its working :side:
Please Log in or Create an account to join the conversation.
- Felsenbart
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
7 months 1 week ago #344580
by Felsenbart
Replied by Felsenbart on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Which version of Remora did you flash? Luckily, it worked with the latest beta. I've attached some files that work for me. Would you also like the pinout for the DM556Y drivers for the EC500?
Please Log in or Create an account to join the conversation.
- BIBIGUL
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
6 months 1 week ago - 6 months 1 week ago #345733
by BIBIGUL
You're thinking along the right lines, and this can definitely be improved.
Interrupts break determinism and can introduce jitter into the system. The jitter might be small, but it's still there because the core has to stop processing, handle the ISR, and then resume the program.
We need to get rid of interrupts entirely for this.
Configure the timer like this:
TIM4->SMCR = (TIM_SMCR_SMS_0 | TIM_SMCR_SMS_1); // ENCODER MODE (TI1 & TI2)
TIM4->DIER = 0; // NO INTERRUPTS
TIM4->CCMR1 = (TIM_CCMR1_CC1S_0 | // (CH-A) CC1S = 01 (TI1FP1 --> TI1). CH1
TIM_CCMR1_IC1F | // F SAMPLING. CH1
TIM_CCMR1_CC2S_0 | // (CH-
CC2S = 01 (TI2FP2 --> TI2). CH2
TIM_CCMR1_IC2F); // F SAMPLING. CH2
TIM4->CCMR2 = (TIM_CCMR2_CC3S_0 | // (CH-Z) CC3S = 01 (TI2FP3 --> TI3). CH3
TIM_CCMR2_IC3F); // F SAMPLING. CH3
TIM4->CCER |= TIM_CCER_CC3E; // Capture/Compare enable CH3
TIM4->PSC = 0; // PRESCALER = 0
TIM4->ARR = 0xFFFF; // 65535
The timer will operate as an encoder counter (Channels 1 & 2) and **simultaneously** Channel 3 will be configured for **Input Capture mode**. The Index pulse (Z-channel) is connected to Channel 3.
**What do we get from this?**
* `TIM4->CNT`: The current raw encoder count.
* `TIM4->CCR3`: The **exact hardware state** of `CNT` latched at the moment of the rising or falling edge of the Index pulse.
This gives us an extremely accurate hardware snapshot of the counter at the exact moment the index pulse occurs.
**Next Steps:**
We just need to extend the communication protocol and send both `CNT` and `CCR3` for each encoder.
Then, on the **LinuxCNC side**, `CCR3` should be processed similarly to how the Mesa driver handles `CNT`.
When Motion sets `index_enable` in the driver, we simply do:
if(CCR3 != CCR3_prev) {
// HURRAY, THIS IS THE TRUE INDEX!
// Now we can correct the raw counter based on the current CCR3 value.
}
Result: We get precise index homing without needing to send an `index_enable` request down to the STM32. Everything is handled cleanly on the LinuxCNC side.
Hope that makes sense.
Replied by BIBIGUL on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Code:
"tuxcnc" I feel like when I calling Microsoft customer's support... "We dont know what is your problem, but it works with us..." I know how Linuxcnc does the threading, and know why it is acceptable with LPT and not acceptable with devices using ethernet link. LPT uses base_thread, ethernet uses servo_thread, so LPT can be ten times faster. I told you few posts ago, the servo_thread=1000000 (1 ms period) can make delay that can produce 18 degrees positon error at spindle rotates 3000 rpm. 3000 rpm => 50 rps => 20 ms per revolution. It is mathematics, everyone can make this calculations. The solution is not send the extended index in hope the Linuxcnc see it, and resets position to zero when received it. The solution is send raw_count latched at every real encoder's index edge. We can restore encoder's index (if we need) from (old != new) at the component. And we can reset position not to zero, but to real position captured at index edge. We can be confused, because we use "index" word for different meanings (encoder's output, program variable, hal pin) but we can not change this. Detailed explanation: Let's assume the encoder's index edge occurs at 1000 raw_counts. Time goes, counter counts A/B signals. The component requests data. At this moment raw_counts is 1050. We send both values, counted and latched. The component knows, the index was 50 counts ago and sets position to 50/scale not to zero. (of course only when hal index_enable pin is set) What don't you understand?
You're thinking along the right lines, and this can definitely be improved.
Interrupts break determinism and can introduce jitter into the system. The jitter might be small, but it's still there because the core has to stop processing, handle the ISR, and then resume the program.
We need to get rid of interrupts entirely for this.
Configure the timer like this:
TIM4->SMCR = (TIM_SMCR_SMS_0 | TIM_SMCR_SMS_1); // ENCODER MODE (TI1 & TI2)
TIM4->DIER = 0; // NO INTERRUPTS
TIM4->CCMR1 = (TIM_CCMR1_CC1S_0 | // (CH-A) CC1S = 01 (TI1FP1 --> TI1). CH1
TIM_CCMR1_IC1F | // F SAMPLING. CH1
TIM_CCMR1_CC2S_0 | // (CH-
TIM_CCMR1_IC2F); // F SAMPLING. CH2
TIM4->CCMR2 = (TIM_CCMR2_CC3S_0 | // (CH-Z) CC3S = 01 (TI2FP3 --> TI3). CH3
TIM_CCMR2_IC3F); // F SAMPLING. CH3
TIM4->CCER |= TIM_CCER_CC3E; // Capture/Compare enable CH3
TIM4->PSC = 0; // PRESCALER = 0
TIM4->ARR = 0xFFFF; // 65535
The timer will operate as an encoder counter (Channels 1 & 2) and **simultaneously** Channel 3 will be configured for **Input Capture mode**. The Index pulse (Z-channel) is connected to Channel 3.
**What do we get from this?**
* `TIM4->CNT`: The current raw encoder count.
* `TIM4->CCR3`: The **exact hardware state** of `CNT` latched at the moment of the rising or falling edge of the Index pulse.
This gives us an extremely accurate hardware snapshot of the counter at the exact moment the index pulse occurs.
**Next Steps:**
We just need to extend the communication protocol and send both `CNT` and `CCR3` for each encoder.
Then, on the **LinuxCNC side**, `CCR3` should be processed similarly to how the Mesa driver handles `CNT`.
When Motion sets `index_enable` in the driver, we simply do:
if(CCR3 != CCR3_prev) {
// HURRAY, THIS IS THE TRUE INDEX!
// Now we can correct the raw counter based on the current CCR3 value.
}
Result: We get precise index homing without needing to send an `index_enable` request down to the STM32. Everything is handled cleanly on the LinuxCNC side.
Hope that makes sense.
Last edit: 6 months 1 week ago by BIBIGUL.
Please Log in or Create an account to join the conversation.
- BIBIGUL
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
6 months 1 week ago #345747
by BIBIGUL
Replied by BIBIGUL on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
I have a few questions regarding the Remora ETH source code. I understand it's built on the lwIP stack.
Does lwIP significantly impact the servo cycle timing? Does it cause noticeable lag/jitter?
Has anyone attempted to implement their own custom stack with Zero-Copy support? I suspect this would yield a decent performance improvement.
How is the time domain problem solved between the PC's servo cycle and the STM32's time domain? Or does the system simply operate in a fast response mode — processing commands immediately upon arrival from the PC?
If the time domain mismatch isn't handled properly, you simply cannot achieve precise velocity and acceleration control, especially when dealing with position feedback from the encoder.
Thanks.
Does lwIP significantly impact the servo cycle timing? Does it cause noticeable lag/jitter?
Has anyone attempted to implement their own custom stack with Zero-Copy support? I suspect this would yield a decent performance improvement.
How is the time domain problem solved between the PC's servo cycle and the STM32's time domain? Or does the system simply operate in a fast response mode — processing commands immediately upon arrival from the PC?
If the time domain mismatch isn't handled properly, you simply cannot achieve precise velocity and acceleration control, especially when dealing with position feedback from the encoder.
Thanks.
Please Log in or Create an account to join the conversation.
Time to create page: 0.347 seconds