Re: LinuxCNC
Let me check tomorrow.
Also check the spi signals on both sides (RPi and PICnc) as sometimes the issue is with the connectors.
Also check the spi signals on both sides (RPi and PICnc) as sometimes the issue is with the connectors.
42
Re: LinuxCNC
Thanks Kinsa!kinsa wrote:Let me check tomorrow.
Also check the spi signals on both sides (RPi and PICnc) as sometimes the issue is with the connectors.
I'll have a go on the code, maybe something I forgot (I did try your code also).
Thanks!
Re: LinuxCNC
You need to enable the axis, issue the command:
The complete test would be:
Monitor the value of picnc-jr.0.position-fb and issue the command:
Code: Select all
setp picnc-jr.0.enable 1
Code: Select all
loadrt threads name1=test period1=1000000
loadrt hal_picnc_jr
setp picnc-jr.0.scale 100
setp picnc-jr.0.maxaccel 10
setp picnc-jr.0.mode 1
addf picnc-jr.read-spi test
addf picnc-jr.stepgen test
addf picnc-jr.write-spi test
start
loadusr halmeter
Code: Select all
setp picnc-jr.0.position-cmd 1000
setp picnc-jr.0.enable 1
42
Re: LinuxCNC
Wow, that worked!kinsa wrote:You need to enable the axis, issue the command:The complete test would be:Code: Select all
setp picnc-jr.0.enable 1
Monitor the value of picnc-jr.0.position-fb and issue the command:Code: Select all
loadrt threads name1=test period1=1000000 loadrt hal_picnc_jr setp picnc-jr.0.scale 100 setp picnc-jr.0.maxaccel 10 setp picnc-jr.0.mode 1 addf picnc-jr.read-spi test addf picnc-jr.stepgen test addf picnc-jr.write-spi test start loadusr halmeter
Code: Select all
setp picnc-jr.0.position-cmd 1000 setp picnc-jr.0.enable 1
I haven't checked with the scope, but I certainly have feedback now!
Thanks!

Now I need to install the HAL driver for LinuxCNC or can i run it straight out of the box?
Re: LinuxCNC
The HAL driver is already installed. You just need to create a machine configuration.
Have a look under picnc/configs, it contains some sample config for the original picnc. Just replace any reference to *picnc* to *picnc_jr* or *picnc-jr* where appropriate.
Have a look under picnc/configs, it contains some sample config for the original picnc. Just replace any reference to *picnc* to *picnc_jr* or *picnc-jr* where appropriate.
42
Re: LinuxCNC
Really really nice work here Kinsa! I finally got to see what LinuxCNC Looks like!kinsa wrote:The HAL driver is already installed. You just need to create a machine configuration.
Have a look under picnc/configs, it contains some sample config for the original picnc. Just replace any reference to *picnc* to *picnc_jr* or *picnc-jr* where appropriate.
I changed like you said, no more startup errors!
Now I'll go ahead and test some motors on it

Re: LinuxCNC
Can anyone tell me what type of PIC32 I need?
Roque is providing me with a board of him, but what type of PIC32 need to be put on that?
PIC32MX150F128B-50I/ML
PIC32MX150F128B-50I/SO
PIC32MX150F128B-50I/SP
PIC32MX150F128B-50I/SS
PIC32MX150F128B-I/ML
PIC32MX150F128B-I/SO
PIC32MX150F128B-I/SP
PIC32MX150F128B-I/SS
These are the different types I found
Roque is providing me with a board of him, but what type of PIC32 need to be put on that?
PIC32MX150F128B-50I/ML
PIC32MX150F128B-50I/SO
PIC32MX150F128B-50I/SP
PIC32MX150F128B-50I/SS
PIC32MX150F128B-I/ML
PIC32MX150F128B-I/SO
PIC32MX150F128B-I/SP
PIC32MX150F128B-I/SS
These are the different types I found
Re: LinuxCNC
I forgot to add, the supply to the CNC shield should be connected to 3.3v instead of 5v.kinsa wrote:This is the pinout of the CNC shield:
Using the breadboard schematic as reference:The pin ordering for (P3) is normally step and dir for axes X Y Z (i.e 1- step x, 2- dir x, 3- step y, ... ).
- Connect the direction and step pulse pins to STEP/DIR (P3).
- Connect the inputs (*), except for reset/abort to INPUTS (P4). Note that the limit switches are normally closed (NC).
- Connect the coolant, stepper, spindle enable and spindle direction to OUTPUTS (P5).
The INPUTS (P4) and OUTPUTS (P5) can be of any order as the assignments can be changed in software.
Note that you'll need to modify the shield and add pull-up resistors on the inputs:
Any value between 1K to 3.3K will do.
42
Re: LinuxCNC
When i have all the items, I will make a complete schematic and will put it here for reviewing by you guys.
Re: LinuxCNC
Wohoo!! I got motors going! Great! Now I'll try to do it again (I need 2 RPi with CNC), so I can document my process!Lerche wrote:Really really nice work here Kinsa! I finally got to see what LinuxCNC Looks like!kinsa wrote:The HAL driver is already installed. You just need to create a machine configuration.
Have a look under picnc/configs, it contains some sample config for the original picnc. Just replace any reference to *picnc* to *picnc_jr* or *picnc-jr* where appropriate.
I changed like you said, no more startup errors!
Now I'll go ahead and test some motors on it
Btw Kinsa: I got your boards, thanks a bunch!
Lerche
Re: LinuxCNC
Just a curious one.... I heard about running LinuxCNC on two raspberry pi's.
This was done to split the load.
Anyone had some experience with this setup?
This was done to split the load.
Anyone had some experience with this setup?
Re: LinuxCNC
There's no remote gui yet except for the web interface.
One board runs lcnc and the other board runs the Web browser.
One board runs lcnc and the other board runs the Web browser.
42
Re: LinuxCNC
Would that be an advantage? Or is the Pi strong enough to run both?
Re: LinuxCNC
The current GUI with preview mode isn't really optimized to run under arm boards. If you stick to text based gui's, linuxcnc runs fine on a single RPi. AXIS, the default gui, is a resource hog - this also holds true for Beaglebones which is way faster than RPi.Guvner wrote:Would that be an advantage? Or is the Pi strong enough to run both?
42
Re: LinuxCNC
I have been wondering how linuxcnc works on xenomai kernel and just recently saw something that suggested there were problems that will soon be fixed.
http://www.blaess.fr/christophe/2013/02/15/
I know until recently I have found very poor performance with RT_PREEMPT kernels, have you found any problems with usb on the kernels you have been using?
Also which version of linuxcnc are you using, I have just recently looked at machinekit which seems to compile without problem on the rpi.
http://www.blaess.fr/christophe/2013/02/15/
I know until recently I have found very poor performance with RT_PREEMPT kernels, have you found any problems with usb on the kernels you have been using?
Also which version of linuxcnc are you using, I have just recently looked at machinekit which seems to compile without problem on the rpi.
Re: LinuxCNC
Xenomai works fine as long as you don't run your base period less than 100ms.mung wrote:I have been wondering how linuxcnc works on xenomai kernel and just recently saw something that suggested there were problems that will soon be fixed.
http://www.blaess.fr/christophe/2013/02/15/
I know until recently I have found very poor performance with RT_PREEMPT kernels, have you found any problems with usb on the kernels you have been using?
Also which version of linuxcnc are you using, I have just recently looked at machinekit which seems to compile without problem on the rpi.
I'm using the latest machinekit on a 3.10 kernel. Works fine but I haven't exhaustively tested the USB. The 3.10 drivers are way better than the old kernels.
42
Re: LinuxCNC
Sooo happy.
Got mail today with a nice pcb from roque!!!
Saturday to the electronics shop to get the parts to put on the pcb
Got mail today with a nice pcb from roque!!!
Saturday to the electronics shop to get the parts to put on the pcb
-
- Posts: 14
- Joined: Sun Jun 01, 2014 8:26 am
Re: LinuxCNC
Hi, I have a post at http://www.raspberrypi.org/forums/viewt ... 50#p558450
However I was wondering if my question could be answered here:
I am trying to build a CNC machine from my Raspberry Pi. I did some research, purchased some 4 phase stepper motors (28BYJ-48) with a ULN-2003 driver board. I can move these motors fine with a python script using [1,0,0,1] [1,0,1,0] etc except when I try to apply this to the real world I hit a road block. So in a nut shell I know I can move the motors smoothly with a 0.004 second delay however all applications so far with examples on the net with python all show a bipolar motor setup. I even tried compiling my own kernel with LINUXCNC drivers etc, the application works but it require 2 pins only for drive/step. I clearly need 4 GPIO pins per phase.
Tom
However I was wondering if my question could be answered here:
I am trying to build a CNC machine from my Raspberry Pi. I did some research, purchased some 4 phase stepper motors (28BYJ-48) with a ULN-2003 driver board. I can move these motors fine with a python script using [1,0,0,1] [1,0,1,0] etc except when I try to apply this to the real world I hit a road block. So in a nut shell I know I can move the motors smoothly with a 0.004 second delay however all applications so far with examples on the net with python all show a bipolar motor setup. I even tried compiling my own kernel with LINUXCNC drivers etc, the application works but it require 2 pins only for drive/step. I clearly need 4 GPIO pins per phase.
Tom
Re: LinuxCNC
On the BOM of the breadboard I saw the next items
QTY
1 PIC32MX150F128B
2 SN74LS04
2 1K resistor
4 0.1uf capacitor
1 10uf low ESR capacitor (tantalum/ceramic)
I allready have my PIC32 and SN74LS04 ic's. But now I need to get the remaining items from the electronics store.
* What voltage does the 10uf cap need to be?
* What voltage does the 0.1uf cap need to be?
* What type of resistor do I need?
QTY
1 PIC32MX150F128B
2 SN74LS04
2 1K resistor
4 0.1uf capacitor
1 10uf low ESR capacitor (tantalum/ceramic)
I allready have my PIC32 and SN74LS04 ic's. But now I need to get the remaining items from the electronics store.
* What voltage does the 10uf cap need to be?
* What voltage does the 0.1uf cap need to be?
* What type of resistor do I need?
Re: LinuxCNC
The capacitor 10 uF 25V tantalum, was the lowest
The 0.1 uF are sufficient voltage.
The highest voltage is 5V at BB
Resistors 1/4W 5%



The 0.1 uF are sufficient voltage.
The highest voltage is 5V at BB
Resistors 1/4W 5%
Re: LinuxCNC
If you have linuxcnc working correctly and the stepper driver is the same for kinsa pic board as the standard linuxcnc stepgen then there are many options for alternative step types, read the linuxcnc stepgen manual for more information. http://linuxcnc.org/docs/html/man/man9/stepgen.9.htmlInventor_Tommy wrote:Hi, I have a post at http://www.raspberrypi.org/forums/viewt ... 50#p558450
However I was wondering if my question could be answered here:
I am trying to build a CNC machine from my Raspberry Pi. I did some research, purchased some 4 phase stepper motors (28BYJ-48) with a ULN-2003 driver board. I can move these motors fine with a python script using [1,0,0,1] [1,0,1,0] etc except when I try to apply this to the real world I hit a road block. So in a nut shell I know I can move the motors smoothly with a 0.004 second delay however all applications so far with examples on the net with python all show a bipolar motor setup. I even tried compiling my own kernel with LINUXCNC drivers etc, the application works but it require 2 pins only for drive/step. I clearly need 4 GPIO pins per phase.
Tom
I think step types 9 and 10 will drive 4 phase via a uln2003 type driver, or you can wire a uln with some resitors to drive in quadrature using only two gpio drive pins.
I have never looked at kinsas drivers so do not know how it works and integrates with linuxcnc or the standard stepgen driver.
I am hoping to get a reasonable stepgen driver created for the pi without the need for external hardware(with full support for all step types), unfortunately it requires a lot of work and I am trying to workout a kickstarter to fund it, I doubt it will be ready before september.
There should be some linuxcnc config files available that show how the other stepgen step types work, if you check the example config file there should be something of use otherwise try asking on the linuxcnc.org forum.
Re: LinuxCNC
I have updated and simplified PICnc to handle small and large stepper motors.
PICnc V2, using LPT interface:

PICnc V2.1, using pololu compatible boards:

These can also be used on other ARM based boards, such as A13, that has an SPI interface.
I will post more info later.
Cheers!
UPDATE:
Repository: https://github.com/kinsamanka/PICnc-V2
PICnc V2 Schematic: https://github.com/kinsamanka/PICnc-V2/ ... f?raw=true
PICnc V2.1 Schematic: https://github.com/kinsamanka/PICnc-V2/ ... f?raw=true
PICnc V2, using LPT interface:

PICnc V2.1, using pololu compatible boards:

These can also be used on other ARM based boards, such as A13, that has an SPI interface.
I will post more info later.
Cheers!
UPDATE:
Repository: https://github.com/kinsamanka/PICnc-V2
PICnc V2 Schematic: https://github.com/kinsamanka/PICnc-V2/ ... f?raw=true
PICnc V2.1 Schematic: https://github.com/kinsamanka/PICnc-V2/ ... f?raw=true
42
Re: LinuxCNC
Hi, Kinsa. In v2 picnc with LPT interface, this is to program?
Regard
Luis
Regard
Luis
Re: LinuxCNC
This is similar to the breadboard version except that it uses the same pinout that is used on the LPT port with software stepgen (linuxcnc on PC).Roque7 wrote:Hi, Kinsa. In v2 picnc with LPT interface, this is to program?
Regard
Luis
If you have an existing PC setup, you can easily reuse it with this board.
42