New Project Help!

Hi I’m new to the forum and to be totally honest I’m new to auduino too. I have a project I want to undertake and I think Auduino is the answer but I would like to get your opinions if this is feasible and where I might go to get the required knowledge to carry it out.

The project aim:
I want to create presets for my valve guitar amp by manually controlling the knobs on the amp via servo motors. There will be a minimum of 3 servo motors controlling two volume knobs and 1 master volume knob.

The difficulty that I see is the transition curves between the three servos, for example one of the volume knobs might need to move say 120° while the master volume only needs to move 10°. In order to avoid spikes in volume from my amp I would need the time taken to complete the movement for all knobs to be the same. Also if I have, say 4 presets, the starting positions of the servos will be in different positions depending on which preset we are changing from.

In an ideal world I would also like to add an additional potentiometer to act as a new master volume. This would alter the volume of all the presets evenly. I guess this makes the above paragraph even more difficult?

My instinct is that this is possible with Arduino and is mainly a programming issue, problem is I have no programming experience. Any suggestion where I should go to start learning / peacing together the relivant bits of code required?

I would appreciate any thought you have.

Cheers Keith

Start with the Servo library in the Reference or Learning section.
Moving a servo is pretty straight forward.
Mechanical connector to your pots might be trickier. Perhaps replace knob with a geared pulley, same on a continuous rotation servo, with a limit switch so they can autoreset to 0 on power on.
This place has a lot of accessories that could be handy.

I don't know if having the 20 KHz(?) servo control signal right next to the amp electronics will be an issue for you.

I think there is a fairly simple method of accomplishing this. Just to make sure I am understanding you properly. You want the transition time between presets to be identical regardless of the amount of travel.

Scenario:
Vol1 is at 150*
Vol2 is at 180*
Mast Vol is at 130*

and say preset 1 values should be:
Vol1 is at 170*
Vol2 is at 170*
Mast Vol is at 160*

if you take the differences between them you know the amount of travel. if you then divide them by a set amount of travel time, say 10 seconds. You can determine the rate of travel.

So Vol1 you would add 2 degrees per second.
Vol2 you would subtract 1 degrees per second.
mast vol you would add 3 degrees per second.

I think biggest difficulty would be the mechanics of mounting the servos and connecting them to the pots, and possibly still having the ability of manually operating the amp.

I've never used a servo, but there is a servo library and as far as I know there is no problem controlling 3 or 4 servos. A servo only requires one timed pulse, so there is only one I/O pin required per servo (plus power & ground connections).

The difficulty that I see is the transition curves between the three servos, for example one of the volume knobs might need to move say 120° while the master volume only needs to move 10°. In order to avoid spikes in volume from my amp I would need the time taken to complete the movement for all knobs to be the same.

This shouldn't be too hard. I'd guess the tricky part is that you cannot control the servo's speed... You give it a target position and it goes there... However, if it's moving too fast, you can "step" the servo by moving it 1 degree or so at a time, etc.

You can send the angle-commands to all of the servos at once, or you can sequence it, perhaps turning-down the master (or any knobs that will be turned-down) before turning any knobs up.

My instinct is that this is possible with Arduino and is mainly a programming issue, problem is I have no programming experience. Any suggestion where I should go to start learning /

The good news is that the programming shouldn't be difficult. It's not easy to write the code to control a servo, but the servo library is done for you.

I suggest you get at least on servo to play with. Download the servo library and try one of the examples to set some angles.

Read through the [u]Programming Language Reference[/u]. You won't understand or remember it all, but it's not that much to read through and it will give you an idea of what the Arduino can do. (The servo library is not included in the core language.)

The two most important concepts in programming are conditional branching if-statements, etc.) and loops (doing things over-and-over, usually until some condition is reached). Pay particular attention to these things as you read the Programming guide and as you try-out some some examples.

Look at some of the examples and try them out. You'll need a few extra parts such as a pot, a switch, and some extra LEDs & resistors that you might not need in your final project. But, working through some examples should help you to learn.

And, you can play-around with things like changing the timing in the blink LED example or the blink without delay example. It should be easy to make the LED-on time different from the LED-off time, etc. And, the blink LED example uses the on-board LED, so you don't need any additional parts. You don't learn a lot from simply copying a program, but you CAN learn a lot by playing around and changing things in the example.

One of the big tricks is to write only one or two lines of code at a time. Sometimes beginners will try to write the whole program at once, and even though the program might be 10 or 20 lines long, the compiler will sometimes report hundreds of errors! Something as simple as a misplaced or missing curly-bracket or missing comma can really confuse the compiler.

So write one or two lines at a time, and test-compile and test-run (and debug if necessary) before proceeding. "Develop" your code a little at at time. This isn't quite as simple as starting at the top and working-down... It takes some practice... For example, if you delete the last half of a program the 1st half won't compile because it won' "make sense" to the compiler.

Another thing that's super handy for debugging is to use the [u]Serial Monitor[/u] to send information back to your computer. This can be messages such as "Rotating volume clockwise" or "Volume angle = 10 degrees", or whatever information that can tell you what the program is doing (when it might not be doing what you want it to do. :wink: )

You may or may not want to do this, but when I first started learning C & C++ I typed-in the examples manually instead of simply copy-and-pasting or downloading. It forced me to pay attention to all the little details and get all of the brackets & semicolons, etc. in the right place. But, now that I have more familiarity with the language, I usually start by loading blink example as a "shell", and add my code from there (and delete the LED blinking stuff) .