Author Topic: Trigonometry Calculation  (Read 12165 times)

scottsaunders

  • Guest
Trigonometry Calculation
« on: April 14, 2003, 05:56:00 AM »
Are trigonometry calculations possible?

I'm trying to do:

Y=3/cos(A)
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Trigonometry Calculation
« Reply #1 on: April 14, 2003, 12:28:36 PM »
Sorry. Not supported.

The M-series PLC do not support floating point math. But it's 32-bit integer math is good enough for 95% of control system.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

Joel Moore

  • Full Member
  • Posts: 128
    • View Profile
Re: Trigonometry Calculation
« Reply #2 on: May 05, 2003, 01:25:39 PM »
I know this is an old post but I just thought I'd mention the idea of using tables of trig calculations (wasn't that how they did it in the old days?).  It uses up space but if you have it and you can tolerate the imprecision then you can load up a few hundred memory locations with calculation results and just reference them.  Scale them by 100 or 1000 to avoid losing too much precision.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Trigonometry Calculation
« Reply #3 on: May 05, 2003, 05:41:41 PM »
Thank you for the update. Yes, it is possible to use a look up table to solve the trig function but provided it is only limited to a small range of values.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

raan

  • Newbie
  • Posts: 31
    • View Profile
Re: Trigonometry Calculation
« Reply #4 on: June 19, 2003, 05:21:39 PM »
In the past with another brand of plc, I have used a simple math technique of approximating a trig function with a taylor series power expansion of the form:
cos(x)= 1-(x*x)/2  +(x*x*x*x)/(1*2*3*4) -(x*x*x*x*x*x)/(1*2*3*4*5*6) .....see any calculus book for the taylor series expansion of the cosine function
raan
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »