Go to Post since when is not sleeping, caring more about the robot and such bad for you? If it is how come I didn't get the memo? :ahh: - Sakura141 [more]
Home
Go Back   Chief Delphi > Technical > Electrical > CAN
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 17-02-2010, 13:35
MikeE's Avatar
MikeE MikeE is offline
Wrecking nice beaches since 1990
no team (Volunteer)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: New England -> Alaska
Posts: 381
MikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond repute
CAN and Java

[Cross posted to official First Forum http://forums.usfirst.org/showthread.php?p=38765]
We have spent the past couple of weeks attempting to get on-device closed-loop speed control working using Java, and can now report some success. We are using the Black Jaguar serial/CAN interface.

We initially looked at the CANJaguar project (both released and latest code) and discovered there was no Java support for the closed loop methods. Following Joe's advice, we used the C++ implementation as a template to create equivalent methods for Java. [We are lucky to have a very competent High School Senior on our team who has both the coding ability and the time to devote to this work!]

However our Java code only partially worked. The Jaguars did not set up correctly to use closed-loop speed control, and we always received a speed of zero from the Jags. We could run closed-loop speed using BDC-Comm. If we set up the Jags with BDC-Comm, we could subsequently use closed-loop control with the Java code. But power-cycling the Jags left them back in voltage control. We concluded that the problem was our set up code.

Meanwhile there was an update to the Java code on FirstForge, so we looked at that. It was essentially the same as our attempt, and using this update we still found that both our driving code and the posted sample code failed to set up the Jags to speed mode after power cycling.

Last weekend we borrowed a CAN analyser and looked at the messages on the bus. There were a few differences between the messages sent from BDC-Comm and those from our Java code or the posted Java code. BDC-Comm used the standard "setpoint" API call while the Java code uses the trusted version, which was mostly expected.
One other significant difference was that BDC-Comm called set speed reference (LM_API_SPD_REF) during initialization, although the documentation implies this is unneccessary. When we tried explicitly setting the speed reference source to encoder in our Java code, everything worked correctly, even start-up after the Jags are power-cycled.

So, we seem to have a solution, but I can't explain why we needed to send the extra configuation message. Any ideas?
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use slot 6 for digital module in JAVA? mark.amber Programming 3 13-02-2010 10:56
Where can I find camera tracking code for Java? nikRbokRz Java 4 20-01-2010 23:35
You can explain how robotics can help with ocean discovery and sustainability. ebarker General Forum 0 30-09-2009 19:01
**FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION*** Pjohn1959 Programming 37 31-08-2009 15:55
Eclipse Plugin, Linux, and a Java Loader shtylman Programming 5 17-01-2008 14:44


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

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


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