Michael Gilligan | 09/09/2022 15:57:50 |
![]() 23121 forum posts 1360 photos | Great stuff, Sam … that all looks very encouraging MichaelG. |
SillyOldDuffer | 10/09/2022 15:40:58 |
10668 forum posts 2415 photos | Posted by sam sokolik on 01/09/2022 18:38:22:
Posted by SillyOldDuffer on 01/09/2022 18:03:00: ... Any idea how a parallel port's performance compares with twiddling pins on a Raspberry Pi 4? What's the highest frequency a parallel pin can output... I've experimented with a Pi4 in various real-time modes to see how fast it's IO pins can be made to go and results are both good and bad. Output is quick except for awkward pauses due to the scheduler... Dave ... ...The base thread speed really depends on how well the computer can run the realtime kernel. The computer I am using in the video is a 3rd gen i5 HP. It has pretty decent latency and allows for a base thread of around 40-50 khz. I have not seen computer hardware get much higher than that with linux/linuxcnc. I have not seen much of a difference between onboard, pci and pci-e printer port cards. (other than some features are there or not depending on how it was made) I have have tested linuxcnc with gpio on the rpi 4 - the base thread I got was 20khz - but because some functionality is missing in the linuxcnc gpio driver - you can only get 10khz step pulses Sorry about the delay replying - having a busy week. I wrote this user-space code to test rPi output speed: Assuming the library is efficient, I believe the program gets close to the maximum General Purpose IO output achievable from a Pi4. About 4.0MHz, two hundred times faster than linuxCNC's 20kHz, but unlike linuxCNC my code does absolutely nothing useful! I think the scheduler and memory lock settings used have the effect of dedicating one of the 4 CPUs to my process, maximising the time between scheduler interruptions, and forbidding swapping (admittedly unlikely on a lightly loaded computer). Next oscilloscope screen shot shows the scheduler to be working in blocks of 1 second, in which my program runs for 956mS, and is paused for 44mS in every second: 44mS is too long for my taste - needs investigation. Reading is more difficult I haven't found a quick way of responding to incoming bits in user-space yet. Whilst busy flat out pin flipping the pi4 supports other activity more or less normally - the other 3 CPU cores handle business as usual and seem unaware that the 4th core is running flat out. Pretty sure the chip has ways and means of generating faster output in hardware, but that's cheating. I looked at the linuxCNC source to see how it manages real-time IO and couldn't find it. There's a lot of code! Dave |
sam sokolik | 10/09/2022 23:43:26 |
126 forum posts | Very cool! Yes - the hard part is making it deterministic... I can't say I fully understand how linuxcnc does it. It uses the rt_preempt kernel (which is now part of the Debian repository) They use the real time api to create the threads. You can isolate cores for real time - it helps but you won't get mhz thread. (at least in my experience) For machine control - most of the 'control' can be done in a relatively slow thread. (1 - 10khz) calculating the PID, Trajectory and stuff.. The faster stuff can be moved to hardware. (but again - still doable in the computer as long as 50khz works..) sam There is also an RTAI patched kernel which is still available - but requires a bit more work. It used to be that it performed better than the rt_preempt kernel but in my experience they usually have similar latency now. sam |
sam sokolik | 20/09/2022 05:01:28 |
126 forum posts | Saving a pin on the printer port using missing tooth functionality.. (to create an index pulse)
|
sam sokolik | 29/11/2022 18:11:13 |
126 forum posts | Finally scored a compact 5 turret!
Edited By sam sokolik on 29/11/2022 18:11:46 |
sam sokolik | 29/11/2022 18:13:33 |
126 forum posts | A bit of ladder for testing... |
sam sokolik | 04/12/2022 18:11:11 |
126 forum posts | an hour you won't get back...
|
Robin | 05/12/2022 11:17:11 |
![]() 678 forum posts | Happy days when you could actually take over the timer interrupt with Bill Gates blessing. I still have the original IBM PC Technical reference manual with all the circuit diagrams including the printer port. It looked suspiciously like IBM made a motherboard with active low interrupts and expansion cards with active high Rather than do a massive trip to the dump they found a weird edge-triggered interrupt and pretended that was what they always intended. Of course you only got one bite of the cherry, miss the edge and it was gone, but that was how things were and everyone muddled through bestest Robin |
sam sokolik | 07/08/2023 16:38:39 |
126 forum posts | Finally had a little time to work on this project. I got the X ball nut assembly done - it took some creative machining... |
sam sokolik | 12/08/2023 16:18:35 |
126 forum posts | +/- 10 volts out of the printer port.. |
sam sokolik | 14/09/2023 15:20:59 |
126 forum posts | Getting closer..... |
george baker 1 | 15/09/2023 22:27:39 |
39 forum posts | Hi I knew of the whereabouts one of those Emco's, from memory it was complete and in good nick. Any idea what it would be worth?
George |
Please login to post a reply.
Want the latest issue of Model Engineer or Model Engineers' Workshop? Use our magazine locator links to find your nearest stockist!
Sign up to our newsletter and get a free digital issue.
You can unsubscribe at anytime. View our privacy policy at www.mortons.co.uk/privacy
You can contact us by phone, mail or email about the magazines including becoming a contributor, submitting reader's letters or making queries about articles. You can also get in touch about this website, advertising or other general issues.
Click THIS LINK for full contact details.
For subscription issues please see THIS LINK.