| Electronics > Projects, Designs, and Technical Stuff |
| Motion control, S-curves and other stuff >> controlling lift with DC motor |
| << < (4/14) > >> |
| krisRaba:
--- Quote from: krisRaba on October 01, 2019, 09:05:20 am ---The problem is with its output data acquisition. My MCU is 3.3V and sensor is 5V. Version for unipolar current is easy to adapt because you have small bias voltage, like 0.5V and it increases with current increase (with defined sensitivity) so when you use sensor with higher current range you can measure it directly and only limit the maximum voltage. With bipolar sensor it will be a little bit more complicated because Vbias=Vcc/2 so you have to scale bias and full range... but I will handle it somehow, I think ;) --- End quote --- Ok, it is not true anymore. I have found new serie of these sensors that is 3.3V compatible :) 8) |
| IconicPCB:
Trajectory planner is the name of the game. In absence implement a PID controller with Feed forward path. Divide the path You wish to traverse into a series od shorter segments. Treat the overall path as sum of small steps along the path. This way You can control the profile of the movement by implementing incremental changes in ( PID and Feedforward) positional SET POINT. |
| Siwastaja:
1) Add proper bipolar current sensing. Regenerative braking is still torque ~ current! No need to handle it differently. 2) Sync current sensing to the PWM so you get right average (over the PWM cycle) current reading 3) Tight and fast control loop for current. Typically a PI loop works. Measure the current with scope verifying your loop is stable. Only after this, start adding on the top. |
| krisRaba:
Ok, I have ordered bipolar ACS that outputs 3.3V range signal :-+ so I will be able to use it directly. My thoughts about current were taken from current configuration which works a little bit weird because there is no headroom in the Vbias to handle reverse currents. Maybe with proper sensor placement it will be obvious ;-) |
| capt bullshot:
--- Quote ---I have noticed that many exaples use that kind of "phase-correct PWM" and didn't know why. Your explanation about current measurement points put some light and understanding and it corresponds to earlier suggestion that current should be measured twice per PWM period. But one error that pops up in my head is the current limiting by OCref CLEAR. For Brushed DC it's not so big problem that you will cut the cycle if current exceeds provided limit (comparator with blanking period) but in 3-phase BLDC and sinusoidal driving... but OK, it's not that case now ;) Maybe for BLDC I should use other methods of current control. So you mean that I should sample current on TOP and BOTTOM, and make an average Ia=(It+Ib)/2? --- End quote --- For 3-phase servos HW overcurrent detection is used for real overload and short circuit detection. Usually such kind of event shuts down the power stage, and some kind of manual restart is required. The current loop keeps the motor current within the operation range normally, there's no cycle-by-cycle current limiting as seen in current mode switchers. I'd expect an DC motor driven by an H-Bridge to operate in a similar way. Sampling at TOP and BOTTOM provides the average current for each (if done correctly), no need to average them. Usually it's used to virtually double the carrier frequency, since the control loop is executed once at TOP and once at BOTTOM and updates the PWM each time. This is useful for higher voltage / power application where you typically use switching (PWM) frequencies from 2kHz to 16kHz. If your PWM frequency is higher, you should be fine with one update per complete period or less. STM32 doesn't have internal routing from the QEI decoder to other timers afair, I'd propose to route the encoder signals to additional timer inputs running in edge capture mode. |
| Navigation |
| Message Index |
| Next page |
| Previous page |