Stepper Motor to work like a DC
- BonoCNC
 - Offline
 - New Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 14
 - Thank you received: 1
 
			
	
						04 Apr 2024 08:50				#297563
		by BonoCNC
	
	
		
			
	
			
			 		
													
	
				Replied by BonoCNC on topic Stepper Motor to work like a DC			
			
				It's possible to make, via hal, my mesa board generate permanent steps to this motor, right after I turn on the machine?			
					Please Log in or Create an account to join the conversation.
- BonoCNC
 - Offline
 - New Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 14
 - Thank you received: 1
 
			
	
						04 Apr 2024 09:27				#297567
		by BonoCNC
	
	
		
			
	
			
			 		
													
	
				Replied by BonoCNC on topic Stepper Motor to work like a DC			
			
				# Step Gen setup
setp hm2_7i96.0.stepgen.03.steplen 1000000 # Step length (nanoseconds)
setp hm2_7i96.0.stepgen.03.stepspace 1000000 # Step space (nanoseconds)
setp hm2_7i96.0.stepgen.03.maxaccel 500000 # Maximum acceleration (steps/second^2)
setp hm2_7i96.0.stepgen.03.maxvel 5000 # Maximum velocity (steps/second)
setp hm2_7i96.0.stepgen.03.step_type 0 # Regular step type
setp hm2_7i96.0.stepgen.03.dirsetup 2000000 # Direction setup time (nanoseconds)
setp hm2_7i96.0.stepgen.03.dirhold 2000000 # Direction hold time (nanoseconds)
setp hm2_7i96.0.stepgen.03.control-type 1 # Control type (1 for position control)
setp hm2_7i96.0.stepgen.03.enable True # Enable the step generator initially
# Set initial direction for motor rotation
setp hm2_7i96.0.stepgen.03.direction 0
# Connect Step Gen outputs to motor driver
net motor-step => hm2_7i96.0.stepgen.03.step
net motor-direction => hm2_7i96.0.stepgen.03.dir
Can it be with something like this?
					setp hm2_7i96.0.stepgen.03.steplen 1000000 # Step length (nanoseconds)
setp hm2_7i96.0.stepgen.03.stepspace 1000000 # Step space (nanoseconds)
setp hm2_7i96.0.stepgen.03.maxaccel 500000 # Maximum acceleration (steps/second^2)
setp hm2_7i96.0.stepgen.03.maxvel 5000 # Maximum velocity (steps/second)
setp hm2_7i96.0.stepgen.03.step_type 0 # Regular step type
setp hm2_7i96.0.stepgen.03.dirsetup 2000000 # Direction setup time (nanoseconds)
setp hm2_7i96.0.stepgen.03.dirhold 2000000 # Direction hold time (nanoseconds)
setp hm2_7i96.0.stepgen.03.control-type 1 # Control type (1 for position control)
setp hm2_7i96.0.stepgen.03.enable True # Enable the step generator initially
# Set initial direction for motor rotation
setp hm2_7i96.0.stepgen.03.direction 0
# Connect Step Gen outputs to motor driver
net motor-step => hm2_7i96.0.stepgen.03.step
net motor-direction => hm2_7i96.0.stepgen.03.dir
Can it be with something like this?
Please Log in or Create an account to join the conversation.
- PCW
 - 
				
											 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 17380
 - Thank you received: 5068
 
			
	
						04 Apr 2024 13:49				#297574
		by PCW
	
	
		
			
	
	
			 		
													
	
				Replied by PCW on topic Stepper Motor to work like a DC			
			
				Try this:
setp hm2_7i96.0.stepgen.03.steplen 20000 # Step length (nanoseconds) 20 usec
setp hm2_7i96.0.stepgen.03.stepspace 20000 # Step space (nanoseconds) 20 usec
setp hm2_7i96.0.stepgen.03.maxaccel 50000 # Maximum acceleration (steps/second^2) so 1/10 second to full speed
setp hm2_7i96.0.stepgen.03.maxvel 5000 # Maximum velocity (steps/second)
setp hm2_7i96.0.stepgen.03.step_type 0 # Regular step type
setp hm2_7i96.0.stepgen.03.dirsetup 50000 # Direction setup time (nanoseconds) 50 usec
setp hm2_7i96.0.stepgen.03.dirhold 50000 # Direction hold time (nanoseconds) 00 usec
setp hm2_7i96.0.stepgen.03.control-type 1 # Control type (1 for velocity control)
setp hm2_7i96.0.stepgen.03.enable True # Enable the step generator initially
setp hm2_7i96.0.stepgen.03.velocity 1000 # run forward
 			
					setp hm2_7i96.0.stepgen.03.steplen 20000 # Step length (nanoseconds) 20 usec
setp hm2_7i96.0.stepgen.03.stepspace 20000 # Step space (nanoseconds) 20 usec
setp hm2_7i96.0.stepgen.03.maxaccel 50000 # Maximum acceleration (steps/second^2) so 1/10 second to full speed
setp hm2_7i96.0.stepgen.03.maxvel 5000 # Maximum velocity (steps/second)
setp hm2_7i96.0.stepgen.03.step_type 0 # Regular step type
setp hm2_7i96.0.stepgen.03.dirsetup 50000 # Direction setup time (nanoseconds) 50 usec
setp hm2_7i96.0.stepgen.03.dirhold 50000 # Direction hold time (nanoseconds) 00 usec
setp hm2_7i96.0.stepgen.03.control-type 1 # Control type (1 for velocity control)
setp hm2_7i96.0.stepgen.03.enable True # Enable the step generator initially
setp hm2_7i96.0.stepgen.03.velocity 1000 # run forward
		The following user(s) said Thank You: BonoCNC 	
			Please Log in or Create an account to join the conversation.
- BonoCNC
 - Offline
 - New Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 14
 - Thank you received: 1
 
			
	
						04 Apr 2024 19:49				#297585
		by BonoCNC
	
	
		
			
	
			
			 		
													
	
				Replied by BonoCNC on topic Stepper Motor to work like a DC			
			
				It is not necessary to link anything in .hal?
I will try with another board this way and simulate it.
For now I made it run with a arduino and it works fine and smooth.
Thanks
					I will try with another board this way and simulate it.
For now I made it run with a arduino and it works fine and smooth.
Thanks
Please Log in or Create an account to join the conversation.
- PCW
 - 
				
											 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 17380
 - Thank you received: 5068
 
			
	
						04 Apr 2024 19:55				#297586
		by PCW
	
	
		
			
	
	
			 		
													
	
				Replied by PCW on topic Stepper Motor to work like a DC			
			
				No links needed in hal, but ultimately to control the motors
you would have the velocity command linked to the control logic:
net motor_velocity hm2_7i96.0.stepgen.03.velocity <= control_velocity
					you would have the velocity command linked to the control logic:
net motor_velocity hm2_7i96.0.stepgen.03.velocity <= control_velocity
		The following user(s) said Thank You: BonoCNC 	
			Please Log in or Create an account to join the conversation.
- BonoCNC
 - Offline
 - New Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 14
 - Thank you received: 1
 
			
	
						04 Apr 2024 21:02				#297593
		by BonoCNC
	
	
		
			
	
			
			 		
													
	
				Replied by BonoCNC on topic Stepper Motor to work like a DC			
			
				I will test it as soon as possible and share the results with you!
Thanks
					Thanks
Please Log in or Create an account to join the conversation.
		Moderators: PCW, jmelson	
		Time to create page: 0.064 seconds