On 10 July 2012 16:49, Ralph Stirling <ralph.stirl...@wallawalla.edu> wrote:

> My question now is the best way to switch between encoders while
> the carriage is moving, with minimal disturbance to the motion
...
> Can I have this kind of
> sequential logic implemented directly in a hal file, or do I need to go
> to ClassicLadder?

I think that this would be far better handled in a HAL comp than in
CL. (But then I have never used CL).

If you could guarantee that you would always be counting on two
encoders, never 1 and never 3, then you could simply sum all the
encoders together and use that as your feedback.

However, that can't be guaranteed, so you need a comp. I think it
would be quite simple.

The comp would have its own internal count for each encoder and an
accumulator. Every servo thread it would consider the counts delta of
all encoders. If there is one encoder with a change in counts, use
that one. if there are 2 then use the same one as last time, if there
are three then use the middle one.

See:
http://www.linuxcnc.org/docs/html/hal/comp.html

-- 
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to