Optical encoders with DC motors
- Skec
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 4
31 Aug 2020 18:10 #180204
by Skec
Replied by Skec on topic Optical encoders with DC motors
nice! That is sufficient for me. I want to drive small dvd rom dc motors, that pushes out the shelf for CD/DVD. I assume I could use Etch example from LinuxCNC library, and modify code so, that there is no more encoder part.(?)
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
Less
More
- Posts: 19474
- Thank you received: 6524
31 Aug 2020 18:24 #180209
by tommylight
Replied by tommylight on topic Optical encoders with DC motors
Using spindle PWM should be much easier. Set up a spindle using stepconf, wire the L298 inputs to the spindle parallel port output and it should run. You can also use the spindle-on pin to enable and disable the L298
Please Log in or Create an account to join the conversation.
- Skec
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 4
31 Aug 2020 19:04 #180211
by Skec
Replied by Skec on topic Optical encoders with DC motors
That is fantastic tommylight! I set up L298N through stepconf as PWM. And it runs. I can control DC motor movement through Spindle STOP button. CW and CCW also works. However, I can only turn dc motor ON or OFF, and then it spins on its own. I would love to be able to control it through "+" and "-" in continuous mode using mouse. If it could spin while I keep pressing "+" or "-" with mouse - it would be perfect.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
Less
More
- Posts: 19474
- Thank you received: 6524
31 Aug 2020 20:26 #180219
by tommylight
Replied by tommylight on topic Optical encoders with DC motors
Does pressing + and - near the spindle button do anything ?
Please Log in or Create an account to join the conversation.
- Skec
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 4
31 Aug 2020 20:31 #180222
by Skec
Replied by Skec on topic Optical encoders with DC motors
It increases and decreases the speed. If I choose 0 Hz in config, then + or - starts the dc motor CW or CCW depending which one I press. But still, DC motor spins continuously once I press + or -.
Please Log in or Create an account to join the conversation.
- tommylight
- Offline
- Moderator
Less
More
- Posts: 19474
- Thank you received: 6524
31 Aug 2020 20:37 #180224
by tommylight
Replied by tommylight on topic Optical encoders with DC motors
That is exactly how it should work.
If you want to do some more testing, try running some gcode with something like this in it:That will run the motor CW for 5 seconds at 100 RPM then run CCW for 10 seconds at 200RPM, then stop.
If you want to do some more testing, try running some gcode with something like this in it:
%
M3 S100
G04 P5
M4 S200
G04 P10
M5
%
Please Log in or Create an account to join the conversation.
Time to create page: 0.099 seconds