Hi,
As part of a project I'm currently doing I need to navigate two wheels on a differentially driven robot to be able to operate it with bluetooth. I have bought a PS3 controller to send signals to a bluetooth dongle which turn is connected to a USB Host Shield and everything is mounted on an arduino. Now, currently I have a program which is communicating with the PS3 controller and producing two PWM signals and two direction signals (one for each wheel). Driving the motors using PWM creates a large inrush current since the back emf initially is zero at the initial stages. This could blow the LMD18200 H-bridge that I'm using. So I, thought to using a filter whose transfer function is of this form:
Vo/Vin = 1/(s+a)
sVo + aVo = Vin
using the inverse laplace transform:
d(Vo)/dt + aVo = Vin
by Euler method:
(Vok - Vok-1)/T + aVok = Vink
where T is the time taken for Arduino to sample what the PS3 is sending.
Now, I already have the PWM signals operating at 20Khz through the use of interrupts.
My Questions are as follows:
- Is this the correct way to limit the current or is there any other way?
- Should the time T be smaller or larger than that of the PWM signal because I'm getting confused?
- Do I need to make all the existing code in a loop that operates under a specific time T using interrupts?
Thanks for your help!!