Stepper Motor to work like a DC

More
04 Apr 2024 08:50 #297563 by BonoCNC
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.

More
04 Apr 2024 09:27 #297567 by BonoCNC
# 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?

Please Log in or Create an account to join the conversation.

More
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

 
The following user(s) said Thank You: BonoCNC

Please Log in or Create an account to join the conversation.

More
04 Apr 2024 19:49 #297585 by BonoCNC
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

Please Log in or Create an account to join the conversation.

More
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
The following user(s) said Thank You: BonoCNC

Please Log in or Create an account to join the conversation.

More
04 Apr 2024 21:02 #297593 by BonoCNC
I will test it as soon as possible and share the results with you!

Thanks

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.118 seconds
Powered by Kunena Forum