EMC2 running on Raspberry Pi?

More
12 years 6 months ago #45570 by michael.oosten
Hi,

I installed LinuxCNC on my RPi
Got the hal_gpio driver
Compiled it: comp --install hal_gpio.c
Loaded it: halcmd: loadrt hal_gpio
It's loaded: halcmd: show pin
Component Pins:
Owner Type Dir Value Name
32770 bit IN FALSE hal_gpio.pin-03-out
32770 bit IN FALSE hal_gpio.pin-05-out
32770 bit IN FALSE hal_gpio.pin-07-out
32770 bit IN FALSE hal_gpio.pin-08-out
32770 bit IN FALSE hal_gpio.pin-10-out
32770 bit IN FALSE hal_gpio.pin-11-out
32770 bit IN FALSE hal_gpio.pin-12-out
32770 bit IN FALSE hal_gpio.pin-13-out
32770 bit IN FALSE hal_gpio.pin-15-out
32770 bit IN FALSE hal_gpio.pin-16-out
32770 bit IN FALSE hal_gpio.pin-18-out
32770 bit IN FALSE hal_gpio.pin-19-out
32770 bit IN FALSE hal_gpio.pin-21-out
32770 bit IN FALSE hal_gpio.pin-22-out
32770 bit IN FALSE hal_gpio.pin-23-out
32770 bit IN FALSE hal_gpio.pin-24-out
32770 bit IN FALSE hal_gpio.pin-26-out

When I measure between pin 7 (GPIO 4) and 3v3, I get 3v3, so pin 7 is indeed low.
After: halcmd: setp hal_gpio.pin-07-out TRUE
I am expecting to measure 0v, but I'm still measuring 3v3.

What am I doing wrong here?

Thanks, Michael

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

More
12 years 6 months ago #45974 by mungkie

michael.oosten wrote: Hi,

I installed LinuxCNC on my RPi
Got the hal_gpio driver
Compiled it: comp --install hal_gpio.c
Loaded it: halcmd: loadrt hal_gpio


>SNIP
When I measure between pin 7 (GPIO 4) and 3v3, I get 3v3, so pin 7 is indeed low.
After: halcmd: setp hal_gpio.pin-07-out TRUE
I am expecting to measure 0v, but I'm still measuring 3v3.

What am I doing wrong here?

Thanks, Michael


I have no idea, linuxcnc on raspberry pi has never really worked very well with direct gpio control, it was all work in progress. I have not looked at linuxcnc on the rpi since last year, I don't think much has been done for the rpi, maybe better to check the beagle?

I am thinking about getting back to work on linuxcnc on the raspberry pi, but I am not sure if it is viable.
I have never tried using xenomai kernels, I may give that a try in the hope that the UI is a little more responsive.

I have always used RT_PREEMPT kernel and there are problems with it that I am not sure may cause safety issues.

So far you can either have good realtime performance but lockup issues on the UI or you can have poor realtime performance and a better UI control.

The issue being you can click buttons in axis and occasionally the mouse will freeze for upto 2-3 seconds, this happens intermittently but will probably occur every 10 minutes, the safety issue comes if you click jog it can get stuck on moving a motor for 2 seconds without possible stopping.

I also have never implemented input via GPIO.

I am not sure how kinsa's pic IO board functions as I never got time to actually try his work.

I am considering setting up a kickstarter project to fund development of the DMA direct gpio driver, but I want to be able to offer more than just the driver so have been looking to workout a crowdfunding bulk purchase of stepper motors and drivers for a 5 axis hobby system. Part of me thinks its a bad idea as perfect cnc control maynot be possible with the rpi, but I thought maybe hobbyists would put up with it if they got a good deal on motors and drivers.
I doubt there would be enough people interested to justify the effort though.

I was looking along the lines of getting 10,000 people interested enough to donate $65 each and it could be possible to get 5 nema17 0.4Nm motors with A4988 drivers for all backers (would still need to know how to solder and provide a power supply).

Otherwise I would probably just run the kickstarter as request for $2000 so I can buy some decent stepper drivers and some test equipment to make sure there are no missed steps.

I got as far as getting 6 motors running under axis using the dma driver and it would run the default test gcode from axis, but never fully tested it as there was the problem with mouse lockups and I was waiting for a decent RT_PREEMPT kernel to be released.

I doubt the hal_gpio.c driver will give decent performance, but I have never tried it so that is just my unproven opinion.

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

More
12 years 6 months ago #45994 by mungkie
I was just messing about setting up my previous test system again, and thought I would make a video.



It should show the problem with mouse lockups, I point at screen when one occurs and also if you listen I start knocking mouse on desk when lockup occurs.

I posted other comments on system on youtube page, I will not repeat them here as they are just unimportant config details and babble about weather it is worth effort to work on the driver again yet.

I am waiting to get back some reasonable quotes for motor prices and will try the 3.14 kernel before I think about going much further with driver optimizing or working on GPIO input, probably at least a couple of weeks.

Also should say that the drivers are not tuned and the stepgen goes way too fast for the drivers to keep up (should do 20us).

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

More
12 years 6 months ago #46016 by ADBensi
Hello Mungkie,

 I'm excited about Xenomai , appears to be more active .

 What I do not like the raspberry is the low performance / memory when compared to other ARM . So I'm willing to see LinuxCNC in a Cubieboard A10 1GHz 1GB DDR3 $ 49 . At least the performance of the graphics system will be better (besides the file system - NATIVE SATA Port ) . There are other things that strikes me , 64 IOs , interrupt support in some of them .

 I enjoyed the graphic performance of this project (which supports GPIO) github.com/cubieplayer/Cubian

 Beagle is a better option of Raspberry, but still sins 512M DDR3 memory .
 
 Now it is to spend a little more go out with this
www.seeedstudio.com/depot/Radxa-Rock-p-1693.html?cPath=6_117
 
 I think the work of Kinsa essential to use Raspberry . I compared the sources gpio_hal Beagle and Raspberry and saw no reason for the poor performance of the Raspberry to guaranteed time. I do not think a re- design would have many results.

 I can contribute some testing on my A10 willingness.

 If there is a group of people who want to use any other card with at least 1GB , 1GHz and many GPIOs ( where some of them interrupt support ) I am willing to spend money and time to work together.

Best Regards

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

More
12 years 6 months ago #46025 by andypugh

ADBensi wrote: If there is a group of people who want to use any other card with at least 1GB , 1GHz and many GPIOs ( where some of them interrupt support ) I am willing to spend money and time to work together.


Have you seen the Udoo?
www.udoo.org

Quad-core 1GHz with the same pinout as an Arduino Mega.
The following user(s) said Thank You: tkamsker

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

More
12 years 6 months ago #46027 by ADBensi
Yes. Disliked the fact the Arduino communicating via serial and USB with the processor, both are poorer than SPI.

I believe that I2C is a better option (without SPI) than USB or serial for this application.

See ODROID-U3 www.hardkernel.com/main/products/prdt_in...g_code=G138733896281 , is powerful, cheap, supports eMMC (as good as SATA).

We could do something like Raspberry + PICnc but with a great performance in the system.

  ODROID-U3 (U $ 57) + PIC over I2C with DMA + A4988. I can make the PCB.

  See Raspberry with over 4 A4988 over I2C www.allthingsmicro.com/product/raspberry...-stepper-motor-board

Best Regards

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

Time to create page: 0.580 seconds
Powered by Kunena Forum