Go Down

Topic: Interfacing Arduino duemilanove, Matlab, and multiple servos (Read 2004 times) previous topic - next topic

quantuMechanic

Greetings,

I am using the Matlab to solve a differential equation.  The solution to the differential equation is used to control the motor position of 5 servos that are controlled by an Arduino duemilanove.  The workflow is as follows: Matlab -> Arduino (ATMega328) -> Servos.  I'm using the adiosrv Arduino file so that Matlab and the Arduino can communicate.  So here's my problem: The Arduino duemilanove has 6 PWM output pins (3,5,6,9,10,11).  Pins 3,9,10,11 work fine and the servos move, however pins 5 and 6 do not respond to the motor commands.  On the Arduino website they say the following about pins 5 and 6: "The PWM outputs generated on pins 5 and 6 will have higher-than-expected duty cycles. This is because of interactions with the millis() and delay() functions, which share the same internal timer used to generate those PWM outputs. This will be noticed mostly on low duty-cycle settings (e.g 0 - 10) and may result in a value of 0 not fully turning off the output on pins 5 and 6."   Does anyone know a way to get pins 5 and 6 to work like the other PWM pins?

Thanks

Go Up