I was wondering if it would be possible to switch between closed loop position mode and open loop mode on the JRK motor controller. I have an application for controlling an R2D2 dome. Initially I plan on using a magnetic encoder to provide feedback for the JRK controller so I can do position control, but I would like to be able to switch to open loop mode sometimes so I could spin the dome 360 degrees and few times around.
I didn’t see any serial commands to do this. Could this be added? Or is there a way to do this now that I didn’t see?
Unfortunately, it is not possible to switch any of the jrk’s configuration parameters on the fly. However, I understand that this is essential for a good R2D2 imitation, and there is something you can do about it - if you set the target to a value that is out of the range of what your feedback sensor provides, you can get it to drive the motor continuously in one direction or the other. If you do this while monitoring the feedback value, you can probably even count exactly how many times it has spun around and stop it in a controlled way.
Usually this is behavior that you want to avoid in a feedback system, so many of our options are designed to make it easy to prevent it: watch out for settings on the feedback or error tabs that would cause it to shut down when it spins out of the normal range of motion.
By the way, how does your magnetic encoder work? Does it provide an analog voltage out to indicate the angle of the shaft, like a potentiometer? The ability to spin all the way around would make a magnetic sensor a very interesting alternative to potentiometers, perhaps even usable for wheel encoding on a robot - could you post a link to the product you are using?
I am using the Reprap magnetic encoder. See http://reprap.org/bin/view/Main/Magnetic_Rotary_Encoder_1_0
It outputs quadrature, I2C, PWM and analog 0-5V. The board itself costs $2 and the chip it uses is about $5. You just place a diametrically magnetized magnet above or below the chip and turn it.
I’ll try the trick you mentioned to put the target out of range and see how it works.
That’s a interesting board that I had not seen, thanks! Are you using the GM3 motors that the board is designed for?
Good luck, and please do let us know how your project goes.