6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Sep 28, 2024 9:33 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Jul 29, 2015 6:07 pm 
Offline

Joined: Mon Sep 06, 2010 1:37 am
Posts: 8
Has anyone on this board tried using the 6522 Shift register to control a servo?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 29, 2015 7:42 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8520
Location: Southern California
I have not, but it's an interesting idea. I've used PA or PB bits to control model-aircraft servos. The pulse width they need is 0.5 to 2.5ms IIRC, to span their range. Duty cycle didn't matter. It was the width of the pulse that mattered, not the space between pulses.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 29, 2015 7:44 pm 
Offline
User avatar

Joined: Sat Dec 07, 2013 4:32 pm
Posts: 246
Location: The Kettle Moraine
Technically, yes: The speaker in a PET, assuming you mean servo motor, not a whole servo loop.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jul 29, 2015 11:12 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
What is it you have in mind, Gord -- a project of some kind?

I've used a VIA shift register to interface to a printer that used servos, but the shift register wasn't part of the servo loop. Not what you were contemplating, I suspect...

The VIA shift register can be used as an unusual and very simple, 9-level DAC. Garth explains this here (about 70% of the way down the page. Look for, "9-level D/A converter").

For normal digital I/O, the shift register is comparable to a parallel interface. AFAIK the only real difference is increased latency. The SR can be clocked at 50% of the Phase2 rate -- IOW 16 cycles per byte.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 30, 2015 12:01 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1383
The Signetics 543 Servo Amplifier was based on a 1.5ms pulse width for center position and with proper 5K feedback potentiometer had a 100 degree rotation from 1ms to 2ms. The data sheet also states the positioning pulse occurs at 16ms intervals, or about 60 times per second.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 30, 2015 2:41 am 
Offline

Joined: Mon Sep 06, 2010 1:37 am
Posts: 8
Thanks for the replies...

I was considering using the Shift Register to control the servo motors on a robotic arm. Not sure if this would work, but thought I would give it a try. Will I have enough control over the pulse width?


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 30, 2015 3:09 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8520
Location: Southern California
apatco wrote:
Thanks for the replies...

I was considering using the Shift Register to control the servo motors on a robotic arm. Not sure if this would work, but thought I would give it a try. Will I have enough control over the pulse width?

It's still not clear what kind of servos you're talking about. Are they the model-aircraft type, or something quite different? If it's the former, how much resolution do you want on the timing? It might be good to use the SR in one of the one-shot modes, and set the latch value every time you want to change the pulse width.

Using the VIA's synchronous-serial port as a 9-level D/A converter is adequate for an analog output for something like DTMF or like toy-quality voice, but may not be nearly good enough for what you're talking about, if indeed you even wanted an analog voltage to work with. OTOH, if you want to send bytes out the port, it's an easy way to get hundreds of bits of I/O while taking up only two or three pins of the VIA, as shown in the 6502 Primer's potpourri page, particularly at the section titled "Using the 6522's shift register for tons of output bits."

But if you want a given length of pulses on lots of output pins (for lots of servos) and can't afford to have the computer doing nothing else useful while its counting out a pulse time, it might work well to do each pulse as a task in a multitasking arrangement with no multitasking OS. Three ways to do this are described in the 6502-oriented article, "Simple methods for multitasking without a multitasking OS, for systems that lack the resources to implement a multitasking OS, or where hard realtime requirements would rule one out anyway." If you don't need pulses timed simultaneously, you might be able to have a single task take care of all of them, and it would know from its state variable which output bit (if any) it's supposed to be working on at the moment.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 31, 2015 2:01 am 
Offline

Joined: Sun Oct 14, 2012 7:30 pm
Posts: 107
The official servo servo pulse specification (derived from the PPM signal) is 750us to 2250us. However, most hobby servos only handle 850us to 2150us. The frame rate is typically 22ms, but can be as low as 10ms for analog servos, and special servos (typically digital) handle as low as 3ms frames. You generally can not have frames longer than about 35ms or the servo stops updating the position.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: