Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

Sort Of

Tue Apr 23, 2013 7:17 pm

Thanks for the help and I still need the diagram but I was referring to connecting that small ribbon cable like cord from the step/dir to the linistepper. So what wire is that and how do I connect that to a linistepper or alternative. I can try to show you of what I am talking about. https://www.youtube.com/watch?v=WLIo7TA82xE at 0:09 to 0:25 the grey cable going from board into linistepper box.

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

Re: LinuxCNC

Tue Apr 23, 2013 11:27 pm

The linestepper that I've used is custom built. The pinouts is specific to this board only.

Image
42

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

Wed Apr 24, 2013 1:24 am

Do you know where I could get a similar driver or a link to similar instructions to make a cheap but efficient one. Also do you think either of these steppers would work with a cnc http://www.sciplus.com/p/36STEP-MOTOR_49727 http://www.sciplus.com/p/48STEP-MOTOR_49728. Lastly how would I supply power and connect the step/dir to the motors if I made a custom driver. Any basic info or links to similar solutions will be greatly appreciated.

Cheers and many thanks

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

Reuse

Wed Apr 24, 2013 1:42 am

Do you mind if after a week or so when I set this up can I make a web site with my whole setup. I will give you credit and the reason I would like to do this is for the same reason the pi was made is to provide people with good technology for an affordable price. My whole expenses are 225 dollar. Not bad for a hopefully soon working cnc.

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

Re: LinuxCNC

Wed Apr 24, 2013 2:13 am

I'm not really an expert on CNCs, I'm just doings this for fun :)

The motors you've pointed out are not really suited for cnc since it is weak and the resolution is low.

As I don't know your needs, please have a look at reprap or shapeoko. The electronics would be the same only the controller would be different.

I don't mind at all. Please do share your experience, that's what we are here for.

Cheers!
42

elmood
Posts: 3
Joined: Tue Apr 23, 2013 8:48 pm

Re: LinuxCNC

Thu Apr 25, 2013 1:09 am

I'm following this thread with interest. I got the linuxcnc xenomai image running and tried some xenomai code to test latency.

But my project is to use SPI for a non CNC project and so far I've been unable to get SPI running from within an rt task.

Does anyone have suggestions on doing this? I'm new to xenomai and still not sure how to access hardware from the thread.

Cheers!

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

Re: LinuxCNC

Thu Apr 25, 2013 1:55 am

Hi,

I've lost the initial files that I've used when I started developing, but take a look at hal_rspi.comp and the following code:

Code: Select all

#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/mman.h>

#include <native/task.h>
#include <native/timer.h>

RT_TASK demo_task;

void demo(void *arg)
{
	rt_task_set_periodic(NULL, TM_NOW, 1000000000);

	while (1) {
		rt_task_wait_period(NULL);
		transfer(); // see hal_rpspi.comp
	}
}

void catch_signal(int sig)
{
}

int main(int argc, char* argv[])
{
	signal(SIGTERM, catch_signal);
	signal(SIGINT, catch_signal);

	mlockall(MCL_CURRENT|MCL_FUTURE);
		setup(); // see hal_rpspi.comp
	rt_task_create(&demo_task, "trivial", 0, 99, 0);	rt_task_start(&demo_task, &demo, NULL);	pause();	rt_task_delete(&demo_task);		cleanup(); // see hal_rpspi.comp
	return 0;}
This is the modified "trivial-periodic.c" xenomai sample. Note that I haven't tested this but this is where I started.
BTW, you need to unload the kernel SPI driver before you run this.

Good luck!
42

elmood
Posts: 3
Joined: Tue Apr 23, 2013 8:48 pm

Re: LinuxCNC

Thu Apr 25, 2013 5:16 pm

kinsa: thanks for those tips... I got it working, a d found the datasheet for the Broadcom chip so that helps my understanding (I'm a PIC32 / MCU coder mostly, not Linux)

My next question then is what is involved in getting DMA working, so transfers larger than the FIFO size are possible without bothering the CPU?

Is this even possible without major changes to the way Linux uses the DMA for itself?

Cheers!

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

Re: LinuxCNC

Thu Apr 25, 2013 11:44 pm

I haven't worked with DMA yet but take a look at RPIO.PWM it might answer your questions.

Cheers!
42

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

Steppers

Fri Apr 26, 2013 1:34 am

Hi can anyone suggest cheap yet pretty accurate steppers that don't have to be geared down too much and are 5-10$. Also are you sure neither of those can be geared down or something from the earlier post with the 2 steppers because that would be optimal. Kinsa I would really appreciate it if you uploaded a diagram of your controller it doesn't need to be fancy like a schematic.

Thanks and again cheers.

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

Re: LinuxCNC

Fri Apr 26, 2013 12:31 pm

Here is the wiring for pololu stepper motor drivers:
wiring.png
stepper wiring
wiring.png (30.65 KiB) Viewed 8530 times
I don't have the wiring for my custom linistepper board as I don't have the schematics anymore. It was just a one-off project and I'll be using the pololu's for my MF70.

Cheers!

PS: Here's a link for cheap stepper motors: http://www.mpja.com/products.asp?dept=101

Found it while browsing this site: http://www.instructables.com/id/EG9RXG6F54HJ7SL/
42

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

Re: LinuxCNC

Wed May 08, 2013 8:36 am

Just an update, I have finally finished my MF70 CNC conversion. I have milled new nema17 motor mounts out of 6mm aluminum stock using the original PICnc board.

I'm changing to PICnc Jr board as it is more compact compared to my previous setup.

Cheers!

Image
42

mung
Posts: 506
Joined: Fri Nov 18, 2011 10:49 am

Re: LinuxCNC

Thu May 09, 2013 5:38 pm

Don't know if this is of use to you but there is an RT_PREEMPT raspbian distro of linuxcnc available, its really only a developer testing preview, so not really worth trying unless you want to get your hands dirty.

It uses the pi GPIO pins directly rather than offloading the stepgen to a daughter card, but should still get reasonable switching speeds as it uses DMA.

It really needs testing by people that have good test equipment to check there are no lost steps in the stepgen.

Gheckout the rpi linuxcnc thread http://linuxcnc.org/index.php/english/f ... =170#33848

And the project main page is http://soundproofingforum.co.uk/rpi_lin ... nuxcnc.htm

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

Re: LinuxCNC

Wed May 22, 2013 11:26 am

Here's an updated raspbian image: http://filecloud.io/wzf34ke7

md5sum: 4cde7a5334be885d373777f0b6409bda
sha1sum: e0bc828bd5be5f22f2f3f0095cdf9ca2d9752529

What's new:
  • - Added minimal LXDE window manager
  • - Remote desktop support
  • - Samba server
  • - AUFS support, this for read-only SD so that RPi can be powered off without doing a normal shutdown
  • - Added the emcweb interface
The preferred method of interfacing is using remote desktop. For windows, just run the following:

Code: Select all

mstsc /w:800 /h:600 /v:<ip address>
For linux:

Code: Select all

rdesktop -u rpi -p linuxcnc <ip address>
To test the web interface, just run the following command:

Code: Select all

[email protected]:~$ linuxcnc /usr/local/share/doc/linuxcnc/examples/sample-configs/sim/emcweb.ini
Then point your browser to http://<ip address>:8080

For read-only SD card (similar to livecd), the RPi can be turned off at any time without issues. The only drawback is that any changes to the system will not survive a reboot. Normally setup the system to your liking and then store important data to an external drive or an network share. Once everything is ready, just edit /boot/cmdline.txt and add the rwfs=tmpfs entry:

Code: Select all

xeno_nucleus.xenomai_gid=1000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait rwfs=tmpfs
If you need to modify the system again, just remove the rwfs entry.

Cheers!
42

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

Re: LinuxCNC

Sun Jun 02, 2013 8:52 am

I've forgotten to cleanup the /boot/config.txt. Here is the clean version:

Code: Select all

kernel=kernel_aufs.img
arm_freq=800
core_freq=250
sdram_freq=400
over_voltage=0
gpu_mem=16
Cheers!
42

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

Schem hey I have recently taken up the project again

Sun Jun 09, 2013 5:00 am

Have a good understanding now and have summer to do this. so are they any things I could leave out of the breadboard version of picnc such as some of the ports or do i need all of them.

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

Re: LinuxCNC

Sun Jun 09, 2013 5:56 am

The bare minimum you'll need is the step/dir signals for x, y & z axes and 3 limit switches.

You can leave out U3 and if you are using pololu drivers you can also remove U2. The pololu drivers can work with 3.3v inputs.

Cheers!
42

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

PIC

Sun Jun 09, 2013 7:08 pm

I don't even know where to begin when programming the pic does anybody have a premade file or something neccesary because I am looking at the stepper files in mpide and have no idea what to do.

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

PIC Proggraming

Sun Jun 09, 2013 7:13 pm

Kinsa do you have the files because I will have a similar setup to you I will use the polulu boards with bipolar 2 phase steppers if you or anyone could give me the files thx. I know I would have to edit them a little bit to fit my steppers steps/other things but if anyone could help walk me through this part that would really help

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

Re: LinuxCNC

Sun Jun 09, 2013 10:35 pm

Show me how you wired your system up so I can create a firmware for you.

What OS are you using? I'm running linux and everything is done using the command line. Except for code editing, which I use scite.

Do you have a programmer or are you going to use RPi for that?

Cheers!
42

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

thanks

Mon Jun 10, 2013 4:28 am

Thanks so much but I am not quite done with the circuit and don't have my polulus yet. I will use RPI as programmer I will contact you by the end of the week with more details and hopefully a setup. You are really good at this. Just figured out I'm busy till Thursday but thanks for the offer.

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

HEX file

Mon Jun 10, 2013 11:47 am

Attached is the firmware for this setup.

I will post the writeup on how to modify the firmware for the breadboard version soon.

Cheers!
Attachments
picnc_bb.hex.gz
(6.08 KiB) Downloaded 334 times
42

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

Stepper and polulu

Mon Jun 10, 2013 9:08 pm

I have been looking at steppers for under ($8) and found http://www.mpja.com/Stepper-Motor-NEMA- ... 0228%20MS/ there is not a pin out that I know of I think I will buy these. But I know polulu is a relatively cheap driver but do you or anyone else know of other cheap drivers not that I need anything less expensive but does anyone know of other options. By the way Kinsa do you think the steppers are good enough.

What polulu would I use for this motor

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

Re: Stepper and polulu

Mon Jun 10, 2013 11:34 pm

Beutrocks wrote:I have been looking at steppers for under ($8) and found http://www.mpja.com/Stepper-Motor-NEMA- ... 0228%20MS/ there is not a pin out that I know of I think I will buy these. But I know polulu is a relatively cheap driver but do you or anyone else know of other cheap drivers not that I need anything less expensive but does anyone know of other options. By the way Kinsa do you think the steppers are good enough.

What polulu would I use for this motor
The stepper looks ok but it really depends on where you will use them. The holding torque is the smallest for the series, ~8.5 oz-in.

The A4988 driver is good provided you don't overheat them. This is what I use for my small machine.

Hope this helps.
42

Beutrocks
Posts: 52
Joined: Mon Apr 22, 2013 4:00 am

Reccomendations

Tue Jun 11, 2013 1:15 am

I did some reaserch and 8.5 is nothing I need around 100 do you have any reccomendation s on that site for under $8. Also please pair a polulu with it.

Return to “Automation, sensing and robotics”