Having mostly mastered CAN Open (well fix one problem and now your see the next problem more clearly
) I have been looking at how to refine my motor control.
I have two motors that are couple to the load with some elasticity - literally. Lets just approximate the system as two motors that drive a common shaft via belts and the are mounted such that for the shaft to rotate the motors rotate in opposite directions.
So I immediately discarded the idea of using the motors in speed controlled mode. A short experiment proved my theory right, One motor will take over all of the load delivery while the other will be left lazy. I want them to share.
So I went with Torque control. I send a sync message to the network, get the speed of the motors back, average that speed and decide on how to change the torque, then I send the new torque setting. It works OK, I am still debating with myself as to whether I should update often with small values or less often with larger values. At his point I started looking around for information on how to consider setting up a DS402 motor driver to run in torque mode with my external controller (CAN Open master) doing the speed control.
I came across an example of a non CAN Open motor system for a conveyor belt where one motor is run in speed control mode with additional "helper" motors running in torque mode. EUREKA!
But that makes my wonderings about precise settings even more relevant as now the two motors will have different behaviors while achieving the same thing together. The idea is that I no longer need to send a sync message to get the speed from each motor, process that and issue new torque commands. Instead I would send the speed required to one motor and send the sync message. The speed controlled motor will respond with it's target torque as well as actual torque. The torque controlled motor will be set up to receive this target torque as it's torque demand and so setting both motors to the same torque. In this way there is no race between the two motors with one taking over but I get to use the much faster and certainly better designed speed control loop in the motor driver than my own machination that is just keeping up.
Obviously that the motors are mounted opposite ways round is a problem as whatever the torque of one motor is the other needs the negative of the number. I currently do this in my program before sending the numbers out to the two motors. There is a setting somewhere for the encoder that basically reverses it's interpretation, need to look more into this one to see if there is a way to overall reverse the motor direction.
What I do wonder about though is the tuning of the two motors works. I guess that as the helper motor is just that it's torque does not need to be identical but I also do not want to confuse the speed control loop in the speed controlled motor. I suspect that the torque controlled motor needs to react faster than the speed controlled one so that it adds or subtracts it's torque in time for when the speed controlled motor is expected to achieve it's speed and so not confuse the system.
Has anyone ever done this?