Getting pulses to control a separate stepper driver

Staffscrocs

New Member
Hi, I am building a power feed system for a machine in my home workshop. I have a large stepper motor (7.8A) and its proper commercial driver but to control the functions I need a few basic inputs and a variable trigger pulse to feed to the driver.
I am fairly new to PICs and not sure of the way forward for the pulse thing. I have sorted out enable and direction signals OK.
What would be the best route to try with the picaxe programming? I have an ordinary 18 chip at present and wonder if I need an 18x with PWM and use that feature?
Any suggestions gratefully received!
Regards
Les
 

Rickharris

Senior Member
I would suggest reading the interface PDF file in the programme editor help. - search for Stepper motor There are sample programmes that might help you.
 

Staffscrocs

New Member
Thanks Rick,
I don't need to program the chip as a stepper driver, I am using a big commercial driver unit. What I need are the pulses that trigger the commercial driver unit. The motor runs at 400 pulses per revolution so I need something to generate and vary the frequency of these to control the driver unit.
Les
 

RMParkhouse

New Member
well im not very experienced in electronics or anything but in school when we want to play with CRO's we just hooked up an astable 555 timer and used either a variable capacitor or change the circuit slightly nd used a variable resistor to control the frequency. you might need to amplify the signal slightly but that might work, but ofcourse im only a novice as far as electronics goes so maybe it wouldnt work for what you want
 

Staffscrocs

New Member
My initial thoughts were with a 555 and I have tried using one. It works but the variable bit is not so good. I have been told that I should be able to do the job easier and neater with PICs.
I just want the PIC to send pulses like the 555 but allow me to vary the frequency more precisely. I am considering an input switch with, say, 10 different resistance values so the PIC would give 10 different speed signals to the stepper driver. I am playing with PULSOUT at the moment but wonder if PWMOUT would be better?
 

BeanieBots

Moderator
You've not indicated any specification for the pulses. Do you require a variable frequency square wave or would a pulse stream be OK? What sort of frequency do you need?

To get a pulse stream all you need is something like this.

main:
pulsout 1,N
pause D
goto main

where N is the pulse width in 10's of uSecs.
and D is the time delay between pulses in mSecs.
The loop itself will take about 500uS which will need to be taken into account.

Both N and D can be substituted for variables which the rest of your program can change as required.
For input control, consider using a potentiometer and an analog input. This would give you 256 speed steps.
 

Staffscrocs

New Member
I need just a stream of square wave pulses that can be varied in frequency.
The commercial driver has an opto-isolated input that accepts 5 volt 12mA pulses to trigger a step. The lowest driver setting for steps is 400 pulses per motor revolution. I would like the motor to do a minimum of 10 RPM up to maybe, 200 rpm. So we are talking 66.6 pulses per second to 1333.3 PPS to achieve this.
A potentiometer is an obvious advantage and I would like to go that way. I was initially doing fixed speeds to make it easier to program with my slowly developing skills!
 

BeanieBots

Moderator
The method I described will be close but it could not get up to 1333.3 PPS.
(probably about 990 PPS max. when you include a readadc command)
You might like to consider over-clocking to get the extra frequency. Doubling the clock frequency would give you delays of 500uS steps.
 

Staffscrocs

New Member
Experimenting this afternoon, I have put in

Main:
pulsout 3,1
pulsout 3,1
goto main
I think this should be the fastest pulse rate I can get and certainly gave the fastest RPM of the motor at about 140 RPM.
I now need to get another PIC as mine (basic 18) cannot do higher frequency on the clock. Looking at a post here by Chris deHut, I will try a 28x and use the pot program he was given.

Thanks for the help thus far!
 
Top