06-16-2010 03:56 PM
Hello Everyone,
I have to drive servo motor using MCB2300 board and labview. I am new to LabView as well as MCB2300 board. I understand that I have to generate Pulse to control the servo motor.
I have gone through some of the post but could not find something useful.
I need to do it asap, a fast and eloborating answer is much appreciated.
Thanks is advanced.
06-17-2010 12:28 AM
You need to install Labview for ARM to get proper examples of MCB2300 PWM varying.LPC2378(the ARM controller in MCB2300) has 5 PWM output channels.You will get PWM examples for MCB2300 which will vary the PWM as per your code.
You might require an FET to drive up the current to drive the Servo as we experienced this issue of motor not responding to our PWM.LPC2378 doesn't have enough current driving capability.I may share the IC details if you are interested to this solution.
06-17-2010 01:03 AM
Thank you very much for your response. I have already installed LabView Embedded Evaluation version. I already had LabView 2009 Student License on my machine. I am not able to find the example codes. Can you please guide me, where it might have copied the example codes?
Also, please shed some light on the alternate method you metioned.
06-17-2010
01:21 AM
- last edited on
03-25-2025
10:22 AM
by
Content Cleaner
Deepanshu wrote:
Thank you very much for your response. I have already installed LabView Embedded Evaluation version. I already had LabView 2009 Student License on my machine. I am not able to find the example codes. Can you please guide me, where it might have copied the example codes?
Also, please shed some light on the alternate method you metioned.
LabVIEW embedded is different from LabVIEW for ARM.
06-17-2010
01:26 AM
- last edited on
03-25-2025
10:23 AM
by
Content Cleaner
Deepanshu wrote:
Thank you very much for your response. I have already installed LabView Embedded Evaluation version. I already had LabView 2009 Student License on my machine. I am not able to find the example codes. Can you please guide me, where it might have copied the example codes?
Also, please shed some light on the alternate method you metioned.
Please download LabVIEW for ARM evaluation form http://digital.ni.com/express.nsf/bycode/exfzr4. This includes Keil compiler too. Once you install it,you can search examples from LabVIEW example section.
06-21-2010 08:40 AM - edited 06-21-2010 08:48 AM
I don't know if this will help you, but think about this tip:
On the back of my (digital-) Servo package there was some data written (see attached image).
You've heard of PWM (Pulse Width Modulation)? If not look it up in
wikipedia / microcontroller.net / (if you speak german) http://www.rn-wissen.de/index.php/Servos or google
The description of the Servo says that I have to send every 200ms +/- 1ms a positive (+5V +/- 1V) signal with a length depending on the angle I want the Servo to be set. The Signal is coded in conjunction to time, which means, as longer the Signal as higher the angle is. The Signal range is in between 70 to 240 ms (with my servo and not exactly). The Signal must repeated every 200 ms like I said before. I don't know, if you understand C but here is a function I wrote, which works fine for me:
void set_Servo_0(uint8_t angle)
{
DDRA |= 2; // Specific Port declaration for my µC (Atmel)
uint8_t tick; // a var to count how often I send my Signal
for(tick = 0; tick < 2; tick++) // loop to count -> send Signal three times
{
if(getStopwatch1() > 200) // getStopwatch is a libary specific function to measure time in ms steps
{
PORTA |= 1; // port high
sleep(angle); // angle comes from outside the function, it is a parameter for this function. Sleep for this time with port high = pos Signal
PORTA &= ~1; // then pull down
setStopwatch1(0); // reset the timer
}
}
mSleep(250); // Finally I have to wait for this time (in ms) when I send different angle parameters one after another, to let the whole system
// (µC + Servo and rest of program) to settle down, else I will loose signal steps due to incorrect timing (not nice, but works).
}
This function gets the angle as Integer from 7 to 24 and puts the Servo in corresponding position one time.
Maybe You can adapt it, good luck.
06-21-2010 11:32 AM - edited 06-21-2010 11:35 AM
Hi again, made some modifications to the function:
uint8_t lastangle; // save value of last angle
void Serv0(uint8_t angle)
{
DDRA |= 2;
uint8_t tick;
for(tick = 0; tick < 2; tick++)
{
if(getStopwatch1() > 200)
{
PORTA |= 1;
sleep(angle);
PORTA &= ~1;
setStopwatch1(0);
}
}
// here comes the change: if the difference between the last angle and the current angle exceeds 8 Steps, the delay will be greater to give the
// Servomotor enough time to move to the desired angle (see moving speed specs in image; my servo is driven by stabilized 5V)
if(angle - lastangle >= 8 || angle - lastangle <= -8) // compare the Variables for their difference
{
mSleep(300);
}
else
{
mSleep(240);
}
lastangle = angle; // Huha! 🙂
}
Thanks for the inspiration!
09-26-2011 08:19 AM
Hello, tlwm. you have got through the servo control ARM? Could you show your project? thanks