Go to Post Hey Kid! Get off my lawn!!! - Joe Johnson [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-01-2016, 20:31
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,062
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Simple Motor Calculator for Linux/OS X

Several years ago Ether released a Simple Motor Calculator (http://www.chiefdelphi.com/media/papers/2432) that lets you specify a motor and some parameters and it will tell you what the motor is doing at that point (ex specify the current a motor is running at and it will tell you torque, speed, efficiency) The issue is it was only for Windows and a handful of folks don't run Windows... so I took the equations he provided and put them in a simple command line application.

https://github.com/schreiaj/motorcalc-uni Here is the code, or for those of you who just want to try it here's the releases page https://github.com/schreiaj/motorcalc-uni/releases please try it out and let me know if I can make it more useful to you.

Currently supports CIM, 2xCIM, 3xCIM , Bag, AM775, 775pro, and AM9015 and specifying amps or torque. I'm aiming to add in rpm soon.

Hope you find it useful.
__________________




.
  #2   Spotlight this post!  
Unread 22-01-2016, 22:43
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 486
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: Simple Motor Calculator for Linux/OS X

You may want to document your build dependencies. On Ubuntu 15.10 I installed go-bindata and golang-go.

To build I had to change "motors.csv" in the makefile to ".". At least the version of go-bitdata that I have only expects to see directories in that position.

The clean target of the makefile can sometimes fail. Consider adding the "-f" flag to "rm".

When the program is run with no arguments it prints an out of range exception rather than an error message that says what it expected. Similarly, there is no "--help".

When an unknown motor name is encountered the output is lots of NaN rather than an error that the program doesn't know about the motor. For example, try typing "cim" rather than "CIM".
  #3   Spotlight this post!  
Unread 23-01-2016, 19:04
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,062
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Simple Motor Calculator for Linux/OS X

Quote:
Originally Posted by SoftwareBug2.0 View Post
You may want to document your build dependencies. On Ubuntu 15.10 I installed go-bindata and golang-go.

To build I had to change "motors.csv" in the makefile to ".". At least the version of go-bitdata that I have only expects to see directories in that position.

The clean target of the makefile can sometimes fail. Consider adding the "-f" flag to "rm".

When the program is run with no arguments it prints an out of range exception rather than an error message that says what it expected. Similarly, there is no "--help".

When an unknown motor name is encountered the output is lots of NaN rather than an error that the program doesn't know about the motor. For example, try typing "cim" rather than "CIM".


Yup, it's on my todo list (pull requests are also accepted)

So --help and some warnings for not supplying enough args, and throw an error on incorrect motor names.
__________________




.
  #4   Spotlight this post!  
Unread 11-02-2016, 08:40
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,062
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Simple Motor Calculator for Linux/OS X

So some updates and questions for your Software Bug - I'm going through and have added some better command line parsing, so I'll release that as soon as I nail down this next issue.

Getting the name of a motor wrong - When this happens do you think a best guess and run approach would be preferred to a "Did you mean CIM" and exit approach (similar to git's cli when you screw up a command)? I'm working on getting some fuzzy string matching working in and was curious what would be preferred. If it were a long running command or one with side effects I can see the benefit of the git "suggest and exit" approach. But being as it takes very little time to run and changes nothing except standard out I think the "best guess" approach might work fine.

Sorry this took so long, turns out build season is time consuming.
__________________




.
  #5   Spotlight this post!  
Unread 11-02-2016, 13:46
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 486
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: Simple Motor Calculator for Linux/OS X

My general feeling is that if there's any chance of the program being wrong it shouldn't try to run based on a guess. So for example, running with the 'closest' name to a user argument might be problematic because if they typed in something that there wasn't data for you might get wrong data out. But on the other hand, a case-insensitive matching wouldn't have that problem since it's reasonable to assume that there won't be a new motor whose name differs only in capitalization.
  #6   Spotlight this post!  
Unread 11-02-2016, 13:49
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,062
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Simple Motor Calculator for Linux/OS X

Quote:
Originally Posted by SoftwareBug2.0 View Post
My general feeling is that if there's any chance of the program being wrong it shouldn't try to run based on a guess. So for example, running with the 'closest' name to a user argument might be problematic because if they typed in something that there wasn't data for you might get wrong data out. But on the other hand, a case-insensitive matching wouldn't have that problem since it's reasonable to assume that there won't be a new motor whose name differs only in capitalization.
Ok, then I'll go with the git cli model of Exit and say "hey maybe you meant this"

And yes, the search will be case insensitive, that was an oversight... still new to Go.
__________________




.
  #7   Spotlight this post!  
Unread 11-02-2016, 14:20
marshall's Avatar
marshall marshall is online now
My pants are louder than yours.
FRC #0900 (The Zebracorns)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2003
Location: North Carolina
Posts: 1,274
marshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond reputemarshall has a reputation beyond repute
Re: Simple Motor Calculator for Linux/OS X

Quote:
Originally Posted by Andrew Schreiber View Post
Ok, then I'll go with the git cli model of Exit and say "hey maybe you meant this"

And yes, the search will be case insensitive, that was an oversight... still new to Go.
Fair warning with Go if you use any external libraries and don't explicitly pull them in and instead use the functionality to just have Go update them via Git.. you can end up in a situation where your program breaks because the external library is broken. That being said, I do enjoy me some Go programming... anyone want to port it to the RoboRIO?
__________________
"La mejor salsa del mundo es la hambre" - Miguel de Cervantes
"The future is unwritten" - Joe Strummer
"Simplify, then add lightness" - Colin Chapman
  #8   Spotlight this post!  
Unread 12-02-2016, 09:17
Andrew Schreiber Andrew Schreiber is offline
Joining the 900 Meme Team
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,062
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Simple Motor Calculator for Linux/OS X

Quote:
Originally Posted by marshall View Post
Fair warning with Go if you use any external libraries and don't explicitly pull them in and instead use the functionality to just have Go update them via Git.. you can end up in a situation where your program breaks because the external library is broken. That being said, I do enjoy me some Go programming... anyone want to port it to the RoboRIO?
Yeah, I've found that version locking dependencies isn't quite as robust as I've come to expect from things like ruby gems and npm.

Also fair warning about cross compiling - it's fine with plain old go code, but the second you start dealing with cgo your life gets complicated quick.

I too would welcome a WPILib port of Go, but I don't know if it really gives you much benefit over the other languages out there. Python/Lua are nice because they are a very different type of language.
__________________




.
Closed Thread


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 15:58.

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