Go to Post I, for one, refused to be railroaded down this train of thought so easily! Geeze, one lousy game hint just builds up steam for any old picture to come through and go two pages in a matter of hours. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-15-2018, 12:19 AM
juchong's Avatar
juchong juchong is offline
Electrical Engineer
AKA: Juan Chong
FRC #2655 (Flying Platypi)
Team Role: Engineer
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Greensboro, NC
Posts: 126
juchong is a jewel in the roughjuchong is a jewel in the roughjuchong is a jewel in the rough
ADIS16448 C++ and LabVIEW Update

Hi everyone!

This year, NI has built "Auto SPI Transfers" to the RoboRIO image to allow for high performance sensors to be used on FRC robots. I'm working on updating each of the three supported languages and would like your help to try and find any bugs I may have introduced throughout the process.

Please feel free to reply to this thread or PM me if you find anything, or if you have any questions about using the drivers.

As of 01/15/18 I've updated the LabVIEW and C++ flavors of the driver and should have Java updated sometime this week. Please be sure to check the GitHub site for any updates!

In case you're wondering whether there's any performance improvements, I've noticed a ~30% decrease in CPU usage versus the old LabVIEW driver and a ~20% decrease when using the new C++ driver!
__________________
Team 1817 | Llano Estacado RoboRaiders | Mentor | 2007-2011
Team 3730 | NuBots | Mentor | 2012
Team 3005 | RoboChargers| Mentor | 2013-2014
Team 2655 | The Flying Platypi | Mentor | 2014-2018
Analog Devices Inc. | KoP Supplier | FRC Gyro Designer | More Info


Reply With Quote
  #2   Spotlight this post!  
Unread 01-23-2018, 02:23 AM
juchong's Avatar
juchong juchong is offline
Electrical Engineer
AKA: Juan Chong
FRC #2655 (Flying Platypi)
Team Role: Engineer
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Greensboro, NC
Posts: 126
juchong is a jewel in the roughjuchong is a jewel in the roughjuchong is a jewel in the rough
Re: ADIS16448 C++ and LabVIEW Update

Updates to Java are now live! Check out the repository for more information! https://github.com/juchong/ADIS16448-RoboRIO-Driver
__________________
Team 1817 | Llano Estacado RoboRaiders | Mentor | 2007-2011
Team 3730 | NuBots | Mentor | 2012
Team 3005 | RoboChargers| Mentor | 2013-2014
Team 2655 | The Flying Platypi | Mentor | 2014-2018
Analog Devices Inc. | KoP Supplier | FRC Gyro Designer | More Info


Reply With Quote
  #3   Spotlight this post!  
Unread 02-12-2018, 10:13 PM
nelsonagarzon nelsonagarzon is offline
Registered User
FRC #1159
 
Join Date: Jan 2018
Location: Whittier
Posts: 9
nelsonagarzon is an unknown quantity at this point
Re: ADIS16448 C++ and LabVIEW Update

Hello,

I am able to run the calibration and the demo code in LabVIEW from Github, but I don't know how to use all this all information. Is there any code implementation for Autonomous using the ADIS16448?

Also, our robot does not go straight and I was hoping I could use this board to fix that, but I don't know how.

Any help will be greatly appreciated.

Thank you
Reply With Quote
  #4   Spotlight this post!  
Unread 02-12-2018, 11:12 PM
juchong's Avatar
juchong juchong is offline
Electrical Engineer
AKA: Juan Chong
FRC #2655 (Flying Platypi)
Team Role: Engineer
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Greensboro, NC
Posts: 126
juchong is a jewel in the roughjuchong is a jewel in the roughjuchong is a jewel in the rough
Re: ADIS16448 C++ and LabVIEW Update

Quote:
Originally Posted by nelsonagarzon View Post
Hello,

I am able to run the calibration and the demo code in LabVIEW from Github, but I don't know how to use all this all information. Is there any code implementation for Autonomous using the ADIS16448?

Also, our robot does not go straight and I was hoping I could use this board to fix that, but I don't know how.

Any help will be greatly appreciated.

Thank you
Hi! What drive system are you using for your robot? If you're using Arcade drive, I could probably throw something together quickly that gets your robot over the baseline.
__________________
Team 1817 | Llano Estacado RoboRaiders | Mentor | 2007-2011
Team 3730 | NuBots | Mentor | 2012
Team 3005 | RoboChargers| Mentor | 2013-2014
Team 2655 | The Flying Platypi | Mentor | 2014-2018
Analog Devices Inc. | KoP Supplier | FRC Gyro Designer | More Info


Reply With Quote
  #5   Spotlight this post!  
Unread 02-13-2018, 10:26 AM
nelsonagarzon nelsonagarzon is offline
Registered User
FRC #1159
 
Join Date: Jan 2018
Location: Whittier
Posts: 9
nelsonagarzon is an unknown quantity at this point
Re: ADIS16448 C++ and LabVIEW Update

Yes, we are using Arcade drive. Our team is using LabVIEW

Thank you
Reply With Quote
  #6   Spotlight this post!  
Unread 02-13-2018, 11:51 AM
juchong's Avatar
juchong juchong is offline
Electrical Engineer
AKA: Juan Chong
FRC #2655 (Flying Platypi)
Team Role: Engineer
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Greensboro, NC
Posts: 126
juchong is a jewel in the roughjuchong is a jewel in the roughjuchong is a jewel in the rough
Re: ADIS16448 C++ and LabVIEW Update

I've added an example to the GitHub repository with a very basic PID-based arcade drive implementation. I haven't tested it, but it should get you close!

https://github.com/juchong/ADIS16448...%20Example.zip
__________________
Team 1817 | Llano Estacado RoboRaiders | Mentor | 2007-2011
Team 3730 | NuBots | Mentor | 2012
Team 3005 | RoboChargers| Mentor | 2013-2014
Team 2655 | The Flying Platypi | Mentor | 2014-2018
Analog Devices Inc. | KoP Supplier | FRC Gyro Designer | More Info


Reply With Quote
  #7   Spotlight this post!  
Unread 02-13-2018, 04:22 PM
nelsonagarzon nelsonagarzon is offline
Registered User
FRC #1159
 
Join Date: Jan 2018
Location: Whittier
Posts: 9
nelsonagarzon is an unknown quantity at this point
Re: ADIS16448 C++ and LabVIEW Update

This is great! Thank you very much.

I have a couple of questions.

1. If I want to make a left turn, would I set the Setpoint in the PID to 90 and feed the Z angle to the Process variable in the PID?

2. When we drive the robot with the joystick, the robot does not go straight. How can I use the example code for teleop?

Thanks again
Reply With Quote
  #8   Spotlight this post!  
Unread 02-13-2018, 04:25 PM
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 220
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
Re: ADIS16448 C++ and LabVIEW Update

Sorry if I missed something obvious but what sensor does your code enable us to use? Sounds cool! :-D
Reply With Quote
  #9   Spotlight this post!  
Unread 02-13-2018, 04:47 PM
nelsonagarzon nelsonagarzon is offline
Registered User
FRC #1159
 
Join Date: Jan 2018
Location: Whittier
Posts: 9
nelsonagarzon is an unknown quantity at this point
Re: ADIS16448 C++ and LabVIEW Update

The code is for the ADIS16448
Reply With Quote
  #10   Spotlight this post!  
Unread 02-13-2018, 04:48 PM
Hjelstrom's Avatar
Hjelstrom Hjelstrom is offline
Mentor
FRC #0987 (High Rollers)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2005
Location: Las Vegas
Posts: 220
Hjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond reputeHjelstrom has a reputation beyond repute
Re: ADIS16448 C++ and LabVIEW Update

This IMU?

https://www.digikey.com/products/en/...67?k=ADIS16448

Or is there a cheaper source?
Reply With Quote
  #11   Spotlight this post!  
Unread 02-13-2018, 05:13 PM
nelsonagarzon nelsonagarzon is offline
Registered User
FRC #1159
 
Join Date: Jan 2018
Location: Whittier
Posts: 9
nelsonagarzon is an unknown quantity at this point
Re: ADIS16448 C++ and LabVIEW Update

This one,

https://ez.analog.com/blogs/engineer...2016-frc-teams


Our team had it laying around, not sure when we got it. I think it came with the kit in previous years.

JUCHONG might know about the prices and where to get it.
Reply With Quote
  #12   Spotlight this post!  
Unread 02-13-2018, 05:24 PM
Bkeeneykid's Avatar
Bkeeneykid Bkeeneykid is offline
Mr. Magic Intake Himself
AKA: Devin Keeney
FRC #1982 (Cougar Robotics); Season Long Fantasy FIRST (WCNC)
Team Role: Leadership
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Lenexa, Kansas
Posts: 606
Bkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant futureBkeeneykid has a brilliant future
Re: ADIS16448 C++ and LabVIEW Update

Quote:
Originally Posted by Hjelstrom View Post
This IMU?

https://www.digikey.com/products/en/...67?k=ADIS16448

Or is there a cheaper source?
https://firstchoicebyandymark.com/fc18-150
__________________
2010-2012: A Whole Buncha FLL Teams; Team Spirit, Gracious Professionalism Award winner
2015-Current: FRC 1982, Captain, Electrical Lead, Gracious Professionalism
Beginning FIRST Volunteer

Moderator on the FIRSTwiki


Reply With Quote
  #13   Spotlight this post!  
Unread 02-14-2018, 05:13 AM
ngreen ngreen is online now
Registered User
AKA: Nelson Green
FRC #1108 (Panther Robotics)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Paola, KS
Posts: 920
ngreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant futurengreen has a brilliant future
Re: ADIS16448 C++ and LabVIEW Update

I may be wrong, but I don't think the PID will update the value in the above auto code. Also, the outputs need to be switched, as it currently is going into the y-axis.

I worked a little on these problems last year, but the code is pretty messy (and broken in teleop.vi). I'll link it anyhow: https://github.com/frc1108/2017-Robo...Attackv1.1.zip

I wanted to drive straight in both teleop and auto and to make turns in auto. I borrowed from older code (some which used PID and some that didn't). PID is used in the auto turns but the rest is manually calculating a compensation for the heading from the gyro value and setpoint.

After setting up the gyro in begin.vi, the angle is read in periodic tasks.vi and saved as a global variable (Note: our RIO was vertical so the axis is not the default).

For driving straight (with encoders) in auto, DriveDist.vi was used. GyroAssist is a global boolean variable that when true uses the gyro and when false sets steering to 0. (There are a couple mistakes with my use of this**). Comp is a global that is the output from either PID or in our case HeadingCompensation.vi.

For turning in auto, PID was used in DriveTurn.vi.

Driving straight in teleop used some of the same code as driving straight in auto. There is some code in Periodic Tasks that saves the yaw (angle) for the setpoint. The simplest way to use the gyro in teleop is to have a button that sets this and then use a PID (or compensation) while pressed. I was trying to make it drive straight without a button, using just the joystick axis values. It works but I like the button better. But to do that, I made it so that within a threshold around the steering axis the gyro would control steering. Setting the angle setpoint was done by saving new values whenever the steering axis value returned within the threshold. Both these were coded into the TriggerGyroDrive.vi and a third axis was used to select between modes. In teleop.vi, this trigger is currently disconnected because I last changed to a joystick that used the z-axis for steering (which was the axis I was using as a selector when I was using the trigger).

There are likely more elegant ways. You can replace the whole compensation thing with PID. The compensation algorithm is borrowed code but my understanding is basically it is a proportional (P) response, which is likely enough.

** -- I tried to use it when I should have created an additional variable for saving the angle during teleop. Also, I hardcoded it to true in DriveTurn.vi, which I think is a mistake.)
Reply With Quote
  #14   Spotlight this post!  
Unread 02-15-2018, 01:00 AM
juchong's Avatar
juchong juchong is offline
Electrical Engineer
AKA: Juan Chong
FRC #2655 (Flying Platypi)
Team Role: Engineer
 
Join Date: Aug 2008
Rookie Year: 2008
Location: Greensboro, NC
Posts: 126
juchong is a jewel in the roughjuchong is a jewel in the roughjuchong is a jewel in the rough
Re: ADIS16448 C++ and LabVIEW Update

Quote:
Originally Posted by Bkeeneykid View Post
That's the one! The ADIS16448 is currently only available through FIRST choice
__________________
Team 1817 | Llano Estacado RoboRaiders | Mentor | 2007-2011
Team 3730 | NuBots | Mentor | 2012
Team 3005 | RoboChargers| Mentor | 2013-2014
Team 2655 | The Flying Platypi | Mentor | 2014-2018
Analog Devices Inc. | KoP Supplier | FRC Gyro Designer | More Info


Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:47 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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