Can the PWM signal be affected by computational load?
Posted: 07 Jun 2012, 23:12
Hi there,
I'm using Simulink/Matlab and nxtOSEK to design an adaptive control algorithm for the NXT. For those who aren't aware, nxtOSEK uses some rather old leJOS drivers to interface with the sensors and motors. Now, I've been wondering for some time why my vehicle cannot maintain a smooth run but instead stops and starts. The simulations on the PC don't indicate that the signals to the motors are pulsed. During the moments when the vehicle has come to a temporary rest, a high-pitched whine is quite audible. I've read before that it's due to the PWM signal. Pushing the vehicle doesn't help. On a hunch, I picked up the vehicle and tried to turn the wheels manually. I was surprised how easily I could rotate them. It's obvious that the motors are receiving a current that isn't quite enough to overcome the frictional torque.
During previous calibration runs, I noted that the vehicle will barely manage a crawl with a PWM duty cycle set to 15%. I've gone back to my program and decoupled the control algorithm from the motors and assigned a series of constant signals (i.e. duty cycle settings) to the motors. While the control algorithm no longer has any effect on the motors, it's still running and placing a computational load on the ARM7 processor. With the duty cycle set at 50% in this set-up, the motors won't spin even when the vehicle is held in the air and presents no load. The vehicle will manage a crawl when the duty cycle is raised to 60%. No wonder it has been stalling so often; it stops any time the PWM signal falls below 60%.
It seems that computational load has a significant effect on the PWM signal. Yet strangely, setting the PWM duty cycle to 100% will result in the same vehicle speed with or without additional computations running in the background. Could someone please explain this phenomenon? Thanks.
Cheers
Hippie
I'm using Simulink/Matlab and nxtOSEK to design an adaptive control algorithm for the NXT. For those who aren't aware, nxtOSEK uses some rather old leJOS drivers to interface with the sensors and motors. Now, I've been wondering for some time why my vehicle cannot maintain a smooth run but instead stops and starts. The simulations on the PC don't indicate that the signals to the motors are pulsed. During the moments when the vehicle has come to a temporary rest, a high-pitched whine is quite audible. I've read before that it's due to the PWM signal. Pushing the vehicle doesn't help. On a hunch, I picked up the vehicle and tried to turn the wheels manually. I was surprised how easily I could rotate them. It's obvious that the motors are receiving a current that isn't quite enough to overcome the frictional torque.
During previous calibration runs, I noted that the vehicle will barely manage a crawl with a PWM duty cycle set to 15%. I've gone back to my program and decoupled the control algorithm from the motors and assigned a series of constant signals (i.e. duty cycle settings) to the motors. While the control algorithm no longer has any effect on the motors, it's still running and placing a computational load on the ARM7 processor. With the duty cycle set at 50% in this set-up, the motors won't spin even when the vehicle is held in the air and presents no load. The vehicle will manage a crawl when the duty cycle is raised to 60%. No wonder it has been stalling so often; it stops any time the PWM signal falls below 60%.
It seems that computational load has a significant effect on the PWM signal. Yet strangely, setting the PWM duty cycle to 100% will result in the same vehicle speed with or without additional computations running in the background. Could someone please explain this phenomenon? Thanks.
Cheers
Hippie