XMOS cape for real time task instead of PRU?

04 Feb 2014 01:08 #43502 by boeserbaer
HI all,

I am new to this, so I hope I am not way off. I just got my, new to me, RF-30 clone cleaned up and working (manually) this weekend. I am planning to install a very simple CNC system using the existing lead screws, and a timing belt/pulley to the stepper motors (ALA John Knoll's you tube example). And yes, I do know that this is about the worst possible MILL to CNC (mine only has a 12" x 4" by 4" work area) , but it was given to me, and seems like a good place to dive in.

Since It looks like using the BBB PRU from a programming perspective is not completely straight forward, I wondered if there is a clear place in the code base that I could replace the PRU functionality with a SPI interface to a cape mounted XMOS controller. I have used the XMOS chips on other projects, and really like the thread (they are multi-core) communications, and the speed (125 MIPS per thread, 4 threads per core).

Where to start looking at how the BBB PRU communicates with LINUXCNC would be a starting place I think.

Can anyone comment on having been down this path already, or offer opinions on its merits?

If I proceed, I will make the design/gerbers available for others. I will also have follow on questions about motor drivers.

Best Regards, Mike
11 Feb 2014 02:32 #43717 by tinkerer
Hi boeser Baer,

I've made a 1st version of a spi-driver for the pluto-fpga board for raspi and bbb. The raspi driver works well but I have problems with the bbb driver due to the very bad spidev module in the machinekit (linux). I'm working on a direct mcspi driver.
And I'm interested in a xmos version since I've one. :)

Regards, Matsche
11 Feb 2014 03:42 #43721 by boeserbaer
Hi Matsche,

I would be interested in collaborating on getting a XMOS to either BBB or raspi solution working. For our medical imaging motion control that I do as part of my day job, I use an FPGA to control the steppers in tight coordination with the imager data. I malso spent alost a year working on XMOS projects for an x-ray controller (different job).

I have been watching the machine kit project, but have not dug into the code at all. What I do know is that it would be somewhat trivial to have the xmos take the motion profile, and have separate threads per axis, each calculating the position and updating the step/dir pins.

Are you familiar with the "stepper" thread (25us thread), and what is being done there? How does the "servo" or 1ms thread communicate with it?

The first obvious task would be a communication library.

What is your opinion of the merits of raspi vs bbb? I personally prefer bbb for its open source nature (dislike marvell and broadcom because of difficulty for small developers). That said, it sounds like maybe raspi would be better as a display/servo thread than bbb?

Best Regards, Mike
11 Feb 2014 05:55 #43726 by tinkerer
Hi Mike,

here is my source:


Maybe you can implement the functionality of the verilog files to the xmos chips.
If there are any issues with the files please give me a shout.
Have fun! :whistle:

BR, Matsche
Time to create page: 0.116 seconds
Powered by Kunena Forum