Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Control ESC with CompactRio

Solved!
Go to solution

Hi!

 

Have a BLDC motor that is controlled by an ESC and was trying to control it via a CompactRio 9024 with a NI9472 DO chip. Firstly, made a successful attempt to control it with an arduino. Then, used the available resources to create a PWM with the following VI:

 

https://forums.ni.com/t5/Example-Code/Generate-a-PWM-Pulse-width-modulation-Output-Signal-On-cRIO/ta...

 

The PWM was configured to have a 20ms Period and high time between 0.7ms to 2.3ms similar to the Documentation provided in the Servo.h arduino Library. However, the ESC didn't seem to respond to the signal generated.

 

Hope to have some insight on the issue.

More information will be provided if asked

 

0 Kudos
Message 1 of 7
(1,254 Views)

Hi there,

 

Do you have a oscilloscope nearby?  You can probably compare the output signals from the Arduino and CompactRIO to see if they are the same.

 

BR

John

Add motion to LabVIEW in 30min or less - TENET EMotion
Finding it hard to source NI hardware? Try NI Trading Post

 

 

0 Kudos
Message 2 of 7
(1,206 Views)

Thank you for your suggestion, I will see if I'm able to find one.

 

I was wondering if it is possible that the VI used in the example doesn't allow for such PWM resolution and I should find other ways to implement it.

 

Best Regards,

Daniel

0 Kudos
Message 3 of 7
(1,167 Views)
Solution
Accepted by topic author DanielAgos

Hi there,

 

Just updating my progress for someone with similar problem in the future.

 

I had the oportunity to analyse the digital output signal with an osciloscope. What I found is that the DO card shorts to high when I set it to true but doesn't short to ground when I set it to False. Instead, it just opens the circuit from every source. The result is that now this output will vary from the interference of the environment.

 

On solution i've found on forums would be to connect a resistor (>10k) from the output to ground. The solution I have used is to use an analog output which defines each voltage sent.

 

Best regards

Daniel

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

@DanielAgos wrote:

I had the oportunity to analyse the digital output signal with an osciloscope. What I found is that the DO card shorts to high when I set it to true but doesn't short to ground when I set it to False. Instead, it just opens the circuit from every source. The result is that now this output will vary from the interference of the environment.

 

On solution i've found on forums would be to connect a resistor (>10k) from the output to ground. The solution I have used is to use an analog output which defines each voltage sent.


Yes, the 9472 is a relay module.  All it does is connect or disconnect.  Did you need an actual DO module?  If so, what voltage range?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(1,059 Views)

Hi crossrulz

 

The ESC generally require a PWM signal between 3.3 - 6 V. Here, I am using a 5V supply.

 

As I have switched to the Analog Output, I wont need the DO for this particular purpose.

 

 

 

0 Kudos
Message 6 of 7
(1,054 Views)

Sounds like the NI-9402 or NI-9403 would have done the job you wanted.  But if you are getting the job done with an AO, good for you.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 7
(1,045 Views)