Go to Post Sadly this bot uses better punctuation and capitalization than many on this site. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
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
  #9   Spotlight this post!  
Unread 09-11-2001, 14:02
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Small Step toward signed math...

Small step toward signed math:

The main reason I want to use signed math is I want my division to work out properly. In 2's complement math, adds, subtracts, and multiplies take care of themselves (mostly). It is the divide operation that give folks the hassles.

How about if you could tag a part of an expression that may be of unknown sign and then the code could get the math right.

For example:
PWMoutput = (error term) * FeedbackGain >> FeedbackScaling + $7F MAX $FE + $8000 MIN $8000 - $8000

If would be nice if I could flag (error term) as signed for the purposes of the division ">> FeedbackScaling"

The pre-processor could then put in the right IFs, Tests, Gotos, etc. that are typically required to get the division to work right.

It would also be nice to an automatic way to make sure that the results are within the right range for an 8 bit PWM output, eliminating the need for all the MAX's & MIN's and $8000's

Just a thought.

Joe J.

Last edited by Joe Johnson : 09-11-2001 at 14:09.
 


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
PBASIC ARCTAN function Greg Ross Programming 14 11-05-2003 12:28
Obscure PBASIC for RoboEmu rbayer Programming 1 28-03-2003 23:57
PBasic 2.5 vs. 2.0 Anthony Kesich Programming 6 09-02-2003 22:06
emulationFIRST (aka PBasic emulator) Matt Leese Programming 5 30-06-2002 12:06
PBASIC Loop Speed? archiver 2001 3 23-06-2002 23:46


All times are GMT -5. The time now is 09:35.

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