Go Down

Topic: Servo control (Read 1 time) previous topic - next topic

lastchancename

Experienced responders have a nose for laziness, (they were beginners once)... Sure, there are trolls, chest-beaters, and pretenders - but the help you'll get here is about as good as it gets - if you try to help youself!.

OldSteve

#16
Apr 18, 2016, 02:28 am Last Edit: Apr 18, 2016, 02:29 am by OldSteve
I was in the middle of a long reply, and accidentally closed the window. :(
Here we go again.....

Sail winch servos are still your best bet. One pin each, and they have built-in position feedback, leaving plenty of free pins for your pushbuttons. 6 pins for the servos plus 12 pins for the pushbuttons if you connect them the conventional way. On a UNO, that would leave one pin free.

Steppers could be used, as just mentioned by lastchancename, but they'd still ideally need position feedback. They can skip steps under high loading, fast acceleration or at high speeds, which would throw your positioning out the window. At the very least, they need a means of finding a reference position, 'home'.

The other alternative is to stick with your continuous rotation servos, but provide position feedback in the form of limit switches at each end of travel, so your micro knows when to stop driving them. For that method, you'd need 3 pins per servo - one for servo signal and one for each limit switch input.

For the pushbutton switches, you could connect them in a matrix, then you'd only need 7 pins to read them using the "Keypad" library.

Alternatively, you could connect them in a matrix with added resistors, connected to a single analogue pin. Each button presents a different voltage to the analogue pin. Google "One Wire Keypad" for more info on this message.

So you need to determine which methods best suit your purpose. A Mega2560 might be a necessary evil. A clone is fairly cheap - I bought one the other day for AUD$14.05 delivered. And it was one with a 16U2 USB to TTL converter like original Meag2560s, not a CH340G version.
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

Go Up