From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

How to control the Steering gear by nxt?

I am using the LabVIEW NXTTOOLKIT to control a Steering gear.THe steering geering is controlled by PWM,period 20MS,Pulse-width 0.5MS.
My  question is easy:
How to generate this PWM by LabVIEW NXTTOOLKIT?
ADD a question:
I want to use PID for the motor,but the nxt donot support float,how can I do?
thanks:)
king
0 Kudos
Message 1 of 6
(7,411 Views)
So you have a motor that is controlled by a PWM? How have you connected this PWM to the NXT?
 
You could suply power to the PWM by programming it with a NXT motor VI. Have the VI "run" the "motor" for whatever the amount of time one pulse is for your PWM. Then just repeat that action in a while loop. 
0 Kudos
Message 2 of 6
(7,396 Views)
THE vi changes pulse width,the  frequency is 8K Hz,I want to change the frequency to 50Hz,which parameter in NXT_MotorUnlimited.vi change the parameter?
king
0 Kudos
Message 3 of 6
(7,394 Views)
THE vi can change output pulse width,the  frequency is 8K Hz,I want to change the frequency to 50Hz,which parameter in NXT_MotorUnlimited.vi changes the frequency?
king
0 Kudos
Message 4 of 6
(7,393 Views)
For your float problem, if you needed 2/3, you could devide 2 by 3 and you would get your answer. Of course, if you do that directly and ask for an asnwer, it will be rounded, but depending on what you are trying to ultimately do, it might work.
0 Kudos
Message 5 of 6
(7,289 Views)
Since the NXT doesn't support floating point, you'll need to re-implement the PID algorithm using integers. A google search would give you the following resources:

http://www.google.com/search?q=integer+pid+implementation

http://www.acroname.com/examples/10059/10059.html
http://www.advice1.com/reference/pidalgorithmref.html


Joel Sumner
NI-Shanghai
0 Kudos
Message 6 of 6
(7,281 Views)