LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Servo motor control using MCB2300 and Labview

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.

0 Kudos
Message 1 of 8
(8,499 Views)

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.





0 Kudos
Message 2 of 8
(8,486 Views)

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. 

0 Kudos
Message 3 of 8
(8,482 Views)

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.

 





0 Kudos
Message 4 of 8
(8,478 Views)

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.

 





0 Kudos
Message 5 of 8
(8,475 Views)

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.

0 Kudos
Message 6 of 8
(8,430 Views)

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!

Message 7 of 8
(8,418 Views)

Hello, tlwm. you have got through the servo control ARM? Could you show your project? thanks

0 Kudos
Message 8 of 8
(7,260 Views)