Go Down

Topic: Arduino powered gramophone project help, noob (Read 2 times) previous topic - next topic

spillaney07

Hi I'm attempting to recreate a gramophone with a wind up handle using an arduino and a rotary encoder and I'm already using pure data to handle the audio side of the project. I need to have it so when somebody turns the handle in a clockwise manner the record spins clockwise and when its spun anticlockwise the record responds accordingly. However I need it so the rate at which its being turned matches the speed of the record. Most of the encoder libraries/tutorials I've come across have values that go up to around 65000 when its turned anti clockwise and I'm at a loss trying to use these values when working with the motor. I'm wondering does anyone have any advice on how to use these values or whether there are any more suitable libraries out there to help me achieve what I'm trying to do?

Runaway Pancake

Ours didn't go backwards.
You could play at the crank and kind of make it do funny things like, still not the DJ tool, but it was made to wind up and then it would stay at speed, while unwinding, for a while.

In one direction you could use crank "impulses" over time to result motor speed variation over time, work out some dampening in firmware.
How would you accommodate abrupt changes from one direction to the other?
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

AWOL

Quote
Most of the encoder libraries/tutorials I've come across have values that go up to around 65000 when its turned anti clockwise and I'm at a loss trying to use these values when working with the motor.

Not 65535, by any chance?

You're not handling signed numbers correctly.
Post your code and your results.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

spillaney07

Yes its 65535 I just didn't have it open in front of me at the time I posted so I was unsure of the exact value. I'm working with one of the libraries I found on this site and it works perfectly my problem is that I can't translate the larger anti clockwise values into data I can use and I'm not really sure how to as I'm new to working with the encoder and arduino in general. Ideally I'd be able to use the larger numbers but if I can't I'm wondering if its possible to still allow for back winding but to restrict the encoder from going below the zero mark? I'm sorry if this is a stupid question but I'm really stumped here. I've attached code I'm using that uses software debouncing. I just have to solve this because I still have to introduce some RFID functionality to the project that allows the gramophone to differentiate between which song it has to play when certain items are place in close proximity to it.

Retroplayer

Before you end up with several people pointing it out to you, is there a specific reason that you are trying to do this ( making the record speed/direction match the speed and direction of the crank?)

I ask, because as it was pointed out already, this is not how a grammophone normally works (I own a victrola.) In fact, running backwards would likely damage the record and possibly the reproducer (that may depend on model...it would on mine.) But perhaps you have a specific reason for doing it this way?

Go Up