Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Talon SRX Labview Coding (http://www.chiefdelphi.com/forums/showthread.php?t=142821)

Coach Seb 30-01-2016 09:37

Talon SRX Labview Coding
 
We are a rookie team and don't know much about coding but we have set up 4 Talon SRX motor controllers on our robot and all are wired correctly using the CAN and daisy chaining them. I believe the error is in the code, we referred to the software manual to make this and we are getting various errors. Initially we have 2 motors on each side of our drive train so we are going to use the "slave method" for the second motor on each side. Once enabled we have two motor controllers LEDs light up solid orange and the other two alternate orange. In the manual it says there is damaged hardware but i think this is improbable. here is the code and the drive station error
https://www.dropbox.com/s/s1mz0oq0py...81%29.png?dl=0
https://www.dropbox.com/s/ek5xmqjr88...82%29.png?dl=0

SpazticJenga 30-01-2016 10:03

Re: Talon SRX Labview Coding
 
First of all, You are opening your motor controllers in Teleop, which constantly designates the motor controller positions every 10 ms, instead of in begin, where it is only designated once. I would recommend moving the code where you opened the Talon SRX's to begin, so that way you are designating the robot's software location only once.

What's currently happening is that your master motors are opening, but your slave motors do not know that they are slaved, and therefore aren't opening. Solid orange states that the motors are being designated in teleop, while flashing states that they are undesignated in code. Once they are all solid orange, you have opened all motors in code.

Coach Seb 30-01-2016 10:16

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by SpazticJenga (Post 1532368)
First of all, You are opening your motor controllers in Teleop, which constantly designates the motor controller positions every 10 ms, instead of in begin, where it is only designated once. I would recommend moving the code where you opened the Talon SRX's to begin, so that way you are designating the robot's software location only once.

What's currently happening is that your master motors are opening, but your slave motors do not know that they are slaved, and therefore aren't opening. Solid orange states that the motors are being designated in teleop, while flashing states that they are undesignated in code. Once they are all solid orange, you have opened all motors in code.

So i moved the signatures to begin and it is the same reaction.

SpazticJenga 30-01-2016 10:23

Re: Talon SRX Labview Coding
 
Have you addressed the Talon SRX's in the NI MAX web address? If not, you need to open a web browser with microsoft silverlight and type in your Robo-Rio's IP, and then select the Talons and set their locations.

Mark McLeod 30-01-2016 10:27

Re: Talon SRX Labview Coding
 
Any particular reason that you aren't starting with the default project?
It does everything you need except you have to change "Open 2 motors" to "Open 4 Motors" in Begin.vi

Coach Seb 30-01-2016 10:29

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by SpazticJenga (Post 1532374)
Have you addressed the Talon SRX's in the NI MAX web address? If not, you need to open a web browser with microsoft silverlight and type in your Robo-Rio's IP, and then select the Talons and set their locations.

Do you mean make them have individual IDs because I have done that?

ozrien 30-01-2016 10:35

Re: Talon SRX Labview Coding
 
Quote:

and the other two alternate orange. In the manual it says there is damaged hardware but i think this is improbable. here is the code and the drive station error
The Talon SRX User's Guide says Orange blink means CAN bus detected, robot disabled. Please review Section 2.3 in the Talon SRX User's Guide.

Section 16.3 in the Talon SRX Software Reference Manual has a suggestion for why your Talon is blinking orange instead of solid-orange.

Instructions for assigning device IDs and firmware-updating (must do both) are in Section 2 of the Talon SRX Software Reference Manual. Ids must be unique (Section 2.2).

Also there are FRC examples here...
https://github.com/CrossTheRoadElec

Coach Seb 30-01-2016 10:39

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by Mark McLeod (Post 1532377)
Any particular reason that you aren't starting with the default project?
It does everything you need except you have to change "Open 2 motors" to "Open 4 Motors" in Begin.vi

yeah but we have a CAN network not PWM, how would you change that?

ozrien 30-01-2016 10:43

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by Coach Seb (Post 1532378)
Do you mean make them have individual IDs because I have done that?

Did you also update the firmware? Also the wire overlap in the screenshot makes it difficult to confirm that the "Device ID" and "Master Device Number to follow" signals are not flipped around.

So in the roboRIO web-based config, there are a total of four Talons with IDS 1,2,3,4 then?

Coach Seb 30-01-2016 10:46

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by ozrien (Post 1532386)
Did you also update the firmware? Also the wire overlap in the screenshot makes it difficult to confirm that the "Device ID" and "Master Device Number to follow" signals are not flipped around.

So in the roboRIO web-based config, there are a total of four Talons with IDS 1,2,3,4 then?

yes the talons all have individual IDs 1-4, and when enabled there are two mcs that light up solid orange and 2 that are alternate orange. The firmware is also fully updated

ozrien 30-01-2016 14:17

Re: Talon SRX Labview Coding
 
Works for me - I posted a quick example as a sanity check (I used slightly different IDs).
https://github.com/CrossTheRoadElec/...ollowerExample

Coach Seb 30-01-2016 14:44

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by ozrien (Post 1532487)
Works for me - I posted a quick example as a sanity check (I used slightly different IDs).
https://github.com/CrossTheRoadElec/...ollowerExample

my code is identical and it still is reacting the same however i saw you had some java CAN script.. Is that necessary?

ozrien 30-01-2016 14:48

Re: Talon SRX Labview Coding
 
The LabVIEW_CANTalonFollowerExample folder contains a complete LV project. The sibling folders contain other LV, Java, and C++ projects, they are not involved.

You should consider trying this proven example (after adjusting the IDs), if the issue goes away then better study the differences. if the issue is still present, then you've ruled out software.

Coach Seb 30-01-2016 15:55

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by ozrien (Post 1532513)
The LabVIEW_CANTalonFollowerExample folder contains a complete LV project. The sibling folders contain other LV, Java, and C++ projects, they are not involved.

You should consider trying this proven example (after adjusting the IDs), if the issue goes away then better study the differences. if the issue is still present, then you've ruled out software.

I took the set up down to one master and one slave. now we have both at a solid orange and on the web interfavce it say it is working properly however we cant get any joystick/mootor response. the driver station is giving the error that a pwm channel is not allocated. but we dont have any pwm

ozrien 30-01-2016 16:14

Re: Talon SRX Labview Coding
 
It sounds there is something in your LV app that is referencing PWM. Maybe the default ArcadeDrive control is still referenced somewhere. Or some test code somewhere. This is why I suggested using the known-working-example first to determine the root-cause of the first issue you mentioned. It sounds like there are multiple problems.

If you post a screenshot, that might help determine what the PWM error is about.

Coach Seb 30-01-2016 16:30

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by ozrien (Post 1532582)
It sounds there is something in your LV app that is referencing PWM. Maybe the default ArcadeDrive control is still referenced somewhere. Or some test code somewhere. This is why I suggested using the known-working-example first to determine the root-cause of the first issue you mentioned. It sounds like there are multiple problems.

If you post a screenshot, that might help determine what the PWM error is about.

I have an identical program to the one posted and the driver station has more errors
https://www.dropbox.com/s/kapsr1jv6g...83%29.png?dl=0

Mark McLeod 30-01-2016 16:37

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by Coach Seb (Post 1532384)
yeah but we have a CAN network not PWM, how would you change that?

The same way you did in your example.
Change the drop down selection under Open 4 motors to "CAN Talon SRX"

Coach Seb 30-01-2016 16:44

Re: Talon SRX Labview Coding
 
Quote:

Originally Posted by Mark McLeod (Post 1532594)
The same way you did in your example.
Change the drop down selection under Open 4 motors to "CAN Talon SRX"

yeah but just to the left of default code is pwm port numbers...

Mark McLeod 30-01-2016 16:46

Re: Talon SRX Labview Coding
 
Those become CAN IDs after you've selected "CAN Talon SRX"
You have to delete the old PWM constants, then Create->Constant to replace them with the new CAN IDs.


All times are GMT -5. The time now is 20:07.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi