I am trying to code up a closed loop control system on force generated by the paring of strong rare earth magnets. I do not have much experience with PID logic but i have a weak grasp of the basics (ie controlling temp or something).
I am confused by the situation I find myself in below because I need to control through the positioning of the magnet. My positioning system is worm gear motor which will have a oscillating force wave-shape, which is by design since I want cyclical loading. The problem is I think this makes control way more difficult. I already have an issue in that the relationship between force and position is not linear. I think that can be managed, What I am concerned about is programing the controller to deal with the fact that if the motor goes far enough the force will not go up but down.
Ideally I would like to moderate the speed so that I could produce any sort of force(time) profile I want, without the motor going forward and reverse at all. Just accelerate/de-accelerate in one direction as necessary to fit the input curve during each revolution.
I have this set up on the beaglebone black with a PRU running the loop control. I chose this because the PRU has 5ns instruction processing times so it should be very quick the react to changes. I have a load cell digitizer capable 460800 baud rate which will be my limiting factor in processing the signals.
My first order of business is dealing with the the motor turning in one direction will both raise and lower the force depending on position. How do I cope with that? and then how do I deal with the non-linear relationship between force and magnet position.
Any advice would be much appreciated.
UPDATE
So I realized that having a stepper motor would make my life a lot easier but I want to see this through to the end...
\$Force =f(\theta) \;\;\;\ empirical \;relation \$
\$\theta = \int \dot{\theta}dt \;\;\;\ \$
\$\dot{\theta} = f(Voltage) \;\;\;\ empirical \;relation \$
I plan to handle this by modeling these functions empirically. I feel to finish my system I need some means of converting angular speed to a angle position. Now I have an integration relation which would connect these two empirical black boxes.
In terms of knowledge of the state of the system I will always know the angle position, force and voltage at all times. I can only regulate the speed. I plan to achieve my Force(time) trace by speeding up and slowing down. I will also ensure I can achieve the max force before running.
How can I control this system with these empirical relations?