Go Down

Topic: MotorKnob like Pot output to Stepper Driver (Read 4376 times) previous topic - next topic

wildbill

Throw in some serial.prints to see what is happening: what does analogread return? Is val jittering because of it - doesn't seem likely, but let's see. If not, is the pre-activity in stepper.step causing it - try avoiding the call when you're passing it zero, or return from it immediately in this case.

Grumpy_Mike

Quote
Even though the input is re-mapped the pot is to sensitive. 

Re mapping often makes things appear worse.

Quote
When the Pot is Stationary the outputs both jitter. Any ideas how to stabilize?

Try a 0.1uF capacitor from your analogue input to ground. (or any capacitor you have)

The alternative is to average the input, read it 8 times and accumulate it into one variable then divide that by 8 (or shift it to the right three times like this :- var = var >>3;


Go Up