Controlling ULN2003 stepper motors with multiplexing on shift registers

Hey forum,does anybody know a way to split certain data like cnc code to a shift register so that to get the missing z axis data is sent over to a SIPO register using the nano because it has limited pins?thanks

gfxgrafix:
split certain data like cnc code

Is it CNC code or is it something else?

And "CNC code" could mean anything starting from GRBL commands down to step and direction instructions for a stepper motor.

If you provide an example of what you want to split it will be a great deal easier to help.

...R

PS ... I suspect the simplest solution would be to replace the nano with a Mega

hey robin thanks for your response am trying to build a 3d printer with uln2003 drivers because sadly in my country that is the available hardware.Am running an adrino nano because also adrino mega is hard to come by anyways av been reading into Numerical control language so when I say G code it encompasses NC languages in this case am using the HP-GL markup and runing this software uCNC_controller/uCNC.h at master · dherrendoerfer/uCNC_controller · GitHub

but feel free to use any g.code language to explain the concept

now my question is how can I initialize some sort of communication protocol (or service interrupt routine ) to that data representing the Z axis or (&) the feed-rate can be sent and split over to two shift registers using the remaining available pins so that the motor of the z axis will move up at every end of the x+y movement am also using maker cam to generate the g.code then manually editing it.

I have to admit actually writing this down has sort of helped me figure it out but there are still many blank holes.Your help will be most valued.

gfxgrafix:
now my question is how can I initialize some sort of communication protocol (or service interrupt routine ) to that data representing the Z axis or (&) the feed-rate can be sent and split over to two shift registers

I vaguely know what HP-GL is (we had a HP plotter in work a very loooonnng time ago) and, yes, it is conceptually similar to GCode.

But before I can consider your question you have to explain how the HP-GL is being interpreted to provide the low level instructions for the stepper motors.

Have you written an Arduino program to do that?

Or are you interpreting the HP-GL on your PC and just sending low-level instructions to the Arduino?

It seems to me that directing the steps to specific motors can only happen when the Arduino has the low level motor instructions.

...R

Robin2:
I vaguely know what HP-GL is (we had a HP plotter in work a very loooonnng time ago) and, yes, it is conceptually similar to GCode.

But before I can consider your question you have to explain how the HP-GL is being interpreted to provide the low level instructions for the stepper motors.

Have you written an Arduino program to do that?

Or are you interpreting the HP-GL on your PC and just sending low-level instructions to the Arduino?

It seems to me that directing the steps to specific motors can only happen when the Arduino has the low level motor instructions.

...R

yeah that is correct I am trying to run low level instructions from the arduino hence the use of hp-gl which is just simply the G.code converted through a hp-gl driver converter.in keeping with the low level instructions but since the nano has limited pins I am trying to in-cooperate a shift register or two so that serial data for driving a motor can be sent separate from the x and y but still be in sync so that all tasks are completed together and maybe run a motor attached to a bit for 3d carving or 3d printing capabilities if am really pushing it but I need two extra outputs from the Arduino to the two shift register because a shift register can latch onto data and spit it out to the stepper driver at the appropriate time.Maybe the data can be sent on the rising clock and stored then rapidly read?maybe am crazy but Av been thinking about it and should work..Am just trying to brute force it.Av tried using processing software but am trying to stick to arduino so that I can also focus because am comfortable in this environment.I would like to hear your approach to this low level programming for all axes.

Also i am interpreting everything on the computer to take out most processing power needed since the 3rd axis does not exist in plotters what do I have to do to get this functionality as a broader term or concept

gfxgrafix:
t I am trying to run low level instructions from the arduino hence the use of hp-gl which is just simply the G.code converted through a hp-gl driver converter.in keeping with the low level instructions but since the nano has limited pins I am trying to in-cooperate a shift register or two so that serial data for driving a motor can be sent separate from the x and y but still be in sync

I can't get my head around that because you are not providing enough detail. I have the impression that whatever concept you have in mind for splitting stuff is unrealistic - but that may be just because I don't understand. Having said that, I do believe that it ought to be possible to operate one motor via some shift registers.

Also i am interpreting everything on the computer to take out most processing power needed since the 3rd axis does not exist in plotters what do I have to do to get this functionality as a broader term or concept

Please explain in a lot more detail what actually happens on the PC program and how it relates to the Arduino. if you are using an off-the-shelf program on your PC please say what it is called and provide a link to where you got it.

Provide details (some example preferrably) of the messages that the PC sends to the Arduino.

If the Arduino program is one that you downloaded from somewhere then tell us what it is and provide a link to where it came from. If it is a program you wrote yourself then please post the program and describe how it works.

Maybe it would be an idea to describe how a specific HP-GL instruction is handled from start to finish.

...R

gfxgrafix:
uCNC_controller/uCNC.h at master · dherrendoerfer/uCNC_controller · GitHub

that is the link to the software that runs the 2d plotter it uses

hp2xx first converts all HP-GL data into pure vectors and buffers them
internally. It then converts these vectors into a specified output format
(vector modes), or rasterizes them (raster modes) on an internal bitmap.
In raster modes, hp2xx then translates the bitmap into the output format. example code where I want to get values of F and E (also so called z) or extrude the arduino reads x and y values correctly.What do I require in terms of hardware and software to actually make it work?I can manually edit the code where nessesary
this is part code for a 3d object

M400
M106 S255
G1 X0 Y0 Z0.5 F1200
G1 X51.08 Y51.01
; TYPE:SKIRT
G1 Z0.4
G1 X52.42 Y49.99 E0.056 F600
G1 X55.61 Y50 E0.162
G1 X56.92 Y51.02 E0.218

the data is organized into specific instructions...The first part and the second.It would be nice to isolate these data and see how the process works

Default configuration:

Connector IO-Ports on Arduino nano w. ATMEGA328P
------------>--------------------------------------------
Stepper 1: 8,9,10,11
Stepper 2: 4,5,6,7
Stepper 3: A5,A4,A3,A2 (digital out 19,18,17,16)
12V out 1: 2
12V out 2: 3
Laser out: 13
Servo out: 12
Unused : A0,A1,A6,A7 (A6 and A7 cannot be used as output)
according to the documentation ,but now that uln2003 has 5 pins to be driven instead of four I may need a buffer register to temporally store the values since the pins are far less

When I look at the link you gave in Reply #6 (more precisely, at this link) it says

uCNC_controller is a g-code interpreting controller app that is intended for use on the Arduino platform.

I don't see any mention of HP-GL.

In any case my guess is that to control the stepper motor for the Z axis through some shift registers would require modification of the uCNC code. And, sorry, I don't have either the time or the patience to learn enough about uCNC to figure out how to do that.

...R