[Coco] moving files on bootup >> leading to that CNC Coco machine
Robert Gault
robert.gault at worldnet.att.net
Sat Feb 2 17:20:06 EST 2008
Robert Gault wrote:
> George Ramsower wrote:
>
>> Most of the inaccuracy in the total length is because of the way I was
>> doing the math when I move it in such a way that leaves fractions of
>> steps and those steps were getting out of sync with the real position
>> and the cheap lead screws which are nothing more than "all thread
>> rods". So, I'm working on converting actual, desired positions and
>> then converting that number to the stepping of the motors to get to
>> that point. This will help, but will not compensate for the threaded
>> rods.
>
>
> This reads like you are having problems with truncation and rounding of
> math results. In general, if you can't represent an answer exactly, the
> answer should be rounded off to +- half the highest precision.
>
> For example, Basic09 uses Real numbers that can represent values
> 0.0000000005 units apart. So that means calculations should have a test
> that in effect is:
> IF INT(a) <> INT(a+0.0000000005) THEN a=a+0.0000000005
> This won't be perfect but the error term for any calculation should be
> minimized rather than grow with each step.
>
> You'll get best results if you do an error analysis for all your
> calculations assuming errors are additive. If the result does not have
> acceptable precision, the you need to change your equations.
>
Ugh, that did not come out even close to what I wanted to say.
OK, your lash-up to the lathe will have a certain minimum alteration
depending the hardware. That change will be represented by some small
value in the Basic09 program controlling the lathe. The comparison needs
to be between whatever number comes out of the Basic09 equations and the
value for minimum change to the lathe. When a value is sent to the
lathe, it needs to be rounded to the precision of the lash-up.
For example, say the program sends a signal to a stepping motor and
calls for a fractional step. Then you need to send INT(a+0.5) to get
integral steps rounded both up and down to the closest whole number.
If the program requires more precision that available in Basic09, you
will need to compensate for that.
Such rounding will create a cumulative error which could become quite
large. That will require the program to maintain two lathe positions,
theoretical and actual. When the theoretical position requires sending
the lathe a signal even though the actual position is correct, the
program must cancel the signal but update the theoretical position.
There are other time controlled events that could cause your Basic09
program to lose sync with the lathe.
If there is a sensor on the lathe that needs to indicate compliance
with a signal, the Coco may not be sampling the signal often enough. If
there is no lathe feedback, you will need to build into the program a
fixed delay per number of stepping motor turns, giving the lathe the
theoretical time needed to comply with a command.
There will be some play in the lathe control system that will
translate into some minimum signal from the Coco. That should be used to
bias the theoretical lathe position.
I'm sure you have thought of the above when running lathes but might not
have tried to incorporate such compensation into the Coco program.
More information about the Coco
mailing list