Hi everyone,
I am in the process of building a Pick-And-Place machine (OpenPNP) and I am currently using the excellent Duet Mini 5+. I was thinking about the feasibility to go Closed Loop for the CoreXY kinematics that I chose, which generally does not seem to be an issue (when using rotary encoders!).
However I was also thinking about using chinese linear encoders (E.g. Sino KA200) for even better positional accuracy and I am evaluating whether such a setup is possible: Closed Loop on CoreXY with A/B motors in conjunction with X/Y linear encoders.
There was a quick discussion already in the forums (https://forum.duet3d.com/topic/36201/corexy-linear-encoders-1hcl-closed-loop-expansion-board/) and the consensus is, that it is currently not possible. After a few hours looking through the code, I would pretty much confirm that this is currently not possible, since the encoder is always directly mapped to the motor, way after any kinematics calculations have been carried out.
I am thinking about tackling this in the future (sounds like a nice challenge) and so far I have devised the following plan:
- Get a EXP3HC board (a board with more than one motor driver) so the firmware has access to two local motor drivers.
- Make firmware support CLOSED_LOOP feature. One encoder will run on the PDEC hardware and another encoder will be implemented using CCL. I think this should be possible, there is an appnote on the old AT(x)mega processors on exactly this. I think it could be made to work on the SAME5X (https://ww1.microchip.com/downloads/en/Appnotes/Interf-Quad-Encoder-CCL-w-TCA-TCB-DS00002434C.pdf).
- Validate functionality using two regular rotary encoders on motor A/B connected on one of the expansion headers. From a quick glance, the required pins (PDEC and CCL) seem to be on the SPI1 header. +5V/GND could be sourced from another header
- Implement a "encoder forward matrix" (or reverse matrix) feature into the expansion firmware that defines the relationship between encoders and drives. Currently each drive has their own encoder attached. This would need to be reworked a bit, so that one driver can access all (both) encoder positions and mix&match them according to the forward matrix. Ideally the user should be able to configure this encoder forward matrix using the M569.1 command similar to the M669 X<> Y<> Z<> command.
- Change the closed loop code (and tuning code) to get encoder values through the forward (or reverse) matrix so that each PID motor controller sees only decoupled "virtual" axes that they can use for control
I think I could make 1-3 work on my own, since it's basically a bit of hardware fiddling and modifying the expansion firmware. However for points 4-5 I am too inexperienced with the RRF stuff to be able to implement this. Also I am not yet sure if there are some caveats when implementing the encoder decoupling into the ClosedLoop class. Are there situations where the coupling is unwanted (e.g. encoder tuning? encoder calibration?). Issue #11 could be related to exactly this question.
What do you think? Is this of enough interest to get one or two persons to help or is this too niche? Not sure what Duet3D's plans on closed loop are or if customer interest in closed loop is too low to sink effort into this.
Hi everyone,
I am in the process of building a Pick-And-Place machine (OpenPNP) and I am currently using the excellent Duet Mini 5+. I was thinking about the feasibility to go Closed Loop for the CoreXY kinematics that I chose, which generally does not seem to be an issue (when using rotary encoders!).
However I was also thinking about using chinese linear encoders (E.g. Sino KA200) for even better positional accuracy and I am evaluating whether such a setup is possible: Closed Loop on CoreXY with A/B motors in conjunction with X/Y linear encoders.
There was a quick discussion already in the forums (https://forum.duet3d.com/topic/36201/corexy-linear-encoders-1hcl-closed-loop-expansion-board/) and the consensus is, that it is currently not possible. After a few hours looking through the code, I would pretty much confirm that this is currently not possible, since the encoder is always directly mapped to the motor, way after any kinematics calculations have been carried out.
I am thinking about tackling this in the future (sounds like a nice challenge) and so far I have devised the following plan:
I think I could make 1-3 work on my own, since it's basically a bit of hardware fiddling and modifying the expansion firmware. However for points 4-5 I am too inexperienced with the RRF stuff to be able to implement this. Also I am not yet sure if there are some caveats when implementing the encoder decoupling into the ClosedLoop class. Are there situations where the coupling is unwanted (e.g. encoder tuning? encoder calibration?). Issue #11 could be related to exactly this question.
What do you think? Is this of enough interest to get one or two persons to help or is this too niche? Not sure what Duet3D's plans on closed loop are or if customer interest in closed loop is too low to sink effort into this.