0

Quick refresher on servo control: High pulses are 20ms apart and last between 1ms and 2ms.

I know this could be done with a microprocessor very easily, but I want to do it without one because the power supply is shared with the drive engine and spikes that would disturb the processor might occur. Other than that, the circuit is provided with stabilized +5V.

I need a circuit that would check if the incoming servo signal is in a given range (1,7-1,8ms), if it is, the output is to be High, if it is not, then Low. Idealy it would also hold the High for about 0,5s after the pulses are out of range, to ensure that the output is High for a while even if the pulse length is rapidly changing, however that is not a requirement.

The circuit doesn't have to be super precise, as it is only meant for cosmetic enhancement and not crucial functionality of any kind.

Also, this question could use a length-related tag, I have no right to create them and found no existing ones.

Mr Redstoner
  • 101
  • 3
  • 1
    A length-related tag? To signify what, exactly? – Finbarr Nov 06 '17 at 18:06
  • 2
    While you *can* do this in various analog ways, or with some discrete digital logic, in reality it will be easier to make a processor-based solution tolerate likely signal issues. Just design it right, with filtered power, couple the signal through a resistor and diode clamps, etc. – Chris Stratton Nov 06 '17 at 18:10
  • I agree, there's no reason an MCU design would be unstable if designed correctly. On that note, I just answered about controlling servos here: https://electronics.stackexchange.com/questions/337931/how-can-i-control-servo-motor-with-pwm-output-of-a-microcontroller/337964#337964 – Kurt E. Clothier Nov 06 '17 at 19:06
  • length-related to signify that I'm interrested in the length of the pulse – Mr Redstoner Nov 07 '17 at 06:39

1 Answers1

0

If you have spikes that would disturb a micro, they will probably disturb any digital logic circuit. You'll need to clean those up into any circuit. Your best bet is probably a linear regulator from a 5V source and step the voltage down to 3.3V. This 1.7V headroom will allow the linear regulator to absorb any of the transient spikes and keep a clean 3.3V output.

That being said, whenever I use logic I like to make it programmable. That way, in case I make a mistake, it's just a fix in the program. You can get eval boards for different programmable logic chips that probably have a linear regulator as part of the board. You didn't mention if this was a one-off or if you're meaning it for any sort of mass production - that will drive the solution.

If it is a one-off, Lattice makes a $35 eval board that is in stock at Digi-key. You would have to learn their GUI & how to program the chip, but in the end it might be easier than wiring up a bunch of counters, clocks, latches, and comparators. Here's a link to that: https://www.digikey.com/product-detail/en/lattice-semiconductor-corporation/LCMXO2-7000HE-B-EVN/220-2625-ND/3906092

If you'd rather go the hard-logic route, it gets more difficult. You'll need a low-frequency clock (100kHz?) that you would tie into a clock input on a counter. Then your PWM signal gets tied into the count-enable pin. Basically when your PWM signal goes high, you start counting, then when it goes low, you stop. This latched-in value is fed into a comparator, and if it falls in the right range, you output that signal to an LED or some other down-stream logic. Of course, it is more complicated than this, because you also have to reset the counter after your count value gets latched in. Lots of little details to work out, which is why I prefer programmable logic.

Hope this helps - perhaps if you let us know what you're more comfortable with (discrete logic vs. programmable) we can set you on a good path.

Mike Barber
  • 584
  • 2
  • 7
  • It is a one off, I was contemplating using Picaxe as I have the equipment and processors, but from my experience with another circuit installed in the same model (only taking input from different channel that this one would and acting funky when current in circuit changed quickly (sudden full throttle), I assume the stabilizer just couldn't keep up) I wanted something more stable. Other than that, I'm a programmer and have no major problem with programming as such. – Mr Redstoner Nov 07 '17 at 06:46