Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interference with pulseIn function #3

Open
jkallend opened this issue Apr 24, 2022 · 5 comments
Open

Interference with pulseIn function #3

jkallend opened this issue Apr 24, 2022 · 5 comments

Comments

@jkallend
Copy link

I want to read an input pulse on PB1, modify/massage it, and then output the modified pulse on PB0 to a servo using PrecisionServo.

The output works fine and gives very precise servo pulses, however PrecisionServo seems to screw up the pulseIn( , ) function.

ATtiny85 running at 1MHz.

Any suggestions?

@Tjstretchalot
Copy link

Are you able to produce a minimal example or share some of the code that goes into this? In particular, do you know of any particular pulse sequences (after massaging) that don't get the desired response?

@jkallend
Copy link
Author

jkallend commented May 7, 2022 via email

@Tjstretchalot
Copy link

To confirm, do you have a voltage regulator in the circuit? For example, L7805CV

@jkallend
Copy link
Author

jkallend commented May 8, 2022 via email

@Tjstretchalot
Copy link

From when we were testing without a voltage regular the servo can behave very unexpectedly, and one of those things we saw was the type of twitching you describe. This is particularly exacerbated when running from battery, since the voltage from the battery will change based on its capacity (google a battery charge voltage graph or battery capacity voltage graph), and will change based on the temperature

I would strongly encourage burning off some of the electricity to get a more stable voltage via a linear voltage regulator and seeing if that helps with the twitching. linear regulators are very cheap (under a dollar) and absolutely worth it

Watch out though - linear voltage regulators can only step down the voltage by increasing resistance, so ensure that the input voltage is higher than the target voltage. For example, target 5v with a 6v battery. You know you're overdoing it if the regulator gets too hot, and under-doing it if you don't get a consistent voltage off a voltmeter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants