Go Down

Topic: How to automatise my stepper motor  (Read 368 times) previous topic - next topic

Nicolas_L

* I have four dosing stepper motor pump,
* one sliding gate motor, which work with three trigger position
1. stop
1. forward and
1. backward
*some micro switches.
*and three water tanks.

> I want to dose chemicals to the three tanks. The chemicals need to put one by one with different volumes with each pump.
The sliding motor move to the first tank and the first dosing stepper motor pump a certain volume, then move to the second tank, then to the third one. And back again for the second dosing stepper motor to pump and so on.
I am using arduino Uno, TB6560 driver for the dosing stepper motor pump.

I am trying to use

#include <Stepper.h>
#include <AccelStepper.h>

groundFungus

Quote
#include <Stepper.h>
The Stepper library will not work with those step/dir type stepper drivers.  The AccelStepper library will.

What is your question?   What, specifically, do you want help with?

Nicolas_L

Thanks for reply. I am stuck.
I have two sketch and I can't merge them.
The micro switch is to trigger the gate motor forward, stop and backward a sliding gate motor which will be used to travel upon three tank. Each time the gate motor will stop on a tank, the stepper dosing pumps start to pump for a certain time, then the gate motor move to another tank and repeat the pumping and after the third tank the gate motor return and stop to the initial position. to finish his job.

The stepper dosing pump are fixed on the Gate motor

groundFungus

It would help if you post a schematic of your project.  Include all parts, with part numbers and/or values and all power supplies.

Nicolas_L

Please find attach photo.

Nicolas_L

Hi All,
It seem that my  schematic has been download 10 times.
I want to know if this code can be merge or be written another way.
May be in tabs.
Any ideas ?
Thanks

PaulS

Quote
I have two sketch and I can't merge them.
Forget the two sketches. Define the requirements for THE program you want. Then, set about implementing those requirements. You can certainly rely on the existing sketches for ideas/complete functions, but they are useless blobs of text until you have requirements.

Quote
I want to know if this code can be merge or be written another way.
Almost certainly. Whether the resulting program does anything remotely like what you want is a different story. Since we don't know what you want, it is pointless to ask us about how to  merge the programs.

Quote
May be in tabs.
Or slots.
The art of getting good answers lies in asking good questions.

Nicolas_L

Thanks for your reply.

I have change the arduino UNO for one MEGA.
One  button (4) has been added to start the code.

I wrote another code and its work, but the only problem I got.
Is, my relay are ON when I powered the all  system. I have connect the rail motor to the Normally Closed on the relay, Its work but I have conflict.

I want when I power the system all the relay stay Off. and when I press the button 4 the relay got power and become ON and do the sequence.

PaulS

Quote
Is, my relay are ON when I powered the all  system.
Would those be the relays connected to stepPin1, stepPin2, stepPin3, and stepPin4?

Or would those be the relays connected to led1Pin, led2Pin, and led3Pin?

Why don't you write the pins to the state you want them to have, instead of assuming that the Arduino will do that automagically?

Code: [Select]
  { buttonState1 = digitalRead(button1);
    buttonState2 = digitalRead(button2);
    buttonState3 = digitalRead(button3);
    buttonState3 = digitalRead(button3);
    }

What is this code for? You never use these values.

Code: [Select]
  while (true) 
  {

Another dweeb that doesn't understand that loop() loops.
The art of getting good answers lies in asking good questions.

Go Up