Tech project help


hey guys,
i creating system cycle test doorknob. seen in picture, have 2 stepper motors. nema 17, , nema 23.

nema 17 drives platform in leaner direction via lead screw.
nema 23 motor turns door knob.

want want system do:
1. nema 17 drives platform moving 2", movement engages doorknob strike plate (not shown in drawing)
2. nema 17 motor stops.
3. nema 23 turn doorknob unlocking strikeplate.
4. nema 17 drives platform 2" original position.
5. nema 23 motor turns doorknob original position.
and cycles repeats.
i understand drawing not correct, concept.

my question is, code have has no initial delay, power it, turns on.
how can add delay?
could add keyboard button when press it, turns on beginning of code?
how can add other stepper motor.
if need more pictures of clarification let me know
thanks in advance

arduino uno
tb6600 drivers (2x each stepper)
nema 17
nema 23
12 v power supply

i have code 1 working motor.
code: [select]
long distance = 0;  // record number of steps have taken

void setup() {
 pinmode(8, output);
 pinmode(9, output);
 digitalwrite(8, low);
 digitalwrite(9, low);
}

void loop()  {
 digitalwrite(9, high);
 delaymicroseconds(1000);
 digitalwrite(9, low);
 delaymicroseconds(1000);
 distance = distance + 1;  //record step
 // check see if @ end of our move
 
 if  (distance == 475)
 {
   // are! reverse direction (invert dir signal)
   if (digitalread(8) == low)
   {
     digitalwrite(8, high);
   }
   else
   {
     digitalwrite(8, low);
   }
   
   distance = 0;
   
   delay(2000);
 }
 
}

you need explain how 'delay' fits within sequence described. want one-off delay when device powered up, or looking start/stop switch?

the code have seems drive couple of outputs guess step , direction inputs stepper driver. if driver you're using shield need @ spec understand how many stepper motors it's capable of driving. if it's separate board expect add couple of motors. approach you're using in sketch ok long want move 1 stepper @ time , don't need sketch control else while doing that.


Arduino Forum > Using Arduino > Project Guidance > Tech project help


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support