I have a servo motor which is to be driven by pduino / Arduino. The following firmware directly uploaded to the arduino (near bottom of page): http://itp.nyu.edu/physcomp/Labs/Servo runs well. With some modifications the motor moves between 2 positions smoothly enough. However, trying the same from pd using the pduino (fermata) firmware and the arduino help pd patch, it's quite a different story. The pulse-train needed for the PWM control of the servo motor seems too irregular (due to pd/comport timing?) such that the motor is not positioned cleanly but jumps around. (at least, that's my interpretation) I tried both sending PWM from ports 9,10 or 11 (the Amtel-built-in pwm) and generating some software pwm on other digital out ports. Is there a way to get rid of this jitter? ( last attempts were running pd 0.39.2 on ubuntu, comport from: http://wikihost/wikis/techartsound/var/gebo/data/file/comport.pd_linux )
thanks, Tim
tim wrote:
I have a servo motor which is to be driven by pduino / Arduino. The following firmware directly uploaded to the arduino (near bottom of page): http://itp.nyu.edu/physcomp/Labs/Servo runs well.
There you have a timing loop running on the arduino.
With some modifications the motor moves between 2 positions smoothly enough. However, trying the same from pd using the pduino (fermata) firmware and the arduino help pd patch, it's quite a different story. The pulse-train needed for the PWM control of the servo motor seems too irregular (due to pd/comport timing?) such that the motor is not positioned cleanly but jumps around. (at least, that's my interpretation)
In that case you send on/off messages from pd to the arduino telling it to switch pins on and off.
I tried both sending PWM from ports 9,10 or 11 (the Amtel-built-in pwm) and generating some software pwm on other digital out ports.
I don't think the arduino implements hardware pwm yet, so it doesn't matter which pin you use.
Is there a way to get rid of this jitter?
The way is to implement pwm on the arduino itself. There are two ways to do this: software and hardware. The Servo firmware uses software to set/reset the pins in a timing loop. But it isn't doing anything else. The pduino has to do analog conversions and send data as well, so unless interrupts are used it would be jittery too at a finer level. The Atmel microcontroller itself has 3 pwm pins that can run independently of the software once they are set up, but I don't think anyone has implemented that yet. If you look at the firmata code it does nothing when either mode of pwm is requested. I have translated the firmata code to PIC16F767 and intend to implement software pwm for servos soon. I don't know when it's going to happen with firmata for the actual arduino. There is no way to get around the jitter in the comport because it has to operate in between the audio block processing time slots in pd. I think there need to be pduino commands to move stepper motors too, because there are jitter issues there as well. Martin
are there any other ways / interfaces to control a servo motor from pd ? similar to for example: http://www.makingthings.com/products/documentation/max_externals/t_servo.htm
tim
tim wrote:
I have a servo motor which is to be driven by pduino / Arduino. The following firmware directly uploaded to the arduino (near bottom of page): http://itp.nyu.edu/physcomp/Labs/Servo runs well.
There you have a timing loop running on the arduino.
With some modifications the motor moves between 2 positions smoothly enough. However, trying the same from pd using the pduino (fermata) firmware and the arduino help pd patch, it's quite a different story. The pulse-train needed for the PWM control of the servo motor seems too irregular (due to pd/comport timing?) such that the motor is not positioned cleanly but jumps around. (at least, that's my interpretation)
In that case you send on/off messages from pd to the arduino telling it to switch pins on and off.
I tried both sending PWM from ports 9,10 or 11 (the Amtel-built-in pwm) and generating some software pwm on other digital out ports.
I don't think the arduino implements hardware pwm yet, so it doesn't matter which pin you use.
Is there a way to get rid of this jitter?
The way is to implement pwm on the arduino itself. There are two ways to do this: software and hardware. The Servo firmware uses software to set/reset the pins in a timing loop. But it isn't doing anything else. The pduino has to do analog conversions and send data as well, so unless interrupts are used it would be jittery too at a finer level. The Atmel microcontroller itself has 3 pwm pins that can run independently of the software once they are set up, but I don't think anyone has implemented that yet. If you look at the firmata code it does nothing when either mode of pwm is requested. I have translated the firmata code to PIC16F767 and intend to implement software pwm for servos soon. I don't know when it's going to happen with firmata for the actual arduino. There is no way to get around the jitter in the comport because it has to operate in between the audio block processing time slots in pd. I think there need to be pduino commands to move stepper motors too, because there are jitter issues there as well. Martin
info@timvets.net wrote:
are there any other ways / interfaces to control a servo motor from pd ? similar to for example: http://www.makingthings.com/products/documentation/max_externals/t_servo.htm
You could uses a dedicated servo controller like: http://www.lynxmotion.com/Product.aspx?productID=54 via the serial port or http://www.parallax.com/detail.asp?product_id=28823 with usb.
Martin
I can see that if you tried software PWM through pins 9-11 it wouldn't be any different than using any of the other digital pins. But I thought that pins 9-11 did hardware PWM through the analogWrite() function in the regular Arduino C. Am I wrong on this?
Do you mean that hardware PWM on those pins hasn't yet been implemented with Firmata?
D
On 20/10/06, Martin Peach martin.peach@sympatico.ca wrote:
I tried both sending PWM from ports 9,10 or 11 (the Amtel-built-in pwm) and generating some software pwm on other digital out ports.
I don't think the arduino implements hardware pwm yet, so it doesn't matter which pin you use.
On Oct 19, 2006, at 8:52 PM, tim wrote:
I have a servo motor which is to be driven by pduino / Arduino. The following firmware directly uploaded to the arduino (near
bottom of page): http://itp.nyu.edu/physcomp/Labs/Servo runs well. With some modifications the motor moves between 2 positions
smoothly enough. However, trying the same from pd using the pduino (fermata)
firmware and the arduino help pd patch, it's quite a different story. The pulse-train needed for the PWM control of the servo motor seems
too irregular (due to pd/comport timing?) such that the motor is
not positioned cleanly but jumps around. (at least, that's my
interpretation) I tried both sending PWM from ports 9,10 or 11 (the Amtel-built-in
pwm) and generating some software pwm on other digital out ports. Is there a way to get rid of this jitter? ( last attempts were running pd 0.39.2 on ubuntu, comport from:
http://wikihost/wikis/techartsound/var/gebo/data/file/ comport.pd_linux )
Serial ports are not fast enough and have too much jitter for the
servo pulses to be generated by Pd and transmitted over the serial
port to the Arduino. The Atmel needs to handle the pulse generation
for it to work well.
.hc
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli