On Mon, 12 Oct 2015, Pekka Roivainen wrote: > Date: Mon, 12 Oct 2015 22:55:03 +0300 > From: Pekka Roivainen <[email protected]> > Reply-To: EMC developers <[email protected]> > To: [email protected] > Subject: [Emc-developers] Timing of realtime functions in uspace > > Hello! > > I'm building an ethernet based IO board to be used with LinuxCNC. I > wrote a short webpage about my project on www.pekka.eu/cnc > > Everything is working quite well, except for the write and read > operations being too slow. I have two functions exported to HAL, read > and write. The .time pin which is automatically exported to HAL for each > function states that the execution time of the read and write functions > are about 450000ns and 40000ns respectively. For debugging, I generated > my own pins for both functions to measure the execution time of the > function itself. I measure the execution time by calling > rtapi_get_time() in the very beginning of the function and in the end. I > calculate the difference and pass it to a HAL pin. By examining the > values of these pins, I see that the execution times according to > rtapi_get_time() are about 220000ns and 18000ns for read and write. So > it seems that the execution time stated by HAL is a bit more than double > the execution time of the function itself. The 220us execution time for > the read would be something that I'd expect from my hardware, but when > it's doubled it starts to be too much for running servo thread with 1kHz. > > Is this expected behavior? It sounds a bit strange to me, especially as > the ratio between the two measurements is quite close to two. I have > checked like million times that I don't have the functions added to the > treads twice or something other stupid things, but I cannot seem to find > anything like that. Does anyone have any hints? > > I have tested my software with Debian Wheezy, kernel 3.2.0-4-rt-686-pae > and with LinuxCNC versions 2.7.0~pre6 and 2.7.0. > > Thank you for any comments. > > Regards, > Pekka Roivainen > > > PS. This being my first post ever to this list, I want to express my > greatest gratitude to all the developers of LinuxCNC. This is a > fantastic piece of software.
Did you scale the hal times correctly? They are in CPU clocks, not ns > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Emc-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers > Peter Wallace Mesa Electronics (\__/) (='.'=) This is Bunny. Copy and paste bunny into your (")_(") signature to help him gain world domination. ------------------------------------------------------------------------------ _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
