LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

accelerometer sense tilt then interface with USB-6008 and generate PWM to control M995 servo motor

hi everyone,

 

currently im doing a final year project in LabVIEW using USB6008. my project involve of sensing the tilt from accelerometer and convert the tilt into PWM to control the turning of servo motor.

 

accelerometer that im using is ADXL322 which has Dual axis ±2g sense range

servo motor that im using is M995. when the servo motor in neutral position it required 1500microseconds, while it turns 90degree it requires 2200microseconds and whilw it turns -90degree, it requires 800 microseconds.

currently im facing problem in generating the PWM signal to control the operation of servo motor.

attachment is my VI design that i have done to date.

the program is about attracting tilt range from accelerometer using USB NI 6008 and then convert the tilt into angle in degree, and after that generate PWM to control two servo motor.

hopefully there is somebody can help me on this. thanks.

0 Kudos
Message 1 of 7
(4,175 Views)

anyone please help me on this.

0 Kudos
Message 2 of 7
(4,149 Views)

currently i need to generate PWM to control servo motor model MG995. but i am facing problem in generating the PWM in between 800usec to 2200usec to control the rotation of the servo motor. is there any example for me to refer.

below is my VI that i have done to date.

hopefully somebody can identify my mistake because my VI is not able to turn the servo motor.

0 Kudos
Message 3 of 7
(4,113 Views)

6008 cannot generate PWM directly.

The best you can do is to use its digital output to turn on/off, and use timing vi to control its on/off period.

You should be able to find digital output example from Help>>Find Examples>>Hardware Input/Output>>DAQmx>>Digital Generation.

However, I don't think it's fast enough to control motor speed/position, and timing will not be precise, since it's software time.

If you really need to use PWM, I'd recommend analog output to drive 555.

0 Kudos
Message 4 of 7
(4,084 Views)

anyone have the 555 timer circuit design that use with LabVIEW to generate PWM?

0 Kudos
Message 5 of 7
(4,007 Views)
You can find 555 circuit example from its datasheet which could be easily search by google.
Analog output example could be found from Help>>Find Examples>>Hardware Input and Output>>DAQmx>>Analog Generation.
Looking for the one with 6008 support.
0 Kudos
Message 6 of 7
(3,997 Views)
You can find 555 circuit example from its datasheet which could be easily search by google.
Analog output example could be found from Help>>Find Examples>>Hardware Input and Output>>DAQmx>>Analog Generation.
Looking for the one with 6008 support.
0 Kudos
Message 7 of 7
(3,994 Views)