Go Down

Topic: stepper pulse signal supply (Read 3904 times) previous topic - next topic

sheepconveyor

hi all

i am a complete novice at this but we are developing a system where we are trying to control two gates with stepper motors, it was thought we could run these via a mitsubushi alpha  controller but it cant develop the pulse speed we need it was suggested by a supplier that an arduino board could do this,

what i want to do is send a pulse to the arduino mega 2650 and it controls the dir, and pul ofsetting for the motor drivers which are cw5045 type they need 5 volts according to there manual im trying to get 195 pulses forward delay 0.5 seconds then 195 pulses in reverse according to the stepper manufacturer the need to be 5 micro second long i think

i need the mega to hold the program to when its off if that can be done. or do i need a different unit.

please help of any of you clever people would be appreciated im no electronics engineer so an idiots guide would be appreciated.

thks

Robin2

It would have been helpful if you had supplied a link to the stepper driver datasheet to save me having to look it up on Google.

It seems to be a perfectly normal stepper driver that should easily be controlled with an Arduino Mega (or Uno).

My brief read of the datasheet leads me to think the pulses must be greater than 10 microsecs.

I don't understand the paragraph in which you describe what you want to do.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

MarkT

The way you wire it up is ground to PUL-, DIR- and ENA-,
and connect a pin for stepping to PUL+, direction DIR+.  ENA+
can be left open circuit if not required (it will default to enabled).

Step pulse are positive edge triggered, pulses need to be 10us or more
HIGH, code something like this if doing it by hand:
Code: [Select]

void step (boolean dir)
{
  digitalWrite (dir_pin, dir) ;
  delayMicroseconds (5) ; // paranoia
  digitalWrite (step_pin, HIGH) ;
  delayMicroseconds (10) ;
  digitalWrite (step_pin, LOW) ;
}



For driving a motor slowly (without acceleration ramp)
Code: [Select]

  for (int i = 0 ; i < 195 ; i++)
  {
    step (true) ;
    delay (50) ;  // tune to suit motor
  }
  delay (500) ;
  for (int i = 0 ; i < 195 ; i++)
  {
    step (false) ;
    delay (50) ; // tune to suit motor
  }

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

sheepconveyor

hi

thks very much for the replies

i know im not far away but i am a complete novice at this and its difficult for me to get my head round the various bits.

if i send a signal to the mega a short 10micro second pulse can it then do the 195 pulses positive and then a delay then 195 pulses again and stop reset and await the next signal.

ill have to do this on two sets of pins as there are two steppers to control.

sry im not good at describing whats needed and didnt include links direct to the pages re the driver but both this stepper control and the forum here are new to me


Robin2



if i send a signal to the mega a short 10micro second pulse can it then do the 195 pulses positive and then a delay then 195 pulses again and stop reset and await the next signal.



I wonder if you need to rewrite your description?

As I read it something sends a short 10usecs pulse to the Mega and when the Mega detects that pulse it steps the motor 195 steps in one direction followed by a delay followed by 195 steps in the opposite direction?

What sends the pulse to the Mega? Why is it only 10usecs long?

If I have correctly interpreted what you want the Mega (or an Uno) would be well able to do it. With a very short input pulse you would probably need to use an interrupt to detect it.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

sheepconveyor

hi

thks for your input on this it is causing me a great deal of headaches as i am completely new to this.

i have a mitsubushi alpha simple application controller on a machine and it is controlling a series of conveyor belts, and inside this  is a sub routine working from a weighscale to select a gate in a shedding crate which allows the left hand or right hand gate to be opened, the original idea was to let the alpha develop a pulse train for the steppers  however the mininmum pulse length the alpha can give out is 10 millisecs, if i do this and send it to the steppers they open and close completely but a bit hit and miss as the pulse lengths dont get recognised by the motor driver.

i can get the alpha to send a single pulse to the mega at any length up to many seconds by no shorter than 10 millisecs my idea was to use two pins on the mega as signal pins one to signal left gate and one to signal right gate and then as you correctly surmised send 195 pulses delay then another 195 pulses of one pin for the left gate and one pin for the right gate this will open the gate 35 degrees then close it

i am no expert on this stuff in fact a complete novice, i also want the mega to hold the program and of course it has to be able to cycle itself eg its like a production line

im sorry if im not making myself clear but im not sure of all the correct terms etc for this type of work

Robin2

#6
Jan 11, 2014, 05:30 pm Last Edit: Jan 11, 2014, 05:34 pm by Robin2 Reason: 1
In your latest post you say that the mitsubishi sends 10 millisecond pulses whereas in your earlier post you said it was 10 microseconds - a difference of 1000. Which is correct?

Before you design your Arduino program you need to consider the overall logic of your system. For example can the Arduino be sure that a second command won't come from the mitsubishi while it is moving a stepper motor. Or does it have to be able to receive multiple overlapping commands from the mitsubishi?

If there can only be a single command at any one time the code will be simple, and something like this pseudo code

Code: [Select]
loop
  if left pin is high move left motor
  if right pin is high move right motor


By the way, if the only problem is that the mitsubishi pulses are too wide for your stepper controller I suspect it would be easy to make an electronic circuit for a few pence which would produce a short pulse every time the mitsubishi sent a pulse. I'm no good at analog electronics so I won't suggest how to do this. Someone else may be able to help if you are interested.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

sheepconveyor

hi robin2,

thks again for your help.

mitsuushi will only do single pulse to 10 milli secs my mistake the first time my head is spinning with this stuff

i need to control the gates with the pulses generated from the mega i have tried just about everything else, mitsubushi recommend i go up a controller to a plc with transistor outputs to get the pulses i need but i dont have the luxury of time on this project and i need the gates to open stop and close so this is my only short term option but without the programming experience i think basically i am out of luck here to

again  thanks for your help i have really appreciated it

Robin2

I posted a short sketch that demonstrates moving a stepper motor in Reply #7 on this thread
http://forum.arduino.cc/index.php?topic=208905.0

It may help you to get started. I think it should work with your stepper drivers.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

sheepconveyor

thks again ur great help another step forward haha

got the led blinking starting to understand a bit better

m

Go Up