Servos, cameras, and inverting limit switches

Hello people. Currently our robotics team is working on updating our robot, just to finish what we started last year. I have ran into a few problems that I haven’t been able to figure out and any help would be good.

Servos. I can’t get them to move, I’ve tried to set the position and angle to getPosition/Angle and add a decimal or whole number to it. (1 or below.) I’ve looked at the labVIEW example for servos and tried using buttons to set the angle to a solid number, but haven’t been able to figure out. This is all in teliop as I haven’t moved all the code to periodic tasks for last years program. (I will probably do that for this year.)

Camera. Do I have to add anything to the code? We’ve tried the configuration software, reset it, used it again, used ethernet cable to connect the camera to the bridge, and made sure it has power. I remember not having to add anything, but i’m not 100% sure.

Inverting limit switches. I’ve tried moving the code from the true case in the case selector I use to the false area and the false code to the true area. I’ve also tried running the boolean through a not gate before sticking it into the case selector. I tried these at two different times. Both times it worked exactly the same as before. The objective is to use limit switches (already been shrink wrapped) to allow a motor to move in a certain direction only if the limit switch is pressed. We already have it working the other way, but cannot get it to work this way.

Thanks for any help and time.

Servos require a power jumper on the bare pins beside the PWM output the servo uses. This jumper routes power out the PWM, otherwise the servo gets a PWM signal, but no power for it’s motor.

The default Dashboard is equipped to handle a camera connected directly to the robot bridge. The camera must be setup using the Axis Camera Utility, and the Dashboard needs the Enable button pushed.

Limit Switch direction depends on how it’s been wired as well as the code.

Sorry about the slow reply.

Thanks. I didn’t know that.
EDIT: My mentor/teacher thinks you are supposed to put all the pins in pwm output section. Is their a way around this that is resonable?

Pretty certain We’ve done all of that, the setup is the only thing with the name of “axis camera”, right? The bridge is just the ethernet thing also, right? Enable button is just the on pushed while in the driver station, right?

I know that. they shrink-wrapped the limit switches though, so I figured it would be easier to change the code. however, reversing the code has no change and I’m not sure why. Should I include my code here?

Yep, “axis camera” is the only one, and the Ethernet thing is the right place.
It sounds like you used the right setup procedure.

There is a bandwidth limit set by the bridge (Ethernet thing) that will block the camera image.
Using the Dashboard controls try lowering the camera resolution and frames per second. That will reduce the bandwidth demand to test if bandwidth might be the problem.

I know that. they shrink-wrapped the limit switches though, so I figured it would be easier to change the code. however, reversing the code has no change and I’m not sure why. Should I include my code here?
Post your vi or a zipped project and we’ll see if we can spot any code issues. As long as it isn’t reversed in two places (two wrongs make a right here) the code change should have worked.

Yes, at least the part you’re trying to make work. It would also help to have detailed information on the wiring of your switch, and a brief description of what you want to happen when the switch is pressed vs. not pressed.

Do you know how to use VI snippets? If you don’t want to post your full project, select the code you want to share with us and choose “Create VI Snippet from Selection” from the Edit menu. It’ll prompt you to save the snippet as a .png file that you can then attach here. Everyone will be able to see it as a picture, and it will become live LabVIEW code when it’s dragged into a LabVIEW block diagram.

The jumper is only required for the PWM channel that drives the servo. It is not required for any other PWM channel.

Heres the code.

I reversed the code for the motors to move in one direction. (“UP”)
However, their is no difference either direction. On the unshown case all numbers are 0. Both limit switches/motors interact exactly the same. the different numbers for one of the motors is because one of the motors moves faster.

I will try lowering camera quality/size.

EDIT: Tried camera, didn’t work at all. Also tried unplugging it and didn’t notice any change. (thought little green dot next to it might change.) Does wireless affect it? For some reason wireless won’t connect so I put an ethernet cable in the bridge.

EDIT: I didn’t understand what you meant about the servos, but when I said “jumpers” my teacher/mentor understood and we got them working now.

Not sure why wireless isn’t working, changing the f-key that is supposed to toggle wireless doesn’t do it, I think wireless might be turned off. How do you turn it on/off on the tiny slow laptop thingy?





This is probably the wrong section, but it may be a labview issue.

I get this code when I try to connect to the robot. This is in diagnostics of driver panel.

Warning <code> 44001 at modified network configuration
Set the object already exists

IP is supposed to be 10.xx.yy.z where xxyy is your team number and z is any number within limits, right? (forgot limits for z but 5 and 9 would work, right?)

Connecting a cable to the bridge has stopped working as well.

44001 isn’t an error, it’s just an informational message.
It’s telling you the other devices that it is able to connect to.

10.xx.yy.5 should be your Driver Station PC’s Ethernet adapter.
10.xx.yy.9 should be your Driver Station PC’s wireless adapter.

These can be set automatically when the Driver station is started.

  1. Go to the Setup tab
  2. Click on “Choose NIC…”
  3. See if both the wireless and wired networks are NOT set to manual.
    Get the Ethernet connection working again, before working on the wireless connection.

Your wireless connection problem can be due to several things, in addition to an incorrect IP address/netmask.

  • If you haven’t used wireless since your last competition, then the robot bridge probably still still has the playing field security set. There is a Bridge Configuration Tool we use to setup the robot bridge properly for home use.
    *]Check to see if your PC can see the robot network on the Windows wireless connection list. You may have to manually connect to it if you haven’t chosen to Connect automatically.

I think I’m going to have to do this, but I just want to make sure it won’t screw it up for future competitions, or their is something you can do to change it for competitions in the future.

I can see the network, but attempting to connect to it doesn’t work.

It won’t mess up the bridge for future competition use, so don’t worry about that.
The Bridge Configuration tool actually gets run at each competition before you can connect to the playing field. It gives each team a unique security code.
That security code left over from your last competition is why you can see the wireless network, but it won’t let you connect. Your PC doesn’t know the security code.

One other thing to check is that the robot bridge is switched to one of the AP modes.

How do I check that? I got it working through ethernet with the configuration, but it doesn’t work with wireless.

There is a manual switch on the back of the robot’s DLink bridge.
Depending on the model you are using, the switch will be marked differently.

The Rev A switch will be marked “Bridge”, “Auto”, “AP”
The Rev B switch will be marked “Bridge”, AP 2.4GHz", “AP 5GHz”

You want either “AP” or “AP 2.4GHz”
Don’t choose “AP 5GHz” unless you know that you’re using a laptop that’s 5GHz capable. The FIRST issued Classmates only support 2.4GHz.

Got that right. What else could be causing a problem with wireless but not ethernet?

What I’d do next is connect an ethernet cable between PC and DLink. Open the web page on the DLink – the FIRST directions tell you how to do this if you are having problems.

Then check what SSID the DLink will use. Team number is what is suggested I believe. Check the security settings and perhaps turn them off if they may be the issue.

On that laptop or on another wireless enabled laptop verify that you can see a wifi network with that SSID name and attempt to Connect to it. For the laptops used in FIRST, you may want to set them to auto-connect to it.

If you get this working, the programming tools and DS will likely work. If not, then it is an IP issue.

Greg McKaskle

I did a quick google search and a computer search, Not sure what you mean by FIRST directions. I also tried to find how to open a web page of a DLink. Couldn’t find anything though.

I can’t connect to the network except in the driver station, if that matters.

Also I’m having another problem similar to the true/false one, I’m changing the speed of a motor and it doesn’t change how fast the motor actually moves. How does changing the speed of a motor work in the programming?

Use a web browser and type 10.46.92.1
That browses to the DLink.
The login is admin and the password is blank.

Find “Setup” then “wireless” and look at the settings for wireless.

http://www.usfirst.org/sites/default/files/uploadedFiles/Robotics_Programs/FRC/Game_and_Season__Info/2013/GettingStartedwiththe2013FRCControlSystem.pdf

The directions are on page 23, though I was wrong, they don’t tell you to log in. They tell you to use the config utility.

Greg McKaskle

Ok, I figured out how to get to the Dlink. However Security settings are “none”, does wireless type matter? Wireless is set to always.

Also out of curiosity if you are connected to a router how do you find the IP? I know what it is for this, but for general purpose.

To see the devices connected to your laptop, open a Windows command window (go to Start and type “cmd” into the search at the bottom) and type:arp -av
The wireless AP will show up connected to your PC’s wireless adaptor.

Wireless settings should be:

  • Enable Wireless = checked

  • Wireless network name = 4692 (but can be anything)

  • Security Mode = none

  • Wi-Fi Protected Setup Enabled = NOT checked

  • Wireless MAC Cloning = NOT checked
    Network settings should be:

  • LAN Connection Type = Static IP

  • IPv4 Address = 10.46.92.1
    *]Subnet Mask = 255.0.0.0