6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Jun 01, 2024 2:00 pm

All times are UTC




Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 3:34 am 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 707
Location: Texas
Restarting this topic for a slightly different yet related question.

Let's just say I have been thinking of building a simple robot. Two+ 360 servo motors controlling some wheels, maybe a few other servos for a cool arm on the top, controlled by some hand-held (corded) controller. Nothing complicated, only for show-and-tell purposes. Think of a dog on a leash.

How could I get this done? My first thoughts are to use a 6502 + RAM + ROM + 6522 VIA, exactly Garth's "potpourri" computer. I could use the VIA to control the servo motors and some buttons for a controller. But this robot won't require 32KB of RAM nor 32KB of ROM. That would be way too much! I can't imagine needing more than 4KB of ROM, and enough RAM for zero page and stack. So, using a full 28C256 and 62256 seem like over-kill for this type of project.

I've been looking into the W65C314 a bit, but it doesn't seem to be exactly what I'm thinking. If I wanting to run my own code on that (without connecting to a PC before boot), I would need to still supply some type of (hefty sized) ROM, correct? Is there no way around this? I don't mind connecting it to a PC to *modify* my code, i.e. JTAG stuff, but I want it to run on it's own battery around the house.

I guess I'm trying to find a very simple solution, as few components as possible. Garth's uses 5 chips, which is pretty good, but is there something out there that can combine a lot of this stuff into a single chip or maybe two chips?

Thoughts?

Thanks!

Chad


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 3:38 am 
Offline

Joined: Thu Mar 12, 2020 10:04 pm
Posts: 693
Location: North Tejas
One word: Arduino.


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 4:41 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8196
Location: Midwestern USA
Three words: no electronics needed.

If your robot is a dog on a leash, then it is not autonomous and has no need for integral logic. Some push buttons and relays are all that are needed to control the servos. The bloke at the other end of the leash is the logic. This project will be mostly mechanical in nature, not electronic.

As always, KISS.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 5:20 am 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1079
Location: Albuquerque NM USA
If you can wired up a battery-backed circuit for CMOS RAM and program it on TL866II programmer then plug it into 6502+VIA, you may not need a ROM. It'll be very low power as well. You'll find TL866II can program many brands of non-volatile memory.
Bill
Edit, you only need a few seconds to move RAM from the programmer to the target computer, so 100uF capacitor maybe enough, but you do need battery-back circuit on the target computer


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 8:35 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10811
Location: England
Nice project idea Chad. By choosing a corded controller, you've removed the potential distraction of high level control software. By choosing battery power, you've set a constraint on the electronics.

But I see two desires which seem to be in conflict:
- you say some amount of RAM and ROM is too much
- you say some number of chips is too many

For me, if there's a suitable microcontroller out there - 6502 or other - which is sufficient for the task, then that's a good way to reduce chip count. If it happens to be overly powerful or have much more ROM or RAM than you need, that's no problem at all. (I'll assume you care about cost as well as power budget, so that will drive your choices.)

Of course, I fully understand a desire to build something based on the 6502 architecture, whether it turns out to look like a single board computer or whether it looks like a microcontroller.


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 11:07 am 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 707
Location: Texas
Good replies!

BillG wrote:
One word: Arduino.


Sure, I have a Raspberry Pi that could definitely do it. I'm just thinking of doing it with "less".

BigDumbDinosaur wrote:
Three words: no electronics needed.


Haha, that's why I ask questions here! You are exactly right! I actually feel stupid not thinking about that. Overall though, my intention was to do this as a project to learn how to control servo motors and all that, code or no code. This is definitely helpful, thank you BDD.

plasmo wrote:
If you can wired up a battery-backed circuit for CMOS RAM and program it on TL866II programmer then plug it into 6502+VIA, you may not need a ROM. It'll be very low power as well. You'll find TL866II can program many brands of non-volatile memory.


That would cut down one big chip. Never thought of that, kind of funny to do it that way :)

BigEd wrote:
For me, if there's a suitable microcontroller out there - 6502 or other - which is sufficient for the task, then that's a good way to reduce chip count.


Yes, that's why I was looking at the 65C134 or some other type of equivalent. I'm sure the PIC16 and other things like it would definitely be good enough, but what is out there in 6502 land that's similar enough that I won't need to relearn EVERYTHING for a single project. Like, I was wanting to branch out a bit, and though I'm not a robot fan myself, other folks think they are cool and it's something I could display at the next Math Appreciation Day or something. Always thinking ahead.

Excellent thoughts here, thank you all so much!

Chad


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 12:44 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1429
Location: Scotland
Lets go back to ... 1979.

Big Trak was a fabulous toy "robot" back then.

https://en.wikipedia.org/wiki/Big_Trak

So re-create it today (Which has been done in 2010).

Programming is trivial - move forward or backward in length units, turn in clock minutes (big issue here though as children can't tell the time with an analogue clock) and fire a "laser". Makes sound too.

And in 1979 the "microcontroller" was the TMS1000. Same device as used in the Speak and Spell and Simon Games. It's a 4-bit CPU, made in 1974 with 64 x 4-bit words of RAM and 1024 x 8-bit mask programmable ROM.

So today - the 6502 with no on-board ROM/RAM, needing at least 4 external ICs to work would seem almost vastly inferior! The 65c134 fares better though - still needs a crystal/can osc. + reset widgetry, Flash, etc. ATmega 328p (original Arduino MCU) needs nothing. Will run at 8Mhz with internal oscillator with 2KB of RAM, 32KB of Flash and gobs of IO. You can even repurpose the reset pin as an IO pin if needed.

Mechanics: Original Big Trak had a brilliant system whereby both drive wheels were magnetically coupled. This mean it went in a straight line. You ran both motors in opposite direction and that was enough to break the coupling so it could turn/spin on the spot. A simple wheel turn sensor was all that was needed to gauge distance and turning.

Today there are 100s of kits with robot crawler bases - mostly based on the BBC Micro:Bit or Raspberry Pi/RP2040. Many older ones still based on Arduino. I've built many (and computer automation was my career for a long time) Making a robot go in a straight line is actually a challenge - naively you put a sensor on each wheel and write some clever code, but that often ends up crabbing at an angle off true. Big Traks solution of magnetic coupling worked well. I built a lego based robot a while back which used a couple of differential gears (look up adder/subtracter drive)

Here's a couple of pictures:

Attachment:
pitrak4.jpg
pitrak4.jpg [ 159.46 KiB | Viewed 7503 times ]

Attachment:
pitrack-b.jpg
pitrack-b.jpg [ 219.84 KiB | Viewed 7503 times ]


The 2nd one is the underside showing the adder/subtracter dual differential drive - makes it do in a dead straight line. (Although Lego gears do suffer from a bit of backlash)

So that's based on a Raspberry Pi, but from a compute power point of view it could be anything. It's tethered, but doesn't have to be (Wi-Fi and all that!) You can read more about that project here if you like: https://projects.drogon.net/adafruit-pr ... bperry-pi/

(No prizes for guessing what the switches were recycled from)

Prior to putting a Pi on-top I made the entire thing out of Lego using the original Mindstorms Brick - Using just 3 buttons I could program it to go forward in length units, or turn. It was for a neighbours kid to play with to see if he might be interested in computers/robotics - didn't work and he want down the 'arts' route. Ah well.

The hardest part with things like this is the mechanics. Get the mechanics right and the rest is easy. There are countless lasercut acrylic bases with motors and wheels and sensors out there now. the Pi and Micro:Bit has really kicked this off.

Enjoy playing with robots - wish I had more time right now, but who knows...

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 2:44 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8196
Location: Midwestern USA
sburrow wrote:
Good replies!
BigDumbDinosaur wrote:
Three words: no electronics needed.

Too often, someone faced with a problem seems to think the solution always lies in chips. You’d be amazed how much logic can be implemented with inexpensive small-signal relays, a few (preferably Schottky) diodes, one or two power relays to control the load(s)—and some imagination. Most hobby robotic logic is not complicated and in the case of what you are planning, can be off-loaded on the human operator.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 4:50 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 453
Hi Chad,

I think you want a 6508. Give your robot a cartridge port and put its brain in a flash ROM or some other fast non-volatile memory.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Thu Feb 16, 2023 8:37 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8447
Location: Southern California
Quote:
That would cut down one big chip. Never thought of that, kind of funny to do it that way :)
and
Quote:
But this robot won't require 32KB of RAM nor 32KB of ROM. That would be way too much! I can't imagine needing more than 4KB of ROM, and enough RAM for zero page and stack. So, using a full 28C256 and 62256 seem like over-kill for this type of project.

Is size really a factor?  And won't the cost of the controlling electronics be dwarfed by the cost of the mechanical parts?  At Jameco, a 32KB EEPROM costs almost no more than an 8KB, and a 32KB SRAM is actually cheaper than a 2KB one.  (I'm just glancing down the first page of offerings).

Quote:
I'm sure the PIC16 and other things like it would definitely be good enough,

True; but I don't think people learn nearly as much about the insides of small computers when it's handed to them all in one IC.  So then you'd need to weigh the importance of cost and size versus learning. I, as one who's brought a dozen products to market with PIC16's, view them as an inexpensive, compact way to do tiny jobs; but the 65xx route would be easier to program and would sure leave a lot more room for future growth as the student advances and his ambitions blossom. The PIC16's limitations would be pretty frustrating to this student who wants to go further, faster.

Wireless communication probably does not need anything as complicated as bluetooth.  Years ago I bought a tiny 432MHz transmitter/receiver module pair which just transferred on/off communication which you could use for something like a UART.  I never did anything with them, and I can't find them at the moment; but it would be a simple way to communicate wirelessly, not just for control, but also for uploading new code into the robot's memory.  Since it didn't have the encryption or security features or pairing requirements of something like bluetooth, it's like a simple wire, without the wire.

Quote:
Too often, someone faced with a problem seems to think the solution always lies in chips. You’d be amazed how much logic can be implemented with inexpensive small-signal relays, a few (preferably Schottky) diodes, one or two power relays to control the load(s)—and some imagination. Most hobby robotic logic is not complicated and in the case of what you are planning, can be off-loaded on the human operator.

True.  When I worked at TEAC in 1982-83, much of the older tape recorders' control logic (considered old even in 1982) was done by relays.  They're far more expensive than the electronics are now, but may be easier to understand.

_________________
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  
 Post subject: Re: Robots?
PostPosted: Sun Mar 26, 2023 5:23 am 
Offline

Joined: Sun Oct 11, 2020 12:31 am
Posts: 4
And...to restart the subject again:

I am in my first year of teaching robotics to grade schoolers, 4th-8th. I was asked to do this because the school found a large amount of grant money that it wanted to spend, and the school I do IT work for has never had any kind of technology program before.

My attitude toward robotics has always been simple: It is NOT radio control (any more than model rocketry would be), because ALL of your work goes into the project BEFORE you test it. Once you hit the button, you hope for the best. I've made this philosophy central to what I am trying to teach:

1) basic electrical principles
2) basic mechanical principles
3) coding skills
4) 'assembly' (hands on) skills

We DO have some pre-built robots and some very easy-to-assemble kits, but those are mostly for the lower grades (for 'experience', sigh) and to give my students an idea of what is possible.

But...we also have 3D printers, TinkerCAD, a giant pile of K'NEX building toys, an entire electronics bench stock, 40+ Arduino and ESP32-C3 development boards, and a big pile of surplus hobby motors, servos, and sensors. We are in the process of learning, together, how to build and program vehicles with various types of drive-trains (3D printed gears!), steering mechanisms, and sensors.

So far so good....

As for the 6502.....if you are building a robot SYSTEM (not just some kit) from scratch, the '02 is an excellent platform simply because you can hang an almost infinite # and variety of I/O devices off it....and since (as this site amply demonstrates) it is so thoroughly documented there is a huge amount of prior art, both hardware and software, to learn from. IN short, the perfect way to move from 'kit robotics' to actual electrical/mechanical engineering and computer systems design.

So....robotics is a perfect introduction to professional technology skills, from my point of view.

Heh.


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Sun Mar 26, 2023 11:53 am 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1079
Location: Albuquerque NM USA
If you have a blog/homepage of your experience, I love to read it. What you've described seem impossibly difficult for 4-8th graders where learning is done through hands on experience, step by step. It is quite challenging even for college students.
Bill


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Tue Mar 28, 2023 2:00 am 
Offline

Joined: Sun Oct 11, 2020 12:31 am
Posts: 4
plasmo wrote:
If you have a blog/homepage of your experience, I love to read it. What you've described seem impossibly difficult for 4-8th graders where learning is done through hands on experience, step by step. It is quite challenging even for college students.
Bill


The 3rd-8th graders will declare their projects this week, and already have some of them going....

This is a 'program building year', so my expectations are fairly low. As you say, 4th-8th is a tricky age....but I work for a BIE (Bureau of Indian Education) K-8 school at Taos Pueblo with about 100 students; the general atmosphere is a little bit more sedate and serious than a public school.

This year we have a 'Project Fair', which includes non-technology projects. This is a non-competitive event. Most of the kids in my classes (about 30 students) will build some kind of vehicle with a motor and an Arduino and write some rudimentary program that allows it to 'drive itself' or accomplish some kind of simple behavior.

Focus this year is on becoming familiar with the basic mechanical principles and some very basic coding skills; nothing overly ambitious. The electronics workbench allows me to support these projects without a lot of 'black-box' gadgets; we spend a lot of time in class going over why a robot motor NEEDS a motor controller, how they basically work, and how to wire things together.

The long term goal is to create some multi-year continuity, with skills and interest building over multiple years. The 3rd and 4th graders that are enthusiastic may actually have 'pay-it-forward' skills by the time they are in 8th grade and the program will be self-perpetuating (with supervision of course).

The project fair happens on May 10th; I will post pictures and some descriptions of the details of some projects as we go....


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Tue Mar 28, 2023 3:59 am 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1079
Location: Albuquerque NM USA
I'm interested in your progress. Taos Pueblo is doing well for the last 20-30 years so the school should be well funded so that's one less hurdle to deal with. With the school on Taos Pueblo you also have the advantage of same students returning year after year so you can do long-term planning. Yes, this is very interesting class room setting.

Welcome to New Mexico, I came to NM in 1978 and never left.
Bill


Top
 Profile  
Reply with quote  
 Post subject: Re: Robots?
PostPosted: Wed Mar 29, 2023 1:41 am 
Offline

Joined: Sun Oct 11, 2020 12:31 am
Posts: 4
NM: I love it. I've been here two years and I don't want to leave either.

The school is doing well, technology-wise, as of this year. The BIA had a momentary lapse and funded a bunch of upgrades; I hope they don't lose interest again before we're done. Fingers crossed, ehehhe.

And the students, well...all kids are great. Just a matter of finding it sometimes, but the greatness is there.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 9 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: