What device should I use?

Hello everyone, please excuse the simplicity of this question, but I'm new to electronics and I've been scratching my head for a couple of days. I have a borad through which I can control two nema steppers with joystick modules, but due to space constrains, I can only use one joystick in my panel, so I was thinking of splitting the joystick X and Y cables into two different pairs (each pair corresponding to each one of the motors) and then use a pushbutton to select which one of the motors I want to control and display the one currently being controlled. Question is what exactly should I use to do this? The piece I'm missing is the one with question marks. Please note that the wires are just a representation:

|500x261

Also, I don't need code or anything because I want to learn, I just would like to know what I need to keep learning.

Thanks a lot in advance!

Am I correct in thinking that the board you already have takes the outputs from two potentiometers to control the motors?

I ask it like this because a joystick usually has two potentiometers and 2 joysticks would thus have four potentiometers.

Perhaps you can post a link to the datasheet for the existing controller board?

If the board connects directly to potentiometers then any Arduino solution would probably need to use the Arduino to control digital potentiometers that have the same spec as the existing manual potentiometers.

Assuming it is possible to produce suitable signals for your controller board it should certainly be possible to use a switch to select which motor you want to control.

...R

The joysticks I've used only have 2 potentiometers, one for x another for y.

It would help to know what hardware you have. My guess is that the joystick connects to the arduino and not to the motor controller board.

If so then you do not need to split wires or any more hardware, it can be done in code. Simply use the button to determine which stepper the joystick is controlling at the moment.

Hutkikz:
My guess is that the joystick connects to the arduino and not to the motor controller board.

Just to clarify my earlier Reply …

My impression (which may be wrong) is that the OP already has a non-Arduino board that takes inputs from joysticks (one for each motor) and he wants to add an Arduino into the picture so that he can control both motors (one at a time) with a single joystick - using the Arduino to “pretend” to be two joysticks.

…R

The board I have can manage two joysticks no problem, it has enough pins that I can configure to read the output from the joysticks. My issue is panel real estate, besides the fact that I don't want to use two separate actual joysticks, I would rarely, if ever, need to do so, that's why it makes more sense to use just one and cycle where its signal goes than having two separate ones.

EDIT: To add to the answer, yes, I could plug all four potentiometers in my board and read their output with no issue. I just need help figuring out what to use as the "? ? ?" device in my image. Also, I think that the idea would be easier to understand if the text on the 1602 said "Now controlling motor A (or B)"

Analog mux…

8 channel ADC with SPI interface. Way faster than using Arduino's ADC. http://www.digikey.com/products/en/integrated-circuits-ics/data-acquisition-analog-to-digital-converters-adc/700?k=adc&k=&pkeyword=adc&pv153=4&FV=fff40027%2Cfff80183%2Cfffc0096%2C3cc004e%2C1f140000%2Cffe002bc%2Ca6c003c&mnonly=0&newproducts=0&ColumnSort=0&page=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25

Thank you very much, Crossroads, could you please elaborate just a little bit? This looks fairly complicated for a simple switch, but I want to learn.

or a simple 2P C/O switch.

regards

Allan

Thanks, do you have a part number? Google shows me very weird unrelated results.

eg

http://www.ebay.co.uk/itm/5pcs-3-Position-2P2T-DPDT-ON-OFF-ON-Miniature-Mini-Toggle-Switch-/252551194209?hash=item3acd396661:g:h14AAOSwzaJX4wfN

and there are lots more..

regards

Allan

Hi,
Welcome to the forum.

Hello everyone, please excuse the simplicity of this question, but I’m new to electronics and I’ve been scratching my head for a couple of days.
I have a borad through which I can control two nema steppers with joystick modules,
but due to space constrains, I can only use one joystick in my panel,
so I was thinking of splitting the joystick X and Y cables into two different pairs (each pair corresponding to each one of the motors)
and then use a pushbutton to select which one of the motors
I want to control and display the one currently being controlled.
Question is what exactly should I use to do this?
The piece I’m missing is the one with question marks. Please note that the wires are just a representation:

I’m confused because you have 2 outputs from ONE joystick to 2 motors.
Make the Y axis control one motor and X axis control the other, use two analog inputs, the stepper control board will have two SEPARATE drivers and two SEPARATE sets of INPUTS.

Can you post link/data of the driver
Can you tell us your electronics, programming, arduino, hardware experience?

This is my suggestion, concept only NOT a CIRCUIT DIAGRAM.
Lcm5pPncc.jpg
Tom… :slight_smile:

The concept in my head was the same as illustrated by @TomGeorge.

But I had been hoping (in Reply #1) that the OP would have provided more technical detail about the connections between the existing board and the joysticks.

My wild guess is that the lines that @TomGeorge has marked X and Y have to be the outputs from digital potentiometers controlled by the Arduino.

...R

Hi,

My wild guess is that the lines that @TomGeorge has marked X and Y have to be the outputs from digital potentiometers controlled by the Arduino.

If they are steppers and the stepper driver is a stand alone one, then the pairs would be direction and step for X and Y. I forgot to connect gnd of driver pcb to UNO.

Tom.... :)

Ok, I was intentionally vague about the second board because it has an easier way of doing this and I didn't want to be told to go that way. It is a laser cutter with a Smoothieboard. I know I could use motor A for X/Y and motor B for just Z and use an additional pin for the switch module it provides, but I'm also planning to use a bunch of sensors I'd like to control with the arduino. That's why I was trying to leave the joystick signal away from the arduino and just use it as a way to switch where the signal goes. As far as my experience goes, I've been doing php for years (+5) and C++ on and off during the same time. About electronics, I just started this year, as you can suspect.

Going back to the topic, TomGeorge's idea could work too, as long as the arduino introduces no delay and there's a way to switch where the signal goes: Motor A would be XY and motor B would be Z. I could just use one pin instead of two for Z, or I could make both pins jog the Z axis.

I also like Allanhurst's idea a lot, and it's very much like what I have in mind, if there was only a version of that switch that could be controlled via Arduino.

TomGeorge: Hi,If they are steppers and the stepper driver is a stand alone one, then the pairs would be direction and step for X and Y. I forgot to connect gnd of driver pcb to UNO.

Sorry, but that does not make sense to me.

The OP started by telling us that the original control board connects to his joysticks. Joysticks do not produce step and direction outputs. They just vary a voltage.

@DudeMcLovin - please post a link to the datasheet for your existing controller board because without that we are all just making wild guesses that may be no help at all.

...R

Not sure if this qualifies as a data sheet, but here we go. Also, it seems I can do this with a cd4066, been reading into it, but not sure yet. In a nutshell, what I want to do is take the output from the joystick (two pins) and send it to either pin set A or pin set B on the board using a button connected to Arduino.

This is another way of looking at what I need: I have an original signal that needs to be rerouted to either route A or route B through a push button connected to Arduino. Not sure if it really makes sense:

|427x500

Seems I can do it with a CD4066, but I'm still not clear.

It's called a 2p c/o relay - does the same job as a switch when you energise the coil.

You need to drive it with a transistor/logic level mosfet - the arduino won't supply enough current

for further details etc....

regards

Allan.

DudeMcLovin: Not sure if this qualifies as a data sheet, but here we go.

In your Original Post you said

I have a borad through which I can control two nema steppers with joystick modules

but when I look at the link in Reply #16 I can't see any information about how you can connect joysticks to the "Smoothieboard"

Can you explain it?

...R