Duet 3 Magnetic Encoder Usage
-
Dear all,
we recently installed our first magnetic encoder from duet together with the 1HCL extension boards.
Our mainboard is a Duet3 6HC board together with an RasPi.
Everything went quite smoothly, including the calibration and manual tuning.However, I have a more general question about the capabilites of the generated encoder data, with the aim to evaluate different printing settings in hindsight. In the bestcase I would prefer to either capture the data directly into an .csv file or to set a global variable with the respective values, e.g. the current error.
So far I found the following approaches (with some questions attached):
M569.5: Closed loop data collection - Can I use this command for a "long time" data capture? The variables are all documented, however I did not fully understand if that can be implemented to supervise a full printing process. Am I supposed to just leave out the "T" and "V"?
Object model:
I could find 7 different entries in the object model that refer to the "closed loop" section for the extension boards (see below). However, I did not really find any explanation in the Documentation what those actually refer to. I think the "Position Error" might be the best indicator for me? Does this refer to the "Current Error" that is plotted in the Duet Plugin for the PID Tuning?Thanks for the help and any further suggestions!
boards[].drivers[].closedLoop
Closed-loop settings (if applicable)boards[].drivers[].closedLoop.currentFraction
Current fractionboards[].drivers[].closedLoop.currentFraction.avg
Average fractionboards[].drivers[].closedLoop.currentFraction.max
Maximum fractionboards[].drivers[].closedLoop.positionError
Position errorboards[].drivers[].closedLoop.positionError.max
Maximum position errorboards[].drivers[].closedLoop.positionError.rms
RMS of the position error -
@StefanSch I don't think there's any way to collect data directly from the encoder or 1HCL. I also don't think M569.5 can be used, as the data is collected into memory before being written to the csv, so is limited by the available memory. As you need to specify the number of samples and the sample rate, it might be possible to collect a short amount of data. I guess it depends on what data you need from the ones that can be recorded.
You can query the Object Model at up to 250ms intervals. We have done this in the past to collect data over a long period of time; the OM can be queried and data captured and recorded (we have shown a demo using RESTful API to capture data, recording to an InfluxDB time-series database), then queried (we used Grafana to graph the data).
Ian
-
@droftarts ok, thank you so far, even if that's a little pitty
I will try to figure around with the M569.5 a little then. Nevertheless, is there some additional information in regards to the object model entries available? -
-
@jay_s_uk jeah thats where I looked first, but the documentation is really just the name of the variables, which makes it kinda hard to understand for me what the meaning of those really is.
Thanks for the reply! -
@StefanSch for the 1HCL boards and M23 motors running in closed loop mode there is additional data available in the object model, under boards[N].drivers[0].closedLoop. The values available are the average and maximum fraction of the configured motor current used, and the rms and maximum position error in full steps of the motor. Both of them refer to the preceding 250ms interval.
-
@dc42 thanks a lot! That's exactly what I needed. Maybe it would be worthwhile to add this to the objectmodel documentation directly?
Do you know if there is a current development to provide additional data? That might be useful for reasearch centered applications as well.EDIT: Does "RMS" stand for the root mean square of the motor error? Or is there Another meaning in this context?
-
@StefanSch yes rms is root mean square.
The closed loop documentation already mentions these but without any detail, https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation#boardsdriversclosedloop. @chrishamm can you add the detail that I gave in my previous post in this thread?
-
@dc42 perfect, thanks a lot! I think the topic can be closed then.
-
undefined dc42 marked this topic as a question
-
undefined dc42 has marked this topic as solved