Labview questions, using motor and pot as a servo

Since there is no FORTRAN compiler for the cRIO:o , I am trying to do some programming in Labview. I have a motor attached to a 10 turn pot, and want to use it like a servo. Has anyone written a sub-vi that will take as input a desired pot reading and move the motor as required to achieve that reading? If so, would you be willing to share it?

Also, I am using a PID vi to track the target with the camera, and would like to set a larger deadband (the turret “hunts” back and forth trying to center the target, and I want it to stop when it’s “close enough”.) I have played with the PID constants, but can’t stop the hunting, and there doesn’t seem to be a deadband constant.

I don’t believe a deadband icon shipped. I build a simple one for the servos on the gimbal that you could use or look at. I’d say take a shot at doing the math and building it as your first subVI. You can even drop down a forumla node if that makes you feel more comfy.

Greg McKaskle

Hi Martin,

We are implementing this exact control probably within the next few days, we will be happy to share our experience with you. Sounds like you will have a similar control as we have, a pot with a motor. We will also have a 10 turn pot as feedback.

However, you also mentioned in your posting that you had hunting issues while tracking a target with the camara. We experienced this as well and found that the apparent hunting was due to a slow response of our control loop. We are using the target tracking example provided by WPI for Labview. And we found that although the fps of the camera was set to 30 initially, the actual fps was about 3, therefore an undersireable 330ms delay existed in our loop response. When we decreased the image resolution, the fps increased by a factor of 2 to between 6 and 8 fps, this resulted in a more acceptable (not noticable) loop response of about 120ms. We are in the process of determining how we can speed up the camera image processing to avoid this. If you have any info in this area, it would be greatly appreciated.

jim

How was the 8fps measured? Are there VI panels open? The overhead to update panel data is pretty substantial. Before worrying too much about it, you may want to check the frame rates with panels closed in a more realistic build. There is also a bit of overhead to having the video turned on for the dashboard.

If you continue to have problems with frame rate, please describe any thoughts or questions you have and I’ll do what I can to help.

Greg McKaskle

The fps is calculated in the camera demo example. there is a fps vi in the lower right hand corner of the example. this is where the fps is calculated.

Yes, we also had VI panels opened with video turned on, so I will test without the front panel tonight to see if it is improved, I’m sure it will be.

I posted somewhere else, but I don’t mind saying it again.

I discovered a couple new issues for performance just today.

  1. Make sure you have run the setup tools on the camera. If you don’t have an FRC/FRC account, the camera will still work, but will not be as efficient, especially on LV.
  2. Make sure that your jpeg compression is set to moderate values. Values near zero or near 100 will both cause the camera to lower the frame rate. The camera default is 30. I typically set it to 20.

Greg McKaskle

Hi Greg,

pardon my ignorance, but I’m not sure what “setup tools on the camera” is referring to, is it something special I need to do? Also, I don’t understand what “an FRC/FRC account” is?

Thanks so much.

jim

The bechtop test steps should have had you connect the camera to a computer, change the PC IP to 192… and run a utility to image the camera.

An alternative is to change to a compatible IP, open a web browser to 102.168.0.90, log in to the camera, and use the camera’s settings editing pages to add an account or FRC for user and FRC for password.

If you can already log into the camera using FRC, FRC, you are done. This utility is by the way a reasonable way to experiment with settings on the camera, but beware of the side effects such as my coworker who set his compression to zero.

Greg McKaskle