EMC2 running on Raspberry Pi?

More
16 Feb 2013 13:50 #30179 by mhaberler
Replied by mhaberler on topic EMC2 running on Raspberry Pi?

This is the rtos-integration-preview3 branch git code; this is all your work :). The only addition I made is the hal spi driver for the PIC32 board. I will post the code once I am done with the cleanups.


well, I'm very interested to see how you did that; if only to help others going for similar ventures.

Regarding miniemc2, I have only taken the web-interface and made it run on the latest code. It's a bit of a kludge, the author made some changes to shcom.cc, and I'm not sure if it is the "right" way of doing it.


I think linuxcnc would profit from becoming a tad more web-friendly, and if we have at least a branch, if not merged, with a way demonstrating how this can be done it would be of value to others.

regards,

Michael

Please Log in or Create an account to join the conversation.

More
16 Feb 2013 14:19 #30180 by kinsa
Replied by kinsa on topic EMC2 running on Raspberry Pi?
I've asked for permission and got a reply from the author of miniemc2, so I'll post what I did on the wiki.

Please Log in or Create an account to join the conversation.

More
16 Feb 2013 14:28 #30181 by mhaberler
Replied by mhaberler on topic EMC2 running on Raspberry Pi?
excellent!

- Michael

Please Log in or Create an account to join the conversation.

More
18 Feb 2013 17:01 #30260 by kinsa
Replied by kinsa on topic EMC2 running on Raspberry Pi?
I have documented the PIC32 expnasion board here: code.google.com/p/picnc/

A simple HAL SPI driver for testing is included in the source page.

Please Log in or Create an account to join the conversation.

More
18 Feb 2013 17:15 #30264 by mhaberler
Replied by mhaberler on topic EMC2 running on Raspberry Pi?
Kinsa,

I have documented the PIC32 expnasion board here: code.google.com/p/picnc/

A simple HAL SPI driver for testing is included in the source page.


great - that looks quite solid

out of curiosity: do you have rough timings for the SPI communication? just to get a feel which delays we're looking at

- Michael

Please Log in or Create an account to join the conversation.

More
18 Feb 2013 17:44 #30268 by kinsa
Replied by kinsa on topic EMC2 running on Raspberry Pi?
Transferring 64 bytes takes around 45us on a 15 MHz SPI clock. Note that the transfer happens both ways, i.e. the RPi is also receiving 64 bytes of data from the board at the same time.

The SPI clock can go up to 32 MHz. I haven't tested this as this is beyond the capability of the PIC32 chip. Maybe an FPGA board can handle it.

Please Log in or Create an account to join the conversation.

More
19 Feb 2013 14:54 #30311 by kinsa
Replied by kinsa on topic EMC2 running on Raspberry Pi?
BTW, the maximum jitter I have obtained on RPi using the latency-test is around 55us. The test duration is more than 24hrs and the RPi is doing a lot of compiling in the background.

Please Log in or Create an account to join the conversation.

More
09 Mar 2013 19:31 #31130 by mungkie
Replied by mungkie on topic EMC2 running on Raspberry Pi?

I have documented the PIC32 expnasion board here: code.google.com/p/picnc/

A simple HAL SPI driver for testing is included in the source page.


I am finally getting round to looking at linuxcnc on the rpi again and spent 2 or 3 hours yesterday trying to select a suitable mcu for interfacing over spi, if only I had checked your work first, looks like you selected the ideal one and have done all the hard work (if only you had used a dev board with the DIP package chip, I would have saved 3 hours).

PIC's seem to have all the features I decided were necessary: spi dma, higher clock speed, available in DIP pakage, and under £3 per chip.

After messing with the atmega I decided it was probably a dead end and dma is probably a must have for the mcu.

PIC seem to have two nice cheap options with dma in DIP package
PIC18F26J11 @ £2.02
PIC32MX130F064B @ 2.45

I am not sure about supporting components yet, this weekend I should workout requirements for a breadboard layout, maybe make an order for components soon (rs seem to have a £20 minimum order now :( )

www.eevblog.com/forum/microcontrollers/pic32mx-quickstart/ , and www.ccsinfo.com/forum/viewtopic.php?t=47347 looks like my study material

I get the feeling linuxcnc is possibly getting towards a decent working system on the rpi, the PIC looks very promising to me after failure with the other attempts I have made.

I have not really looked at your code, and I am not really a good enough coder to understand anyways, but I assume it uses spi dma, any quick description of what the code does would be helpful.

Thanks for sharing all your hard work kinsa and I hope it encourages others to have a go at hacking on the PIC and rpi and getting some tests done and improving linuxcnc.

Please Log in or Create an account to join the conversation.

More
09 Mar 2013 22:19 #31136 by kinsa
Replied by kinsa on topic EMC2 running on Raspberry Pi?

I am finally getting round to looking at linuxcnc on the rpi again and spent 2 or 3 hours yesterday trying to select a suitable mcu for interfacing over spi, if only I had checked your work first, looks like you selected the ideal one and have done all the hard work (if only you had used a dev board with the DIP package chip, I would have saved 3 hours).


The chip I used was a left over from my previous experiment (rt-8p8c). I completely missed the DIP requirement, once you start doing SMD stuff you'll never look back :)

I'm actually planning to build a polulo stepstick interface, similar to Sanguinololu, on top of picnc. I think I'll design a new board using a DIP package instead, most likely a PIC32MX150F128 (thanks to your research ;)) as the current firmware is using a serial bootloader which already occupies ~10kb.

The existing code should be easy to port over; the only downside to using a 40MHz part would be a lower maximum stepgen frequency (40kHz instead of 80kHz).

I am not sure about supporting components yet, this weekend I should workout requirements for a breadboard layout, maybe make an order for components soon (rs seem to have a £20 minimum order now :( )

A stripboard would be preferable due to higher clock frequency.

I think linuxcnc + RPi would serve the reprap and shapeoko crowd well.

Cheers!

Please Log in or Create an account to join the conversation.

More
10 Mar 2013 11:20 #31158 by otto_pjm
Replied by otto_pjm on topic EMC2 running on Raspberry Pi?
Wow,

I haven't checked in for a few months, it looks like a lot of progress has been made to get LinuxCNC going on ARM / RPi. I'm curious if it would be helpful to try and get the code working on a bit faster ARM board, something like the pcDuino (1Ghz but no SPI unfortunately) or a Odroid-U2 (1.7Ghz quad core, it seems that SPI is via a USB expansion, not sure if that would work). This Ordoid has SPI on a 50 pin header but it's not out yet and it's 4x what an RPi cost, ouch

So, any advice, is it worth pursuing any of these options or is the RPi the best way to test the code? Also are any PICnc boards available? I see the files and BOM are posted, but that's quite a bit beyond my soldering abilities with the SMD PIC.

Thanks for all the great effort.

Pete

Please Log in or Create an account to join the conversation.

Time to create page: 0.087 seconds
Powered by Kunena Forum