On 6/10/2017 1:06 PM, Sag ich Dir nich wrote: > Hello, > > if i want to drive 5 axis with each 1 MHZ steprate, do i need to reach 5 MHZ > Stepgen or 1 MHZ?
You need to a 2 MHz base thread (or 500 nS PRU period) which will give you a 1 MHz maximum step rate (1 thread period high, one thread period low). This is very easy to do if you're using hardware, but not so easy in software. I doubt an x86 can run interrupts anywhere close to that fast, and an ARM certainly can't. The PRU on a BBB can probably be coerced into running this fast, but you'll need to optimize the code. The existing hal_pru_generic was written for flexibility more than absolute speed, and probably won't go faster than several hundred KHz step rates with 5 stepgens. To get into MHz step rates, you'll probably need to hard-code the PRU logic (instead of building a chain of "tasklets" as is done now) and keep all of the state information in registers. It should be fairly simple to do, but you still might not quite make it to a 1 MHz step rate (the 500 uS task period only gives you 100 instructions to do step/dir generation for 5 channels, or 20 instructions per channel. The step/dir code isn't super complex, but is more than 20 instructions through the worst-case path, and some of the instructions take more than 1 clock (5 nS). Getting rid of the memory accesses (required for the current "tasklet" structure) and putting everything in registers ought to get you close to the required speed. -- Charles Steinkuehler char...@steinkuehler.net -- website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit --- You received this message because you are subscribed to the Google Groups "Machinekit" group. To unsubscribe from this group and stop receiving emails from it, send an email to machinekit+unsubscr...@googlegroups.com. Visit this group at https://groups.google.com/group/machinekit. For more options, visit https://groups.google.com/d/optout.