05-09-2014 04:54 PM
Hello,
I'm using the example Robotics/Motion Control/PWM Width Modulation.lvpropj to control a servo, using CompactRIO and LabVIEW. I've modified the example and replaced the high period ticks with slides in the FPGA front panel. It works fine moving the servos, however when I move the slides to a real time VI and try sending the data to FPGA something goes wrong. The servos don't move at all, but by using probes the data seems to come through. What can be the error?
I've attached screenshots of my code (note that the wires are broken since the CompactRIO isn't connected) and would be thankful if someone could take a look at it. Thank you!
05-12-2014 05:19 AM
Hi fahstr,
If you add a Read/Write Control in your realtimeVI reading the "signal till servo 1" indicator in the FPGAVI, is the signal then correctly displayed? You could also try disabling as much code as possible in one of the FPGA loops, leaving just a boolean control connected to a DIO. Are you still getting the same behavior? If you upload your entire project in your post I can take a look at it.
Best regards,
05-13-2014 03:34 AM
Hi Robert,
I tried the following in the FPGA VI:
* Adding an indicator (named high period) before the "select operator", it shows the value which is sent from real time. This value is also sent back to realtime by the read/write control as you suggested, it updates very very slowly.
* Adding a boolean indicator (named high/low period) which shows the signal to the I/O in the FPGA, I also send that signal back to real time by the read/write control as you suggested. They aren't synched, but I guess that might have to do something with FPGA:s frequency?
I am attaching a whole project, where we've started from the beginning to get everything right. I am basing the real time VI on the example Producer Consumer VI. Our intention with the program is to make the servo rotate from 120 to 180 degrees, stepping through the angles. I translate the angle to ticks, with a couple of simple calculations, which are sent to a PWM generation in FPGA. The servos are still not moving.
Questions:
* In the PWM generation example, what does the integer "10 000 000" to the far left connected to the true/false-case do?
* Can I use several FPGA references in real time?
* The high period which I am writing to in the FPGA VI, it's also a control, can it disturb someway?
I would be very thankful for your help!
05-21-2014 06:50 AM
Hi fahstr,
To answer your questions.
Hope this helps.