Hello all,
I'm a first-time-user, with less or no experience with linuxcnc.
I build a simple XY plotter for any pen, but I'm completely unable to connect it to linuxcnc.
On a Raspberry 3B with python3 I wrote a program that can drive XY & servo.
It can draw its maximum usable square (1000x6000 full- and halfsteps).
Now I want to read G-code file and pass it to the plotter, but how?
I don't wanna re-write G-code converter for it, so thinking of linuxcnc should do it.
If it can drive my Four-Phase Step Types motors and the servo...
Each motor has its own start- and endswitch and should stay between those switches.
Diagram (of motor X-axis):Rpi pins GPIO Driver? 28BYJ-48
+
+ +
+ +
+
| rpi 18 +--1----IN1-+ L293D +---A---+ motor |
| 22 +--4----IN2-+ or +---A'--+ X |
| 24 +--5----IN3-+ ULN2003 +---B---+ |
| 28 +--6----IN4-+ +---B'--+ |
| | +
+ +
+
| 38 +
SWstart
| 40 +
SWend
+
+
What I know about linuxcnc is that I can NOT use Stepconf or CNFconf wizard, as I don't use MESA or parallel/PCI cards.
So I have to use hal-config, but there goes the trouble.
1 motor runs half-step, the other full-step.
From:
linuxcnc.org/docs/2.8/html/hal/rtcomps.html#sec:stepgen
The motors are bipolair stepper, so within halcmd I've to use: loadrt stepgen step_type=6,9,1
This creates all necessary pins (In my eyes even too much. Can it be done with less?)
--
Component Pins:
Owner Type Dir Value Name
4 s32 OUT 0 stepgen.0.counts
4 bit IN FALSE stepgen.0.enable
4 bit OUT FALSE stepgen.0.phase-A
4 bit OUT FALSE stepgen.0.phase-B
4 bit OUT FALSE stepgen.0.phase-C
4 bit OUT FALSE stepgen.0.phase-D
4 float IN 0 stepgen.0.position-cmd
4 float OUT 0 stepgen.0.position-fb
4 s32 OUT 0 stepgen.1.counts
4 bit IN FALSE stepgen.1.enable
4 bit OUT FALSE stepgen.1.phase-A
4 bit OUT FALSE stepgen.1.phase-B
4 bit OUT FALSE stepgen.1.phase-C
4 bit OUT FALSE stepgen.1.phase-D
4 float IN 0 stepgen.1.position-cmd
4 float OUT 0 stepgen.1.position-fb
4 s32 OUT 0 stepgen.2.counts
4 bit OUT FALSE stepgen.2.down
4 bit IN FALSE stepgen.2.enable
4 float IN 0 stepgen.2.position-cmd
4 float OUT 0 stepgen.2.position-fb
4 bit OUT FALSE stepgen.2.up
4 s32 OUT 0 stepgen.capture-position.time
4 s32 OUT 0 stepgen.make-pulses.time
4 s32 OUT 781 stepgen.update-freq.time
--
How to I connect stepgen.0.phase-A to pin 18
stepgen.0.phase-B to 22
stepgen.0.phase-C to 24
stepgen.0.phase-D to 28 of the Raspberry Pi?
I can not find any example or how to do this.
Tried several days now but mostly my .ini file failes to load linuxcnc at all.
If linuxcnc does start, it has NOT my .hal file active?
And never I see any activity on my hardware.
Linuxcnc has so many options, I can't see through them all.
Can linuxcnc run on RPI and run direct attached motors, as in my diagram?
I've not seen this anywhere, all have 'different' drivers or driverboards.
Any help will be appreciated.
Regards, DGdodo