> > Date: Mon, 12 Oct 2015 22:55:03 +0300 > > From: Pekka Roivainen <pe...@roivainen.eu> > > Reply-To: EMC developers <emc-developers@lists.sourceforge.net> > > To: emc-developers@lists.sourceforge.net > > 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
I use the STM32F407 with the hostmot2 driver. I had some glitches at startup but today I added a small delay someone here suggested end then startup works perfect every time with two cards connected. I have been running two axes with DC servo motors and ordinary encoders on one of the cards although both cards should be used to get 4 axis. I ran servo loop at 1kHz but expect somewhat faster will also work. Nicklas Karlsson ------------------------------------------------------------------------------ _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers