by i-Bot » Sat Jun 07, 2008 10:01 am
by i-Bot
Sat Jun 07, 2008 10:01 am
I did take a look at the PIC32 datasheet. Also at your specification above.
From your spec you say 30 servo outputs. You can use the Hitec and many other servos in output only mode, but most robotic servos need bidirectional control. This is either pulse or serial and is true of the Hitec and KHR in robot applications.
http://robosavvy.com/Builders/i-Bot/HSR ... 0Servo.pdf
The bidirectional requirement determines the need for pullups, but also is a major design factor for both the hardware and software.
When just outputting to a servo then use of timers and interrupts is OK if you are careful on design. If you use a serial protocol such as serial HMI, again the timing is tight, but predictable.
When you have to measure incoming pulses to microsec accuracy, it becomes more of a challenge. You need to check the pin at least every microsec, which is more difficult for interrupt. If you do it by software loop you have about 2 millisec of time where you must disable interrupts.
You should explore the pin change detect of the PIC for both the pullups and the input interrupt. The pins with these feature seem to conflict with other peripherals. Also you should check interrupt timing and latency to see if an interrupt is fast enough.
This is why I chose the Propeller and the FPGA. With the prop, I dedicate a cog to the servos, so can do sw timing without affecting other cogs. The fpga has 20 seperate bidirectional PWM controllers and two processors.
On my Atmega PWM software, I simply don't read the servos. I use the standard software and standard moves to create poses and motions. Then execute them within the new codein either standard or modified form. Serial HMI allows read though.
I did take a look at the PIC32 datasheet. Also at your specification above.
From your spec you say 30 servo outputs. You can use the Hitec and many other servos in output only mode, but most robotic servos need bidirectional control. This is either pulse or serial and is true of the Hitec and KHR in robot applications.
http://robosavvy.com/Builders/i-Bot/HSR ... 0Servo.pdf
The bidirectional requirement determines the need for pullups, but also is a major design factor for both the hardware and software.
When just outputting to a servo then use of timers and interrupts is OK if you are careful on design. If you use a serial protocol such as serial HMI, again the timing is tight, but predictable.
When you have to measure incoming pulses to microsec accuracy, it becomes more of a challenge. You need to check the pin at least every microsec, which is more difficult for interrupt. If you do it by software loop you have about 2 millisec of time where you must disable interrupts.
You should explore the pin change detect of the PIC for both the pullups and the input interrupt. The pins with these feature seem to conflict with other peripherals. Also you should check interrupt timing and latency to see if an interrupt is fast enough.
This is why I chose the Propeller and the FPGA. With the prop, I dedicate a cog to the servos, so can do sw timing without affecting other cogs. The fpga has 20 seperate bidirectional PWM controllers and two processors.
On my Atmega PWM software, I simply don't read the servos. I use the standard software and standard moves to create poses and motions. Then execute them within the new codein either standard or modified form. Serial HMI allows read though.