jdoggsc
Posts: 4
Joined: Wed Jan 14, 2015 2:30 am

Re: LinuxCNC

Thu Jun 18, 2015 12:30 am

you're right. I have forgotten to check the status of spi_fault. I'm out of town for the next few days. I'll set myself a reminder to check that when I get back home and I'll try isolating the motors one-by-one. Thanks for the suggestion.

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Thu Jun 18, 2015 12:45 am

I've built the debian wheezy image from scratch and used a preempt_rt kernel and then used the deb packages that machinekit ptovides.

I haven't updated to jessie yet, maybe next week if I've time.
42

jdoggsc
Posts: 4
Joined: Wed Jan 14, 2015 2:30 am

Re: LinuxCNC

Mon Jun 22, 2015 3:21 am

I finally got some time to work on this again. Here's what I've done:
Ground all chassis elements, cable sheaths, and workpiece to earth ground. Doing this, the spindle spin-up problem is avoided but there are still problems during operation. For instance, when I connect only the z-axis motor, at spindle spin-up,I normally get joint following errors on joints 0 and 2, but after connecting all metal (except spindle) to earth ground, I don't get errors when I turn the spindle on anymore.

Following Kinsa's advice, I connected the motors up on-by-one to see the problems I'd get with each. Here's a table with my findings:
Image
the results don't make much sense to me. In most cases, I'm getting following errors for axes that are not even connected.

For a couple of scenarios (z-axis spin-up, and x-axis sideways motion into workpiece), I checked value of spi_fault.
For both cases, spi_fault=1. All of the other cases showed identical symptoms, so I'd say it's safe to assume that spi_fault=1 in each situation.

I thought it was interesting that when I had no motors connected I still got following errors on joints 0 and 2 when turning the spindle off. I suppose this means that the noise is being fed in through the wall--whether to the RPi or to my power supply. Often, my screen will blank and then come back on when I turn the spindle off, so that could be confirmation of this phenomenon. I'm not really sure how to fix this. Ferrite core?

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Mon Jun 22, 2015 3:42 am

You have a severe noise issue as it also affects the screen when you turn the motor off. I really can't imagine that such a small motor could cause such a big interference :D Maybe it has something to do with the way your mains is wired up?

I think the best way to go is to put all your electronics in to a small metal casing and use shielded cables for the motor cabling. I think you only need to connect the ground sheath of the cable on the controller side and leave the other end disconnected.

BTW, whenever picnc.spi_fault=1 happens, it means that the SPI data stream fails its integrity check. The joint errors that you see is actually not a valid joint error as the data for that particular axis is corrupted due to noise.
42

jdoggsc
Posts: 4
Joined: Wed Jan 14, 2015 2:30 am

Re: LinuxCNC

Mon Jun 22, 2015 2:56 pm

Hey Kinsa, thanks for the response.
BTW, whenever picnc.spi_fault=1 happens, it means that the SPI data stream fails its integrity check. The joint errors that you see is actually not a valid joint error as the data for that particular axis is corrupted due to noise.
That's what I figured, but I wondered if it might be any indication of something by having a particular joint or a combination or joints showing errors.
You have a severe noise issue as it also affects the screen when you turn the motor off. I really can't imagine that such a small motor could cause such a big interference :D Maybe it has something to do with the way your mains is wired up?
To be honest, I'm repurposing an old laptop's LCD screen, and I'm using a kit that I bought off eBay from China to allow me to use the screen. It's not super robust, and can be sensitive to jostling as well. It works well enough as long as it's just on the shelf and I don't move it. Having it turn off and then on again mostly indicates to me that there is noise, but not necessarily the magnitude of it. I'm curious if it will make my desktop LCD screen flicker, though. I might check that for the sake of curiosity.
I think the best way to go is to put all your electronics in to a small metal casing and use shielded cables for the motor cabling. I think you only need to connect the ground sheath of the cable on the controller side and leave the other end disconnected.
I do not have my electronics in a metal casing yet. All of my cables, though, are shielded. The sheaths are grounded on the controller side only. The other ends are disconnected. Kinsa, do you ground the metal casing of your electronics? If so, do you ground it to power supply ground, or to earth ground (for my power supply, they are not necessarily the same thing. A continuity check between the two fails, and there's a small voltage potential between the two.)

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Tue Jun 23, 2015 10:55 am

I normally connect the metal case to earth. That's how my PC case is wired up. :)

Here's a discussion regarding case grounding: electronics.stackexchange.com/questions/149643/physically-how-does-connecting-a-pcb-to-chassis-ground-reduce-noise
42

elad
Posts: 4
Joined: Mon Feb 09, 2015 3:21 pm

Re: LinuxCNC

Sat Jun 27, 2015 4:08 am

hi
kinsa
if use the pi2 's spi, should we change the driver code of kernel. if so , how to do ?
thanks

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sat Jun 27, 2015 5:41 am

This project doesn't use the kernel spi drivers.

You need to unload the kernel driver to make this work.
42

elad
Posts: 4
Joined: Mon Feb 09, 2015 3:21 pm

Re: LinuxCNC

Fri Jul 03, 2015 6:12 am

hi
i have download the image of rpi2 image from http://0ptr.link/files/. and install it in 8G sd card, then run the image in RPi2.
The image is RPi2-machinekit-1.0.img.bz2 .
what is the path of picnc hal component, and what is the name of picnc.

elad
Posts: 4
Joined: Mon Feb 09, 2015 3:21 pm

Re: LinuxCNC

Fri Jul 03, 2015 7:00 am

hi
kinsa
where i can download picnc.so , the driver of picnc.
thanks

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Sun Jul 05, 2015 6:20 am

You need to download the src files: https://github.com/kinsamanka/PICnc-V2/tree/master/HAL and then compile it:

Code: Select all

 sudo comp --install picnc.c
42

klozano1
Posts: 1
Joined: Wed Jul 08, 2015 10:33 pm

Re: LinuxCNC

Wed Jul 08, 2015 10:53 pm

Hi Kinsa
I am trying to build a CNC machine with raspberry pi and linuxcnc. As far as I understand, picnc is a board you developed to simulate the parallel port that linuxcnc uses.
I cant find the schematic of picnc and the software for the picnc and for the image of th rpi with linuxcnc.
Can you help me please?
My mail is [email protected], I would appreciate if you send me a mail.

Thank you very much

elad
Posts: 4
Joined: Mon Feb 09, 2015 3:21 pm

Re: LinuxCNC

Sat Jul 18, 2015 1:42 am

hi
kinsa
i have downloaded the code from https://github.com/kinsamanka/PICnc-V2/.
The following line shoud be modified.
txBuf[0] = CMD_CM2; change to txBuf[0] = CMD_CM1, in the funcion void read_spi(void *arg, long period).
so the following sanity check line is valid in the funcion read_spi(void *arg, long period).
if (rxBuf[0] == (CMD_CM1 ^ ~0)) {

thanks

larry104
Posts: 14
Joined: Sun Jun 09, 2013 8:34 pm

Re: LinuxCNC

Wed Jul 29, 2015 9:41 pm

Hi Kinsa,

today I installed the latest Raspbian image on a new Raspberry Pi2 - I followed exact your Wiki on how to install MachineKit - are these instructions outdated? I get the following errors after the latency-test

Code: Select all

latency-test
Warning - /usr/libexec/linuxcnc/rtapi_app_posix not setuid
'sudo make setuid' missing?
msgd:0 stopped
rtapi:0 stopped
Warning - /usr/libexec/linuxcnc/rtapi_app_posix not setuid
'sudo make setuid' missing?
/usr/bin/realtime: line 186: /usr/libexec/linuxcnc/rtapi_app_posix: No such file or directory
rtapi_app startup failed - aborting
halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
halcmd: cant connect to rtapi_app: -1 (uri= uuid=a42c8c6b-4025-4f83-ba28-dad21114744a): rtapi_rpc(): reply timeout

halcmd: the rtapi:0 RT demon is not running - please investigate /var/log/linuxcnc.log
Warning - /usr/libexec/linuxcnc/rtapi_app_posix not setuid
'sudo make setuid' missing?
Any hints on what could go wrong?

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Wed Jul 29, 2015 11:01 pm

Are you compiling from source?

You're also not running a realtime kernel, the latency test results will not be ideal.
42

larry104
Posts: 14
Joined: Sun Jun 09, 2013 8:34 pm

Re: LinuxCNC

Wed Jul 29, 2015 11:14 pm

As I said I used your instructions https://github.com/kinsamanka/PICnc-V2/ ... Machinekit for installing the
machinekit-xenomai as well as the xenomai kernel - so no, not from source with apt-get install

Do you have by any chance updated instructions - also, is it better to compile machinekit from scratch?

Thanks!

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Thu Jul 30, 2015 1:16 am

Sorry I don't have an RPi2 at the moment.

I'm not sure where you got your xenomai kernel but it's not running at the moment.

The latency results that you'll get, provided the error is fixed, is useless as you're running on a posix kernel.
42

kinsa
Posts: 457
Joined: Sat Dec 01, 2012 10:16 pm

Re: LinuxCNC

Thu Jul 30, 2015 2:51 am

BTW, those instructions are for the original RPi.
42

sauges
Posts: 5
Joined: Thu Jul 30, 2015 8:08 am

Re: LinuxCNC

Thu Jul 30, 2015 8:15 am

Hi people. please tell me where you can download linuxcnc on raspberry pi2

sauges
Posts: 5
Joined: Thu Jul 30, 2015 8:08 am

Re: LinuxCNC

Thu Jul 30, 2015 2:17 pm

Hi people.
I downloaded linuxcnc here http://0ptr.link/files/
when I run it I ask login and password
I wrote a username pi and password raspberry
but It says that an incorrect password What to do?

sauges
Posts: 5
Joined: Thu Jul 30, 2015 8:08 am

Re: LinuxCNC

Fri Jul 31, 2015 8:51 pm

help me please.
I installed by this instruction https://github.com/kinsamanka/PICnc-V2/ ... Machinekit.
when I asked I write the password in the manual nothing.

sauges
Posts: 5
Joined: Thu Jul 30, 2015 8:08 am

Re: LinuxCNC

Fri Jul 31, 2015 9:45 pm

thank you very much understood
I had to choose LHDE
login: mk password: machinekit

sauges
Posts: 5
Joined: Thu Jul 30, 2015 8:08 am

Re: LinuxCNC

Fri Jul 31, 2015 9:46 pm

sorry LXDE

er85
Posts: 8
Joined: Fri May 15, 2015 3:29 pm

Re: LinuxCNC

Tue Aug 04, 2015 1:06 am

Do you think it be would possible somehow to use two PICnc V2 on an RPi2?
I need more I/O so that would be really nice if it worked.
It should be possible right? But how much change in code is needed?
Would be cool if they could be run on the same SPI port too.
I will probably recieve components for two boards tomorrow so I should be able to try it myself soon. :)

Wire
Posts: 78
Joined: Tue Sep 11, 2012 6:46 pm

Re: LinuxCNC

Tue Aug 04, 2015 2:04 am

how much more IO do you need? Also do you need more stepping channels or just plain digital IO?

Started a bigger version for my laser cutter (needed more IOs as well) Here is some preliminary info
http://www.wire2wire.org/PICnc_5axis/PICnc_5axis.html

Have 3 PCBs back and built up and about half way done making and debugging the firmware.

Later,
Peter

Return to “Automation, sensing and robotics”