Hi, I am new to this C/C++, and would like to know how to write a simple program code using C/C++ from analog output to PWM for a motor.
Thank you..
Hi, I am new to this C/C++, and would like to know how to write a simple program code using C/C++ from analog output to PWM for a motor.
Thank you..
First of all, which operating system and compiler are you using?
If you're using some kind of development board like an STK500, then we need links to relevant documentation.
Regardless of whatever CPU you're using, you need some kind of circuitry between the processor and the motor, to amplify the logic signals to a level that will drive a motor.
Some power PWM drivers for electric DC motors
PWM - Pulse Width Modulation for DC Motor Speed and LED Brightness, Page 5 - Robot Room
What are you interested in controlling - speed or power?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
What are you using?
Fact - Beethoven wrote his first symphony in C
I am using National Instrument to a PMA Series DC Servo Actuators.
I need to control the direction of the motor. More interested in the duty cycle.
Do you have URL's for that?
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
National Instrument -- NI CB-68LP - Unshielded 68-Pin I/O Connector Block - National Instruments
Actuator -- http://www.harmonicdrive.de/cms/uplo...ma-300-317.pdf
Hope this help (:
I must be missing something, because the NI CB-68LP is a data acquisition board, where things are primarily low power inputs.
To drive a motor, you need outputs, and more power.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
with a servo amplifier ( maxon motor : 145391 ) to the motor
http://www.farnell.com/datasheets/484756.pdf
And how is all that lot wired up?
PC -> NI CB-68LP -> maxon motor : 145391 -> PMA 300
How is the PC plugged into the I/O connector block?
- Parallel Port / USB port?
Did it come with any library files / DLL files / example programs (see their website)
Which operating system and compiler are you using?
Note that "TurboC" on any kind of windows OS means you need to upgrade your compiler.
How much experience of C/C++ programming do you have in general (on your desktop machine).
How much experience of programming external devices (such as this).
If this is your first experience of programming real hardware, then I would suggest you start out with
PC -> NI CB-68LP -> LED
just to get familiar with the first step, and just making a light go on and off.
Once you've mastered say "on for 2 seconds, off for 1 second" in a loop, then you'll be well-placed for adding the rest of the components.
I know it's a lot of questions, but programming bespoke hardware is full of very fine detail. Even the smallest mistake or omission can result in it not working and having no idea where to look.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.