quick question about propforth
Rforbes
Posts: 281
Hey all,
Does propforth incorporate floating point math functionality? Something like the f32 object? I have a project that is math and trig intensive and might like to give it a try with p ropforth.
If it supports it.
Does propforth incorporate floating point math functionality? Something like the f32 object? I have a project that is math and trig intensive and might like to give it a try with p ropforth.
If it supports it.
Comments
Over in my scara robot arm project I developed fixed point trig and inverse trig functions which is another way to solve the problem
http://forums.parallax.com/showthread.php/151826-Scara-robot-using-servos-and-hardware-store-components-(Video)
By the way, I've watched your scara video several times. I love that thing!
Thanks!
I really haven't noticed if Propforth is faster than Spin because the gating item for most of my projects is the inertia of the robot. I tend to keep movements slow and controlled to avoid vibrations creeping in. If I added trapezoidal ramping I could speed things up a scooch, but I would still be well below the execution of even the slowest interpreter. The thing I liked about it was it being interpreted which has made certain kinds of projects easier.
AS I understand it, the forth software float is not a whole lot different in execution speed from any other implementation of software float on the prop, but you have to check with the other guys for actual numbers.
We found that any advantage to using float is negated by the extra support code and execution time.
Nick Lordi posted code to support a floating point coporcessor, alos on the down loads page or a wiki page. Here again it seems that the advantage of using the coprocessor is negated by the support code and the time it takes to transfer to and from the prop and the coprocessor. It was fine for Nick applications, and might be OK for yours. But Sal finds it quicker and easier to just do the math in scaled integer (or dump it to the PC or RPi and do the crunchy stuff on the workstation).
But the reality is that really fast floating point is always going to be in assembler code. Desktop PC's can run circles around a Propeller if you need a lot of number crunching and feeding the raw data into a spreadsheet may save time. In some cases, an XBee can wirelessly transmit data in real-time to a PC to be processed and handed back to the Propeller to take any action required.
... running on floating point hardware.
The propforth floating point package is optimized in assembler. The prop is integer. The float package is only going to be so fast, and not as fast as on float hardware.
What is it you are calculating? If you can state it as scaled integer, it will be faster and more accurate than float, and you will be smarter for figuring it out. Avoid float unless you have float hardware, unless you just want to prove that you can do it.