Stepper motor pulses

Hi!
Been playing around with my new “Santa scope” pretty good I think for the money! Anyway – the attached screen shot is a trace of the output pulse from two of the four pins driving a stepper motor, (via a L293D), from a 28X2, pins C.5 and C.7. Would you expect to see double pulses on pin C.7, when the other three pins only have a single pulse per cycle? The traces are taken simultaneously. Using ‘westaus55's’ code to do half stepping to drive the motor.
Stepper trace pins 5 and 7.jpg
 

rq3

Senior Member
Hi!
Been playing around with my new “Santa scope” pretty good I think for the money! Anyway – the attached screen shot is a trace of the output pulse from two of the four pins driving a stepper motor, (via a L293D), from a 28X2, pins C.5 and C.7. Would you expect to see double pulses on pin C.7, when the other three pins only have a single pulse per cycle? The traces are taken simultaneously. Using ‘westaus55's’ code to do half stepping to drive the motor.
View attachment 15650
What happens if you set the scope trigger to Channel 1, rather than Auto?
 

bfgstew

Senior Member
Are these outputs traces from Picaxe pins or from the outputs of the L293? And do any others show this output?
 
The traces are taken direct from the Pcaxe pins C.4 to C.7. The Picaxe is running at 4MHz. As a matter of interest attached is a trace taken off two output pins of the L293

Stepper trace from L293.jpg
 

eclectic

Moderator
Rather than us searching,

can you supply the code you used?

Then, someone else with the "Santa scope"
may be able to reproduce
then investigate your results.

e
 
Attached is the code that is driving the motor.

Code:
rotateA:    				
	for w15 = 0 to steps    			     
      dec b2   		    
      gosub step1 				
	next w15     	
	return	
rotateB:
	for w15 = 0 to steps    	    
      inc b2     
      gosub step1 				
	next w15     	
	return

step1:				'line 202 to 207 motor
					'step sequence (1/2 step)
		b2 = b2 & %00000111
			lookup b2,(%00100000,%01100000,%01000000,%01010000,%00010000,%10000000,%100000000,%10100000),b3
			pinsC = b3  		
	return
 

AllyCat

Senior Member
Hi,

Breaking the lookup into separate values/rows probably shows what has gone wrong:

Code:
%00100000,
%01100000,
%01000000,
%01010000,
%00010000,
%10000000,
[B]%100000000[/B],
%10100000
Cheers, Alan.
 

oracacle

Senior Member
yeh there are 2 of the same value in there

Code:
%00100000,
%01100000,
%01000000,
%01010000,
%00010000,
[B]%10010000,
%10000000,[/B]
%10100000
should it not be something lke this
 

AllyCat

Senior Member
Hi,

yeh there are 2 of the same value in there
Actually, no there aren't! My bolded line has 9 bits, so a value of 256, which the PICaxe will interpret as a zero byte (hence the gap in the pulse). I had hoped that the OP could work out the rest from there, ;)

Cheers, Alan.
 

oracacle

Senior Member
Hi,

Actually, no there aren't! My bolded line has 9 bits, so a value of 256, which the PICaxe will interpret as a zero byte (hence the gap in the pulse). I had hoped that the OP could work out the rest from there, ;)

Cheers, Alan.
sorry. miss read it when skimming through
 
Once again thank you all for your input. It just shows how careful you must be when checking through your code. No syntax or debug check highlighted the error or at least non what I could see, and I doubt very much I would have picked it up. It was following a comment “hippy” made in an earlier post “keypad to display” that pointed me to the stepping routine which I changed. It was only when I started to look at was happing at the output pins that I picked up what I thought shouldn’t be there; your help did the rest! The moral, if there is one, is buy yourself a DP Scope!

Sorry - read happening for happing!
 
Last edited:
Top