Remora - ethernet NVEM / EC300 / EC500 cnc board
- rbobey1989
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 27
11 Oct 2023 21:41 #282775
by rbobey1989
Replied by rbobey1989 on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Well guys, good news from what I have been able to test, the glitch filter works wonderfully, it filters very efficiently, but it does need adjustment according to the frequencies of channels A, B and Index and the frequency of the expected noise, these were the notes from the manual References that did the job:
• The Input Filter Sample Period (FILT_PER) should be set so that the sampling period is larger than the period of the expected noise. Doing this means that a noise spike will only corrupt one sample.
• The Input Filter Sample Count (FILT_CNT) should be chosen to reduce the probability of noisy samples causing an incorrect transition to be recognized. The probability of an incorrect transition is defined as the probability of an incorrect sample raised to the power of FILT_CNT+3.
I have left these two parameters configurable in the configuration file.
Right now the module instance in the configuration file looks like this:
{
"Thread": "Base",
"Type": "QDC",
"Comment": "QDC Encoder A-IN11 B-IN12 I-IN14",
"PV": 1,
"Data Bit": 17.
"ChA Pin": "P4_00",
"ChB Pin": "P3_23",
"Index Pin": "P4_15",
"ENC No": 2,
"Filter PER": 10,
"Filter CNT": 4
},
I also have to say that my EC300 has come back to life (the white press button, haha) I pressed it for a few more seconds and bang, new EC300!!!!, so I can test the QDC module also on the EC300.
I'm going to make some commits to update changes, Github Repo , greetings.
• The Input Filter Sample Period (FILT_PER) should be set so that the sampling period is larger than the period of the expected noise. Doing this means that a noise spike will only corrupt one sample.
• The Input Filter Sample Count (FILT_CNT) should be chosen to reduce the probability of noisy samples causing an incorrect transition to be recognized. The probability of an incorrect transition is defined as the probability of an incorrect sample raised to the power of FILT_CNT+3.
I have left these two parameters configurable in the configuration file.
Right now the module instance in the configuration file looks like this:
{
"Thread": "Base",
"Type": "QDC",
"Comment": "QDC Encoder A-IN11 B-IN12 I-IN14",
"PV": 1,
"Data Bit": 17.
"ChA Pin": "P4_00",
"ChB Pin": "P3_23",
"Index Pin": "P4_15",
"ENC No": 2,
"Filter PER": 10,
"Filter CNT": 4
},
I also have to say that my EC300 has come back to life (the white press button, haha) I pressed it for a few more seconds and bang, new EC300!!!!, so I can test the QDC module also on the EC300.
I'm going to make some commits to update changes, Github Repo , greetings.
The following user(s) said Thank You: tommylight, scotta
Please Log in or Create an account to join the conversation.
- rbobey1989
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 27
12 Oct 2023 02:09 #282789
by rbobey1989
Replied by rbobey1989 on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Hello Scott, how can I read the board field from the configuration file to use it in the implementation of the Qdc module, I have tried some ideas but I can't read it, thanks in advance
Please Log in or Create an account to join the conversation.
12 Oct 2023 03:55 #282796
by GeramyL
Replied by GeramyL on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
I dont believe we have FF2 in the algorithm inside remora, unless FF2 is a linuxcnc variable and not remora specific? Remora Hal only has PGAIN and FF1 GAIN I believe not FF2, maybe i can look at that.If the step generator works like the Mesa step generator
(basically a velocity command servo loop), you can compensate
for the time between position read and new velocity write
with the PID loops FF2 term (you set it to the time between
read and write in seconds, so if you have 100 usec between
read and write, you set FF2 to 0.0001)
Please Log in or Create an account to join the conversation.
12 Oct 2023 06:53 - 12 Oct 2023 07:57 #282800
by BrysonW
Replied by BrysonW on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Hello, I'm hoping I can get some help here. I'm beyond frustrated at this point trying to get my board flashed, Ive been at this for 8 hours at this point and am about to give up, a hammer to this ec500 I've got sitting here may be the best solution at this point. I'm pretty sure I got my st link flashed using the CMSIS-DAP file from the repository. But it seems no matter what I do I cannot get the pyocd command to flash the board I keep getting the Message, Import Error: No module named abc. I know its referring to the collections library but have no idea how to fix it to move forward. Google doesn't seem to have any idea either, other than its a default library that comes with python that seems to be missing something. The computer I'm working on has a fresh install of linuxcnc on it, and this is the only linux machine I've got to work with here at home. I've also tried doing all of this using my windows laptop thinking that may help. Haven't gotten any further there, can't get the pyocd command to work on the command line there. Im sure something is missing from the PATH variable on that machine. There again trying to find anything useful online hasn't been much help. I think I'm missing something simple. I think I may have finally gotten it. Downgrading the python version on the windows machine seemed to work.
Last edit: 12 Oct 2023 07:57 by BrysonW.
Please Log in or Create an account to join the conversation.
12 Oct 2023 12:34 #282813
by chrstrvs
I did a quick search for LinuxCNC PID, and there are a lot of parameters to use, but I would guess that not all are used. Do you, or anyone else, happen to have a small demo of what it would look like if I were to implement it?
You wrote something about disabling background services in Debian. Could you elaborate? I'm pretty much completely new when it comes to Linux, so I wouldn't know what services to disable, or how to disable them.
I will also give a go at installing Debian 12 and the latest realtime kernel if I can figure out how to install it. So far I've been relying on other people's step-by-step guides on this forum.
Replied by chrstrvs on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Thanks a lot for your explanation! I knew LinuxCNC wouldn't be easy, but this is just something else...
Hey, Scott (or any volunteer)!
Have you had the time to look at my config files that are causing the following errors? I use the remora-nvem-basic config from github.com/scottalford75/Remora-NVEM/tree/main/LinuxCNC, also attached to this message.
Hi, I've had a look at your config files and they are identical to mine, and I can run with a 1000% feed override without following errors....
Now I'm really scratching my head to understand what could be going on. Do you have the serial debug output connected? It would be interesting to see if there are any issues on the board.
Let me explain exactly what I have done. Maybe you can spot something that I've done wrong.
- Full chip erase on NVEM using STM32 ST-LINK Utility
- Flash NVEM with Remora-NVEM-STM32-1.0.0.bin from github.com/scottalford75/Remora-NVEM/tree/main/Firmware using STM32 ST-LINK Utility
- Install Raspberry Pi OS (Legacy) 32 bit
- Install LinuxCNC and realtime Kernel according to forum.linuxcnc.org/9-installing-linuxcnc...n-raspberry-pi-3b-pi
- Copy github.com/scottalford75/Remora-NVEM/tre...es/remora-nvem-basic to /home/pi/linuxcnc/configs
- Copy github.com/scottalford75/Remora-NVEM/tre...Components/Remora-nv to /home/pi/linuxcnc/components
- Install remora-nv component using[/code][/code]sudo halcompile --install remora-nv.c - Install pyocd using [code]pip3 install pyocd - Write config to NVEM using [code]python3 upload_config.py config.txt And that's it I think. Can you spot anything I might have done wrong? I do not have the serial debug output connected, but I can do that if there is a guide I can follow. Do you happen to have one? [img]/media/kunena/emoticons/smile.png[/img]
[/code][/code][/url][/code][/code][/code][code][code][url=https://github.com/scottalford75/Remora-NVEM/tree/main/LinuxCNC/Components/Remora-nv][code][code][code]Ping response times are longer than I'm getting though, averaging around 0.17ms. Do you have a router in between the NVEM and computer? No router. 2 meter cable directly from the Pi to the NVEM. Is the response time high enough to cause these errors you think? As the response time becomes worse it changes the amount of pre-anticipation the linuxcnc software has to take in the algorithm hence PGain in order to make up for it. High ping time can cause ferror, but also can not having enough response time from the cpu on linuxcnc itself. I highly recommend you make sure your linuxcnc setup is correct and your following all recommendations by linuxcnc, also older kernels are slower and have worse response time in the real time kernel, so if linuxcnc has a timer thats supposed to go off every 1ms and the raspberrypi cpu timer goes off at 1.1ms and then the response time on the board is 0.3ms or up to 0.6ms now you are 1.13 to 1.16ms out of sync.
I did a quick search for LinuxCNC PID, and there are a lot of parameters to use, but I would guess that not all are used. Do you, or anyone else, happen to have a small demo of what it would look like if I were to implement it?
You wrote something about disabling background services in Debian. Could you elaborate? I'm pretty much completely new when it comes to Linux, so I wouldn't know what services to disable, or how to disable them.
I will also give a go at installing Debian 12 and the latest realtime kernel if I can figure out how to install it. So far I've been relying on other people's step-by-step guides on this forum.
Please Log in or Create an account to join the conversation.
- rbobey1989
- Offline
- Premium Member
Less
More
- Posts: 105
- Thank you received: 27
12 Oct 2023 12:57 #282818
by rbobey1989
Replied by rbobey1989 on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
well after some tests, I was looking at some examples from the ArduinoJson6 library and I found the solution, I was making a mistake (pointers issue), I declared an extern const char* board in extern.h and then I redefined it in remora-rt1052 .cpp, I have also defined a function getBoardType() where I initialize the variable board = doc[Board]; and since it is declared in extern.h as extern we access from Qdc.cpp, I have also added the pins for the EC300 and a simple answer for the problem of not entering the correct pins for multiplexing. Greetings to all
Please Log in or Create an account to join the conversation.
12 Oct 2023 19:33 #282828
by scotta
It should be as simple as
The Raspberry Pi Pico Probe has shown to the easiest out of the box solution for flashing.
Replied by scotta on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
I use my windows machine for flashing and development work. So it is possible to get it working, but as you said this looks to be a python issue. I'd check to see which pythong version etc.Hello, I'm hoping I can get some help here. I'm beyond frustrated at this point trying to get my board flashed, Ive been at this for 8 hours at this point and am about to give up, a hammer to this ec500 I've got sitting here may be the best solution at this point. I'm pretty sure I got my st link flashed using the CMSIS-DAP file from the repository. But it seems no matter what I do I cannot get the pyocd command to flash the board I keep getting the Message, Import Error: No module named abc. I know its referring to the collections library but have no idea how to fix it to move forward. Google doesn't seem to have any idea either, other than its a default library that comes with python that seems to be missing something. The computer I'm working on has a fresh install of linuxcnc on it, and this is the only linux machine I've got to work with here at home. I've also tried doing all of this using my windows laptop thinking that may help. Haven't gotten any further there, can't get the pyocd command to work on the command line there. Im sure something is missing from the PATH variable on that machine. There again trying to find anything useful online hasn't been much help. I think I'm missing something simple. I think I may have finally gotten it. Downgrading the python version on the windows machine seemed to work.
It should be as simple as
python -m pip install -U pyocd
pyocd flash .\remora-rt1052.axf --target mimxrt1050_quadspi
The Raspberry Pi Pico Probe has shown to the easiest out of the box solution for flashing.
The following user(s) said Thank You: BrysonW
Please Log in or Create an account to join the conversation.
12 Oct 2023 19:34 #282829
by scotta
Replied by scotta on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
A super super big thanks for your work on this! Just got notice that my encoder should arrive by Monday. Looking forward to testing and merging this great work into the main branch.well after some tests, I was looking at some examples from the ArduinoJson6 library and I found the solution, I was making a mistake (pointers issue), I declared an extern const char* board in extern.h and then I redefined it in remora-rt1052 .cpp, I have also defined a function getBoardType() where I initialize the variable board = doc[Board]; and since it is declared in extern.h as extern we access from Qdc.cpp, I have also added the pins for the EC300 and a simple answer for the problem of not entering the correct pins for multiplexing. Greetings to all
Please Log in or Create an account to join the conversation.
12 Oct 2023 21:03 - 13 Oct 2023 03:37 #282832
by BrysonW
Replied by BrysonW on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
Thank you, that's what it ended up being. I had to install python 3.9, instead of the latest version. I don't do much with python too often. This has been a very educational journey so far for sure. I was at my wits end and about ready to give up. As of right now the board appears to start up and I can ping it. The ping times aren't that great, but I'll deal with that later. Now I'm on to getting the LinuxCNC side of things set up to see if it'll communicate with it.
Update, I'll edit this post instead of creating a new one:
Now that the board is flashed I've moved on to trying to get remora working with linuxcnc. I am running this on a pc, not a rpi and that may be the bulk of my issues, not sure, but an older pc is cheaper to use that a rpi at this point in time. This is trying to get a ec500 to run, which I'm assuming remora-rt1052.c is the correct file to be using. But cannot get that to compile using halcompile, it immediately gives me an error that it cant find pin_mux.h . I was able to get remora-eth.c to compile, but using that linuxcnc fails to start giving me "bcm2835_init: gpio mmap failed: Operation not permitted". Which I see that that is the broadcom chip thats in a rpi, which I don't have so of course it failed. I saw in one of your videos you had this running on a laptop, just trying to figure out what I'm missing here. Is there a path variable for the compiler that I need to put somewhere?
Update, I'll edit this post instead of creating a new one:
Now that the board is flashed I've moved on to trying to get remora working with linuxcnc. I am running this on a pc, not a rpi and that may be the bulk of my issues, not sure, but an older pc is cheaper to use that a rpi at this point in time. This is trying to get a ec500 to run, which I'm assuming remora-rt1052.c is the correct file to be using. But cannot get that to compile using halcompile, it immediately gives me an error that it cant find pin_mux.h . I was able to get remora-eth.c to compile, but using that linuxcnc fails to start giving me "bcm2835_init: gpio mmap failed: Operation not permitted". Which I see that that is the broadcom chip thats in a rpi, which I don't have so of course it failed. I saw in one of your videos you had this running on a laptop, just trying to figure out what I'm missing here. Is there a path variable for the compiler that I need to put somewhere?
Last edit: 13 Oct 2023 03:37 by BrysonW.
The following user(s) said Thank You: scotta
Please Log in or Create an account to join the conversation.
13 Oct 2023 03:41 #282864
by GeramyL
if you are using a desktop or laptop that uses a Intel chipset for the Ethernet controller you will need to most likely do some tuning to it in order for the ping times to be lower. I have a rt chipset for my Ethernet which works great without mods. You will also find better performance with the newest LinuxCNC compiled real time kernel and Debian 12. There are a bunch of tips all over LinuxCNC to get it to work better. Link to newest kernel for Debian 12 drive.google.com/drive/folders/1NzQIHnf9...chOOxaER?usp=sharing
link to LinuxCNC newer install guide
linuxcnc.org/docs/devel/html/getting-sta...etting-linuxcnc.html
I recommend Debian 12 and installing LinuxCNC 2.9 so you can get latest GUI and all the other nice things. I believe you may also have better results by disabling hyper threading if you have that. I would test with and without. You can also test switching the isolcpu from one core to another until your latency tests are better, sometimes some cores produce better results than others and you only need one core for LinuxCNC not two because the motion controller is essentially the servo thread. That should help make networking faster and GUI and probably a lot more.
Replied by GeramyL on topic Remora - ethernet NVEM / EC300 / EC500 cnc board
You will need to use remora-nv.c which is the newest and the one I use. github.com/scottalford75/Remora-NVEM/tre...Components/Remora-nvThank you, that's what it ended up being. I had to install python 3.9, instead of the latest version. I don't do much with python too often. This has been a very educational journey so far for sure. I was at my wits end and about ready to give up. As of right now the board appears to start up and I can ping it. The ping times aren't that great, but I'll deal with that later. Now I'm on to getting the LinuxCNC side of things set up to see if it'll communicate with it.
Update, I'll edit this post instead of creating a new one:
Now that the board is flashed I've moved on to trying to get remora working with linuxcnc. I am running this on a pc, not a rpi and that may be the bulk of my issues, not sure, but an older pc is cheaper to use that a rpi at this point in time. This is trying to get a ec500 to run, which I'm assuming remora-rt1052.c is the correct file to be using. But cannot get that to compile using halcompile, it immediately gives me an error that it cant find pin_mux.h . I was able to get remora-eth.c to compile, but using that linuxcnc fails to start giving me "bcm2835_init: gpio mmap failed: Operation not permitted". Which I see that that is the broadcom chip thats in a rpi, which I don't have so of course it failed. I saw in one of your videos you had this running on a laptop, just trying to figure out what I'm missing here.
if you are using a desktop or laptop that uses a Intel chipset for the Ethernet controller you will need to most likely do some tuning to it in order for the ping times to be lower. I have a rt chipset for my Ethernet which works great without mods. You will also find better performance with the newest LinuxCNC compiled real time kernel and Debian 12. There are a bunch of tips all over LinuxCNC to get it to work better. Link to newest kernel for Debian 12 drive.google.com/drive/folders/1NzQIHnf9...chOOxaER?usp=sharing
link to LinuxCNC newer install guide
linuxcnc.org/docs/devel/html/getting-sta...etting-linuxcnc.html
I recommend Debian 12 and installing LinuxCNC 2.9 so you can get latest GUI and all the other nice things. I believe you may also have better results by disabling hyper threading if you have that. I would test with and without. You can also test switching the isolcpu from one core to another until your latency tests are better, sometimes some cores produce better results than others and you only need one core for LinuxCNC not two because the motion controller is essentially the servo thread. That should help make networking faster and GUI and probably a lot more.
The following user(s) said Thank You: BrysonW
Please Log in or Create an account to join the conversation.
Time to create page: 0.325 seconds