- Posts: 19311
- Thank you received: 4655
I need to look at your code, but it seems to me that there could be some savings to be made here. I think that 1uS steps are faster than necessary, though I am not sure if you are trying to compete with FPGA step rates or software step rates. A 10uS clock (10uS on, 10uS off on the step pin) gives you 1000rpm at 16x microstepping.mungkie wrote: Rough outline of maths, the step pattern buffer must be 4000us and the pulse width can be anything down to 1us but there could be large memory requirements as each step requires 168bytes (1us steps would be 4000*168bytes of DMA buffer)
It is a userspace module, so it gets loaded and just runs through a polling loop when the OS gives it some CPU, just like any other software, and the GUIs.I say as an example 'iocontrol.0.user-enable-out iocontrol.0.emc-enable-in' which are used in .hal file but 'iocontrol' do not seem to have an addf hook also same with 'axis'.
Please Log in or Create an account to join the conversation.
andypugh wrote: I need to look at your code, but it seems to me that there could be some savings to be made here. I think that 1uS steps are faster than necessary, though I am not sure if you are trying to compete with FPGA step rates or software step rates. A 10uS clock (10uS on, 10uS off on the step pin) gives you 1000rpm at 16x microstepping.
The approach of filling a buffer with steps (basically pre-computing a base thread) allows you to dither the rate, so you may get some smoothness benefit over a typical base-thread stepgen. (note, I am not sure that the LinuxCNC stepgen doesn't already do this).
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
F-errors are produced if the feedback from the stepgen (where it reports it has got to) doesn't match the commanded position within a tolerance.mungkie wrote: I load the driver in axis and get joint follow errors ( I had assumed this was because update_pos was giving incorrect position values), after a little playing with the .hal and .ini files I find that changing FERROR and FERROR_MIN has no effect, eventually I find that the problem is that base-thread period is too high (I set it to the same as servo thread to reduce system load), it seems follow errors are only flagged if the base-thread is too long to generate enough pulses??.
That does seem to be all that it does, yes. update_frequency computes the required step frequency for the next servo thread. update_pos seems pointless, largely.So I now wonder what is the update_pos function in stepgen used for (I assumed it gave position feeback to hal so that follow errors did not occur even though steppers are open loop), is this correct?????.
PWMgen does, debounce can. Charge_pump, freqgen. I think serport can, clearly the parallel port driver has to, otherwise there is no point the stepgen being there.Next I wonder what other functions run in base-thread I assumed that almost everything ran in servo-thread except stepgen???
I don't know anything at all about RT_PREEMPT, but if it keeps the servo-thread part of your code "realtime enough" that it always gets called in time to fill the buffer, and if the buffer is toggled out by hardware, then I don't see any problems with your approach. The second "If" is the big one, is the buffer transfer to the pins running in something deterministic?And then a thought hit me that my request for testing of the code I posted on the forum could well be stupid as I am running it on RT_PREEMPT in X windows which could well totally change the performance and any conflicting interupts or DMA usage
I am not sue that there are even any docs like that for brainiacs. Have you seen www.linuxcnc.org/docs/EMC2_Developer_Manual.pdf ?I am really a newbie as far as linuxcnc development, are there any easy to understand idiots guide type docs for how the whole linuxcnc system works together???
As I said earlier, lots of things _can_ run in the base thread, but few need to.If there is nothing else that uses base-thread other than stegen then I probably will continue.
If it is an SD card image, then I can do that easily.If I hack together a linuxcnc distro can anyone try it and give some test results feedback ideally with calibrated equipment.
Please Log in or Create an account to join the conversation.
mungkie wrote: If I hack together a linuxcnc distro can anyone try it and give some test results feedback ideally with calibrated equipment.
Hope this is not too disordered, I apologise if I am talking nonsense I could be having a bad day and not realise it, maybe next time I look at the code it may work better.
Please Log in or Create an account to join the conversation.
andypugh wrote:
I am not sue that there are even any docs like that for brainiacs. Have you seen www.linuxcnc.org/docs/EMC2_Developer_Manual.pdf ?mungkie wrote: I am really a newbie as far as linuxcnc development, are there any easy to understand idiots guide type docs for how the whole linuxcnc system works together???
As I said earlier, lots of things _can_ run in the base thread, but few need to.If there is nothing else that uses base-thread other than stegen then I probably will continue.
If it is an SD card image, then I can do that easily.If I hack together a linuxcnc distro can anyone try it and give some test results feedback ideally with calibrated equipment.
Please Log in or Create an account to join the conversation.