SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By rrc1962
#120885
I have a Pro 5V 16MHz board. What is the max pulse rate on that board and also the Uno? I'm looking to pulse a servo drive and 25KHz would be ideal. The clock speed is 16MHz on both. Does that mean it will pulse a pin that fast?
By waltr
#120887
25kHz pulses from a processor running at 16MHz should not be a problem even with software timing.
By rrc1962
#120893
waltr wrote:25kHz pulses from a processor running at 16MHz should not be a problem even with software timing.
Cool...I wasn't sure if there was something else that would limit the pulse output.
By Grimfox
#121036
You may want to check out the sample servo code. If you are looking to control a servo it's really pretty easy using their functions. Even something that takes servo signal like an ESC is not too hard to figure out.
By rrc1962
#121041
Grimfox wrote:You may want to check out the sample servo code. If you are looking to control a servo it's really pretty easy using their functions. Even something that takes servo signal like an ESC is not too hard to figure out.
Shouldn't be a problem. The servo is 90VDC so I have to pulse an external servo drive with step and direction signals. I haven't looked at the servo functions so I don't know if they will work for that. I know they are designed more direct driving a small hobby servo.
By rmteo1
#121044
rrc1962 wrote:Shouldn't be a problem. The servo is 90VDC so I have to pulse an external servo drive with step and direction signals. I haven't looked at the servo functions so I don't know if they will work for that. I know they are designed more direct driving a small hobby servo.
What exactly are wanting to drive. You talk about step and direction - this suggests a stepper motor. You also say it needs 90VDC - this suggests that it may a true servo motor, one that has an encoder. Also, previous posts seem to refer to an R/C servo. All three are very different from each other. So which one is it?

1. Stepper Motor http://www.orientalmotor.com/products/a ... ndard.html
Image
2. Servo Motor http://www.yaskawa.com/site/Products.ns ... Motor.html
Image
3. R/C Servo http://www3.towerhobbies.com/cgi-bin/wt ... XH288&P=ML
Image
By waltr
#121046
Grimfox wrote:You may want to check out the sample servo code. If you are looking to control a servo it's really pretty easy using their functions. Even something that takes servo signal like an ESC is not too hard to figure out.
FYI:
Careful with the term "servo". Many times on these forums it means an RC Hobby servo for model planes and cars that uses a 1 to 2msec pulse every 20msec to command a position.
The generic term "servo" is a motor (and gear train) with feedback for position that can have many ways of being commanded. The OP needs to give us the definition of how his 'servo' works.
By rrc1962
#121051
It's actually a 60VDC servo motor. The servo drive accepts 5V step and direction inputs. Power supply to the motor goes through the drive. We build systems with both servos and steppers. Both the servo and stepper drives that we use accept step/direction. In order to get acceptable performance, I need a 25Khz pulse rate. We drive these right now using a PC parallel port. The Arduino will just replace the PC in this simple application (push a button and move to a limit switch, wait a set time, then move back to the home position).

I'm basically using the Arduino as a programmable pulse generator...As long as it can pulse fast enough. We would typically use a PLC for this which can pulse at 10Khz (25Khz with an expensive high speed IO module). I'm experimenting with the Arduino as a low cost alternative for cost sensitive applications.
By rmteo1
#121057
Can you give a link to the motor? If all you want is to generate a 25kHz signal, there are many $1 MCU's that can do it.
By rrc1962
#121082
Probably this one...

http://www.kelinginc.net/KL23-130-60.pdf

Or something similar. We usually use Gecko drives. I need to generate a pulse train, but the specific pulse rate will be based on a few parameters. There is some logic involved. Arduino is the easiest and fastest way to get it done.
By esklar81
#121144
rrc1962,

1) I suggest you go to Arduino forum and search for "function generator" or "pulse generator". As I understand what you're trying to do, you need the Arduino to produce a logic-level pulse train of some (input-dependent) frequency under some set of input conditions. (The important point is that you have another device for translating the logic-level pulse train into switched power for the motor coils.) In such a case, whether that pulse train is used for controlling a motor doesn't appear critical to how it's produced, so the more general discussions of pulse and function generators appear relevant.

2) Have you considered using a function generator, such as this, slaved to an Arduino to generate the pulse train? My impression is that you will not need to do this at 25 kHz, but I thought I should call it to your attention.

3) If you were to need a constant pulse train, but to switch it on and off based on relatively simple inputs, you could use a fixed frequency generator and switch it with hardware logic.

4) FWIW, I point out that there's no obvious reason you can't use an Arduino to develop your low-cost logic/control module, then implement it with a much lower cost microcontroller for volume production, if the higher volume merits the investment in lowering the per unit parts cost. (If you're going to be making five of these a year, the Arduino may well be the "right" long-term approach; if you're going to be making one hundred of them a week, investing in a custom board with a low-end microcontroller is likely to pay back your investment in short order. For example, if you can get the unit cost of the control module down to $5, that would be ($19/Pro Mini - $5/custom = $14/unit) X (100 units/week) = $1,400/week. At five units per year, though, the cost reduction is only ($19/Pro Mini - $5/custom = $14/unit) X (5 units/year) = $70/year.)

Have Fun,
Eric