EMC2 running on Raspberry Pi?

More
19 Dec 2013 06:06 #41798 by ADBensi
Hi,

Maybe Mungkie should know how do.. rpi_stepgen was created in this tread by he. Stepgen procedure works fine in my tests, the problem occurs with linuxcnc intervention.

I am put the video:

See the wave period varying and in some cases minor than 1 us.

Best Regards.

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

More
19 Dec 2013 21:12 #41829 by andypugh
I am not sure that the RPi stepgen driver actually works. The code has never been submittted to the LinuxCNC project.
I think that the principle of operation is probably sound, so it is a pity that it never seems to have been finished and added to the code base.

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

More
20 Dec 2013 06:27 #41847 by mungkie
Interesting that comments are here just as I am thinking about looking at this again over christmas.

I never seem to get time to actually catch up with this project as everytime I look things have changed, and I am waiting for some kernel improvements .

I am sure the stepgen driver I wrote will not get into the upcoming linuxcnc release, there are so many things that need to get done the major one being the RT_PREEMPT kernel. I have read that apparently both the rpi and RT_PREEMPT patches will become mainline for kernel 3.12, so I am waiting for that.

The current 3.12 and 3.10 kernels seem to have very poor RT performance, I don't really have the knowledge to trace the problems, but average cyclictest always seems around 60us but spikes of 2000 or even 5000us can easily be created by running midori.

I have a feeling that there maybe problems with DMA usage in the rpi kernel with busy waits, I really don't know and it seem more hardware will be using the DMA engine in future kernels and the new fbturbo X server also, so not sure how the DMA may conflict with that?.

I will definitly be releasing a full updated and debuggered driver at some point soon, but I feel like the target is still moving too fast for it to be worth putting in large amount of effort.

The driver on the SD image that was released is basically the same as the one shown on this post
linuxcnc.org/index.php/english/forum/18-...y-pi?start=140#32939

I am hoping to add GPIO inputs and variable period settable at load time, I will release the code, but I am also considering creating a kickstarter project so I can buy myself some test equipment to work on the driver with.

I am also looking at cross platform gui options linuxcnc.org/index.php/english/forum/41-...uture?start=10#41846

I imagine there could be problems with the driver if RT_PREEMPT has a latency greater than 2000us, and if there is cumulative latency then the code will need to implement some sort of catchup procedure.

It will all probably get done eventually, but this is just a hobby project so I am guessing it could take at least a year. If of course I realise its all not possible I will post details if anyone else wants to try and fix my mistakes :laugh: :lol:
The following user(s) said Thank You: ADBensi

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

More
20 Dec 2013 07:16 - 20 Dec 2013 07:23 #41849 by ADBensi
Hi!

The idea is very good, it's a shame not to have the expectations achieved.

I made a comparison between the codes, they should work. Basically what has been implemented is the BCM2835 DMA GPIO API. I did several tests with several options in the HAL and INI files, including maximum overclocking in the System.

That's when I did a test to just run the pass drive in the maximum speed (my engine only goes up to 270RPM) and then realized that the wave was stable. The problem occurs when the linuxcnc interferes and adjusts the frequencies.

So I think que there are no serious errors to correct, and I agree that the DMA resource must be reassessed beyond the RT Kernel in this version.

Mungkie, you can count me as a collaborator and testing :D
Best Regards,
Attachments:
Last edit: 20 Dec 2013 07:23 by ADBensi. Reason: fix translate verbs

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

More
18 Jan 2014 07:02 #42948 by Roque7
Hi, I'm using qemu simulator to test the following images
wiki.linuxcnc.org/cgi-bin/wiki.pl?RaspbianXenomaiBuild, rpi-lcnc.img, this can simulate well.
soundproofingforum.co.uk/rpi_linuxcnc/raspberrypilinuxcnc.htm, rpi linuxcnc.rar, can not simulate, the simulator starts but after a few line stops.
It is because this bad image? The simulator works well with others images.
Thank you.
I hope you understand me, do not speak English and use the google translator.
regards
Roque7

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

More
18 Jan 2014 07:08 #42950 by andypugh

the simulator starts but after a few line stops./quote]

It is a strange window manager, there is nothing at all to see until you press a button on the mouse (if it is the image I think it is).

Starting axis does take a very long time. Many minutes. Once it starts, it is OK.

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

More
18 Jan 2014 17:25 #42962 by Roque7
Hi.
The problem I have is that the simulator does not load the image.
It is always standing in the same line.
regards
Roque7

File Attachment:

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

More
18 Jan 2014 23:29 #42972 by andypugh
"Unable to mount root partition"

It looks like the disc image is corrupted. What does the SD card look like if you plug it into another PC, rather than try to boot from it?

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

More
27 Jan 2014 02:53 #43213 by billykid
Hi
i can't download the prebuilt image on both link...

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

More
16 Feb 2014 05:13 #43888 by michael.oosten
Hi,

Just to play around with LinuxCNC and understand its workings, I'd like to test it on RPi driving two LEGO motors. However, I am running into a couple of problems.

I don't mind it not being accurate, so I started off with: wiki.linuxcnc.org/cgi-bin/wiki.pl?RaspberryPi building LinuxCNC on standard Raspbian distro. However, I don't know how to get the correct HAL drivers for GPIO to load, so I'm stuck in simulation mode. How do I get the correct drivers to compile and load?

After reading the LinuxCNC message after compiling is done: I thought it wasn't possible to actually drive motors without a realtime kernel. So, I used wiki.linuxcnc.org/cgi-bin/wiki.pl?RaspbianXenomaiBuild to actually build the RaspbianXenomai kernel. However, when I run latency-test, I get the following error: halcmd: error while loading shared libraries: /usr/xenomai/lib/libnative.so.3: invalid ELF header. And I'm stuck again. Not sure what's wrong. Google tells me it might be a crosscompile issue (I've used Wheezy in VirtualBox on my MacBookPro to stay close the RaspbianXenomaiBuild wiki page. Any ideas?

Thanks,
Michael
The following user(s) said Thank You: howdozhangli

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

Time to create page: 0.263 seconds
Powered by Kunena Forum