Hi Jorn,
It should be possible to deal with this kind of motor/controller configuration using asynMotorController and asynMotorAxis. Based on how you describe it, I would think you would only need different kinds of asynMotorAxis class, either by deriving distinct classes for each type (eg. myControllerNormalAxis and myControllerPiezoAxis), or making one class that’s configurable.
It sounds like the encoder input cards would take the place of a standard axis card. So if that’s the case, then you may have to have a custom poller thread function in the derived asynMotorController class, which knows how to combine position/status readings from one axis object with the encoder reading from a different axis object. It would also be possible for an axis object to get hold of another axis object, and read information that way, but it’s probably best handled at the controller level.
Then in the st.cmd file you can configure the driver like so:
myController(6) #6 possible axes
myControllerNormalAxis(1)
myControllerNormalAxis(2)
myControllerNormalAxis(3)
myControllerNormalAxis(4)
myControllerNormalAxis(5)
myControllerNormalAxis(6)
or you can combined those into one function:
myControllerNormalAxes(6) #setup 6 axis objects on address 1-6
Then, say you have 3 encoder cards on slots 4-6, for the encoders for axes 1-3. There could be an additional controller function that deals with this:
myControllerEncoder(1,4) #encoder for axis 1 is on slot 4
myControllerEncoder(2,5) #encoder for axis 2 is on slot 5
myControllerEncoder(3,6) #encoder for axis 3 is on slot 6
Or something similar. There’s probably a few different ways to deal with this.
….
I just re-read your email, and I think you mean there’s a possible 6*6 axes on one crate (64 total axes). It still should be possible to deal with this, although it may be easier to impose some rules on how the encoders are mapped to axes - eg. for any 6 real axes, the encoders for those always map 1-1, so axis 1 will have its encoder on input 1 on the encoder card.
Cheers,
Matt
> On Jul 23, 2018, at 9:50 AM, Jörn Dreyer <[email protected]> wrote:
>
> Hello,
>
> I'm currently developing a driver for a in house build MotorControler based on
> a microcontroller. This can be accessed via ethernet using a dedicate
> protocol. The controller is housed in a 19" rack together with up to six
> driver cards each capable of driving 6 motors. Some of the driver cards can be
> replaced by encoder input cards. To make the system even more complex, there
> are two types of driver cards. One which drives stepper motors and one which
> drives piezo motors. These cards can not be mixed within the same crate, but
> can both be mixed with encoder input cards.
> Thus an axis (motor) can either have an encoder connected or not and you can
> have both combinations in the same crate.
>
> I started out with a driver based on asynMotorController. But the type of axis
> is hardcoded in this class, so I would need to code each possible combination
> in a separate class. This would make the code very complex and hard to
> maintain.
>
> What I would like to have is a motor controller class where an axis can be
> registered during startup of the IOC from the st.cmd file.
>
> Did somebody face a similar situation before? If so, how did you solve this?
> Any idea is welcome!
>
> Regards,
>
> Jörn
>
>
>
- References:
- Motor record question Jörn Dreyer
- Navigate by Date:
- Prev:
RE: Motor record question Mark Rivers
- Next:
RE: Motor record question Mark Rivers
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Motor record question Jörn Dreyer
- Next:
Questions about building a database for temperature interlock 김성빈
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
|