| Electronics > Projects, Designs, and Technical Stuff |
| Motion control, S-curves and other stuff >> controlling lift with DC motor |
| << < (8/14) > >> |
| IconicPCB:
With PID a control loop is implemented such that an error value is processed by the PID algorithm and the output of the algorithm then controls the process. Feed forward is a very simple scaling of set point not error value followed by summation with PID algorithm output. The scaling is selected by observation of process response with PID set to minimum value. Set feed forward level to achieve best possible open loop performance and then close the loop via PID. Adjust FF then P, D and then I, if needed, in that order. |
| krisRaba:
Ok, thank you very much. I was close in my presumptions, I think, but you have made that even clearer :-) |
| krisRaba:
Ok, when I started thinking about implementation of S-curves linked earlier I have calculated shape of velocity and acceleration and... yeah, right.. it will be nice and smooth move from point A to point B but there is no constant velocity region which is most important for me :( So I need different equation for calculating that. I am not good in profiles generation and I am not sure how to do it exactly. The best solution would be the 7-region approach with linear ramps on acceleration. There are also cubic ramps but it will be too complicated, I think. It would be nice to specify max acceleration, max speed, start and landing points, total time of transition and maybe read/calculate from which time point velocity is linear and when it is not linear again at braking... I have found this article https://www.researchgate.net/publication/278969938_A_complete_S-shape_feed_rate_scheduling_approach_for_NURBS_interpolator and there is a section about S-shape profile generation. There are even equations for each region so it could be quite easily adapted, I think, but I will have to think how it should be implemented, for example by providing desired speed in constant region or total time? There should also be some verification point to decide if desired profile can be achieved on physical object etc. Any ideas? ;) |
| krisRaba:
I have made a "proof of concept" with linear ramps on current changes and it shows that physics works ;) :-/O With linear current (= acceleration) there are S-shapes visible on velocity plots. But I have some problems with current sensing, I think, or maybe it always is like that and only my lack of experience screams that current plot should be "cleaner". At the moment there is a lot of noise but it can be caused by long (but twisted ;) ) wires between ACS current sensor and MCU. Maybe it catches everything from air like antenna ;) Maybe someone can confirm my setup: 1. bipolar ACS current sensor is in serie with motor windings 2. it has selectable bandwidth - 20kHz or 80kHz - I use 20kHz 3. long twisted wires from ACS to MCU - to be fixed in next PCB release 4. optional RC filter near MCU - currently bypassed because it introduces additional delay in feedback loop but maybe just ADC trigger should be delayed accordingly - simple 100R/100nF increases feedback delay from 2.4us to 8us, just to operate on real numbers 5. ADC is triggered synchronously with generated PWM - in the middle of "ON" state delayed by 2.4us to compensate propagation delay on feedback signal (mainly caused by ACS) - sampling rate is thus 21kHz so I should increase it above 40kHz (Nyquist) for example by adding sampling also in the middle of "OFF" state or limit the bandwidth below 10.5kHz... What would be best here? On the DSO I can see the output from ACS and it is a rounded and skewed triangle plot. On my ADC readings it of course looks different because I try to sample once per period and I treat that measured value as an average. But real current fluctuates a little bit up and down between cycles so it is a thick line on DSO screen and of course my sampled "average" also changes between cycles so it is a "noisy" signal on data plot. From that point there is a small step to problems in current control loop. If I set parameters of current PI regulator to react slowly it rejects that noise but general response is veeery slow. If I set it to be more "nervous" and instantly follow PV changes motor starts to be audible and feedback noise excitates everything... What steps should I make to improve that closed current control loop? |
| capt bullshot:
--- Quote from: krisRaba on October 23, 2019, 07:29:17 am ---What steps should I make to improve that closed current control loop? --- End quote --- Interestingly, this is a common issue with motor phase current measurement in 3ph Servos too. More interstingly, the large servos can cope quite well with this noise and still act dynamically, I believe it's also a matter of physics because large motors have large inertia. It's all a matter of physics and control loop parameters. Typically, any servo drive must optimize it's parameters to the system. Anyway, from a HW point of view: - look for common mode noise coupled from the high du/dt motor voltage into the small signal current measurement. Twisted pair is a good approach in the first place. Sometimes you get noise injected into the sensors output within the sensor itself, you cannot do too much about it but taking care of a good (solid / massive) grounding the sensor to a quiet low impedance ground or choose a better CMRR sensor. - look for non-current sensor related issues in the signal path - often one can see badly designed ADC input circuitry and decoupling with MCU integrated ADCs - good layout and clean supplies, proper low impedance decoupling GND plane etc. are as important for a clean signal as the design of the sensor itself. |
| Navigation |
| Message Index |
| Next page |
| Previous page |