So I’m trying to debug adding opto-isolators to my CNC electronics setup. Everything is wired OK I think, but with the optoisolators I’m not getting and movement on the motors
Here are two images of my oscilloscope, the two lines on the screen show the arduino end step output and the driver end step input. In one they are the same, because without the opto-isolator it’s just a direct wire connect. On this configuration everything is fine.
The other shows the same signal leaving the arduino but a different profile hitting the driver input. I’m guessing this difference is why the driver then doesn’t respond. But what I’m unclear on is why the profile is different and what can be done about it… More research required.
Yeah, check the opto speed, is my first thought. I had to slow down the max step rate on my mill about 10x when I tried optos. My second thought, based on those scope shots, is that the optos are attenuating the signal so it’s no longer 5V.
@Marcus_Wolschon@John_Bump sounds plausible. I hadn’t considered speed as something that would be a factor. I’m not sure how fast I’d need them to be. But I guess that is a direction for my further learning about electronics… Thanks for the suggestions
A lot of optos will list propagation speeds as both turn-on and turn-off times, and a lot of those are in the low millisecond range, meaning even kilohz step-and-direction signals are going to be trouble. That gets even worse if they have significant capacitance because then to get to the minimum times takes a chunk of driving.
SWITCHING CHARACTERISTICS
PARAMETER TEST CONDITION PART SYMBOL MIN. TYP. UNIT
Turn-on time, IC = 2 mA, RL = 100 Ω, VCC = 5 V ton 5 μs
Turn-off time IC = 2 mA, RL = 100 Ω, VCC = 5 V toff 4 μs
I don’t have your setup, so taking a stab at this – but are you wiring your Arduino output in parallel with the photo-detector output? If so, you need an open collector configuration and turn off the driver and/or pullups on the Arduino.
@Daniel_Would This is the dark side of optical isolation. In order to receive the benefits you have to go through the bad stuff to get them. As others have pointed out optocouplers are horribly slow compared to typical digital logic. Although the numbers @Bijil_Baji are supplying do not look too bad to me. You still have to work within them and they are still orders of magnitude slower than digital switching is too.
With the software I use there are two things that control the step timing, step time, and step space, that are used to adjust the data stream. They both have to be higher than the speed of the optocoupler in order for things to work.
Your step waveform looks a little peaky to me anyways. I like more of a balanced square wave. Although sometimes spikey is good. Anyhow, stretching your waveform out is the first thing you should try. I’m still not keen on that slopey rise I’m seeing. I know I had issues with that here myself. I like my square waves square. But for now I’m going to let that slide, because the only way to fix that is through hardware. Let’s just hope it doesn’t matter. It is hard to make out with your picture anyways.
Increase the time base and voltage on the next oscillograms you capture so we can see the waveform better. Just one, or two cycles on the screen will suffice
Here’s some bedtime reading for you
None of it may help, but it does discuss issues you’re dealing with now.
Sorry, I was helping someone with their opto end-stop today, and had that context in mind. I now realize you are trying to isolate your motor driver from your controller. There are high speed opto isolators that are more suited for the purpose.
It may be that your isolators are able to withstand a higher drive current than the Arduino output (and any series resistance) is putting out. A higher drive on the emitter side could help with the detector response.