Dear wizards,
I would like to share my experience with dc+encoders using LinuxCNC and ask you some question..if I may.
As already many, I have tried to run Etch example from LinuxCNC sample list to control small DC with encoder. Unfortunately, the DC+encoder I got from old DVD rom is noting similar to those, which I can find online. The motor is simple, however, the encoder is what makes my head spin. As I could not find its spec sheet on google, I did not know which leg is which. With the idea from #linuxcnc, I got 1 LED, and start to poke around..
I decided that the input should be on the leads, that go into resistors.. and another two must be ground and signal. After connecting to 5V, I put LED on ground and signal wires (please see my art_diagram...). Shortly after, I noticed that the LED start to blink, when I slowly turn the DC motor wheel.. I considered it as success, and decided to wire all into parallel port (pins once again can be seen in the diagram).
I have modified *hal and *ini files from the Etch example..
Now the interesting/strange part:
1. In LinuxCNC program, when I press "+" or "-" (continuous), at the beginning DC spins just a bit, and then it starts running like crazy (even though I do not press continuous)..
2. To stop motor from spinning, I have to press opposite to "+" or "-", depending on what I pressed first.
This behavior I did not notice when testing stepper motor. The motor would spin as long as I press "+" or "-" in continuous mode..
3. If I would choose 1 mm or 0.5 mm turn (not continuous), at the beginning motor would spin just a bit, I would click once again "+" and then it would continue spinning forever (more than 10 seconds, after which I stop it with estop)..
My question would be:
Does it has something to do with my wiring (maybe I wrongly assumed, which wires from encoder to wire into parallel port), or it is *hal and *ini file configuration.. I must honestly say, that I do not know how to set PID numbers, nor scale in this case..
Does blinking LED connected blindly to two wires indicates that we have GND and SIGNAL?
Is it possible to get such system to spin the motor 1 revolution, when I press "+" or "-"? (assuming I put the scale = 1)? - I guess I would need to know how many holes are in the disk to have it spin 360? And where should I put this number in the *ini file?
I would be grateful for your time, comments or suggestions.
Sincerely,
Simonas