Slightly OT but PIC based servo driver with step/direction input..

Jul 23, 2004 7 Replies

Maybe OT if so, sorry but;



Could anyone point me to a solution or examples for doing step/direction input into a DC Brushed servo based upon a PIC?



Have taken the many Application notes from Microchip and have a working board with a PIC17, quad encoder feedback and LMD18xxx bridges with the pic doing the PID, trajectory and accleration calcs. The input is from a PC VB app that sends commands of the form M, -800 or M +230, or Move axis to relative position. It appears to work better than I expected, the tuning section especially, thans to Microchip. Here's the question, I want to rework these to use in a three axis machine, to use some of the new Microchip Pics with Encoder interface in hardware, to maybe use CAN, but most of all to take direction from a step and direction motion command from the commmonly avaiable software. I know I can do the motor control, it's the step/direction input to move instruction bit I'm having trouble with.


Jeff.


--Have you been to parallax.com? Seems to me that's how the BOEBot works...

Can you just use an external interrupt for each step input and a port line for each direction input? Then your ISR would just increment/decrement a 32-bit (or whatever) counter. If you don't have sufficient hold time on the direction input to allow the ISR to capture the direction input reliably, you can just add a D FF to the input. If you use a dual-D for each input you could tie the D inputs high on one FF, tie the other D input to the direction input, connect both clocks to the step input. The outputs for each axis could be OR'd and the microcontroller would only need to have one /INT input- it would come around and find out which input (s) stepped and reset the step FF.

Best regards, Spehro Pefhany

steamer wrote in news:ejcMc.3863$54.54967 @typhoon.sonic.net:

Thanks for the link, however I'm working with industrial servos - DC brushed motors, not RC type servo's. Couldn't see anything on step/direction control either?

i know you want pic... but look at an IsoPod.

formatting link

you should be able to read 3 s/d pairs, and 3 quad pairs as feedback.

While I realize you're working on your own implementation, I thought I'd mention that this is available as a low-cost commercial product. Gecko Drive makes a brushed DC servo driver that takes step/direction input. It uses a quad encoder for feedback. Their Web site is here:

formatting link
Look, for example, at their G320 module. The product goes for about $120, and it supports motors up to 20 amps. They have another version with a pulse step multiplier, handy if you can't readily change the step resolution in your software (though it sounds like you can).

I doubt they'd offer you the programming they use, but the product and specifications show what can be done with the basic concept you have.

-- Gord>

I can also recommend the copley control amplifiers (although more expensive)

formatting link

Increase/Decrease the desired position for the (underlying) position PID loop on the step input. Would be interested in a CAN(Open) version of this driver.

Kind regards

Sjur J. Vestli

Copley is really the best money can buy. About 4x the price of a gecko. I have never heard anything bad about the Gecko units.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required