Noisy motor Sounds

Hi,
this is my first Post in this Forum. I'm very new in the Arduino thing and my english isn't the best. :~
First let me explain my Problem. In case i want to build a motion Simulator and found a Tutorial in the Internet. In this Tutorial there is used an Arduino Nano, h-bridge, Potentiometer and a motor. There is a software and a plugin for arduino.
here is a Link to this Tutorial X-Sim.de DIY Motion Simulator Community • Arduino Open Source X-PID firmware incl.360°option
I have some little electronic experience and wanted to give this a try. So i orderd an arduino Nnao and an h bridge like on the wireing picture in the tutorial.
I build a little test setup with a whiper motor. Every thing works fine the motor moves into the positions from the software. But when it reaches it's position both led for left and right will lit u and my motor is making a grinding noise. I made a little Video VID 20130810 180212 - YouTube. At this point my input signal of the feedback pot gets very rough. In the forum noone can help me so mybe im lucky here.
I've wired up everything correctly. I read that can maybe caused by the high voltage circius of the Motor. But how can i fix this?

Tombo

What are you powering the motor/motor driver with? I could not tell.
Show us a schemat and the sketch you are running. That will tell us a lot.

Hi,
its in the link
https://raw.github.com/X-Sim/X-PID-Arduino-PID-motor-control/master/img/xpid1.jpg
im using a 12 pc power supply at the moment.

And this is the plugin on my pc the red line is the potentiometer input. You will see iths very rough
http://img850.imageshack.us/img850/6940/c6f2.jpg

I looked at

And this is the plugin on my pc the red line is the potentiometer input. You will see iths very rough
ImageShack - Best place for all of your image hosting and image sharing needs

and could not see a potentiometer.

Looks like you have a camera. Can you draw your schematic on paper and take a photo of it for us.

What is the value of your potentiometer?

UPDATE:
OK, I think I see you are trying to make that motor act like a servo, is that right?
And when it gets to the desired position, it does not know it is there, so it keeps trying to go forward, and backwards (trying to find its niche in life). Maybe you can change your code to be more tolerant as to the precise positioning.
Maybe a servo would be a good option.
Tell us what your goal is.

Yes you are right. It don't seems that he don't know in what position he is because there is current on both signals left and right and t he motor is not turning. And the red line is the potentiometer input and you see it's very rough in standing position.
My goal is that the software can tell se motor where to move and build a dynmic motion simulator like in the tutorial on this site X-Sim.de DIY Motion Simulator Community • Arduino Open Source X-PID firmware incl.360°option it worked for many others so i don't think there is a code problem.
Anyway i use a 47kohm potentioeter like recomennded.

Well, that is not actually a schematic, it is more of a pictorial.
A schematic would (among other things), give the value of the pot. It that is a 100 ohm pot, I would expect it to get hot, but if it is a 10k pot, it should stay cool.

Today i just added a capacitor between the arduinos analog input and gnd. Now my signal is much better. But how did i find out the right value for the capacitor. Now everything is trying. Is there any mathematic formular or something?

There may be a formula, but I don't know if it.
It is normally not critical. I would take into account what is the resistance of the pot, how long of a wire from the pot to input pin, if there is much rf noise near by, and then try one that is not to fat for my board. I would generally expect a .1mf to be a good starting point.

I use a 47k Pot Linear. The cables to analog in are aout 5cm long. And at the moment im getting the best result with 104m. But i have another problem, because the groung of motor is connected with my arduino ground.

Yea, that motor could be producing a bit of noise. I would put several caps around. Close to the motor, close to the processor. On the power supply pins. I can't remember, do you have a protection diode across the motor? Should have.

Hi,
sorry for my stupid questions, but what are caps? No i don't have a diod.

I was told once that the only stupid question is the one never ask.
cap is short for capacitor. I would put a protection diode across the motor, and add some more caps.

The pot is 47k. With a noisy motor close, it may also help to reduce the pot value to around half, or even a quarter of that.
Maybe I forgot, but you do have your pot attached to ground on one leg, the other outer leg to +5, and the center tap connected to the analog input?

And the problem is that the analog input is not smooth, it is jumpy?

Is the pot an old one (years old)? Sometime old pots gather dust etc. and the wiper does not make contact as good as it should (that would produce a jumpy input signal).

Hi,
Yes the pot is connectet to ground, 5v and the middle pin to analog input. When i remove the pot from the motor and turn it by hand i get smooth feedback so i don#t think theres any dust or something inside.
Even if the motor gets powered this input gets very jumpy. If i add a cap between analog in and ground it gets a little bit better. But when i add a cap to motor 12v and ground its getting worse.
I got this board at home SparkFun Opto-isolator Breakout - BOB-09118 - SparkFun Electronics if i understand everything right in the description it shut solv my problem but i don't know how to connect it right.

The protection Diode comes between power supply and h bridge?
Thanks for your help

The protection Diode comes between power supply and h bridge?

If you are using a motor control board with h bridge, it should have the diode already on that board, so don't worry about the diode then.

If the motor moves, based on the feedback from the pot, but then when it gets where it needs to be, it keeps trying to get closer, that could be in the code (sketch).The sketch needs to give it some elbow room (not down to the half degree). Show us that section of the sketch?

I would also try to shorten the shaft of the potmeter and make the connection to the motorshaft as tight as it can get. Any slack there will end in a so_called servo-jitter. Thats what you see now.

Yes, the OP is basically building a servo.
Most servos will slow down as the get close to their destination. Does your code do that?
Or is your code "full speed ahead"?

Hi,
i dont know how this is managed in the code. This code is finished and just to upload. https://github.com/X-Sim/X-PID-Arduino-PID-motor-control/blob/master/XPID-Arduino-Firmware/XPID.ino

like i said i'm building this along a tutorial in the internet and it worked for many others without code change and they used the sam parts as me. I'll try to cut down the pot shaft maybe this will help.

Thanks for your reply