Jump to content
mytek

Anyone use their Atari 8 to drive stepper motors?

Recommended Posts

I have a project coming up where I'll be using my Atari to drive one, and maybe two stepper motors. To make this a bit easier I'll be using a specific chip designed for this purpose: A4988 Stepper Motor Driver from a company called Pololu Robotics & Electronics. The chip is not made by them, but the carrier that it is soldered to is. They are fairly cheap at $5.95 each, and capable of driving a Bi-Polar Stepper Motor up to 2 Amps continuous current per coil with as much as 35 VDC. And as can be seen below, the interface only requires two I/O lines, so it'll work quite nicely from a single joystick port (could easily control two motors from one port).

 

 

0J3360.600.png?d94ef1356fab28463db67ff06

 

 

I intend to use this to drive a Stepper Controlled Refrigeration Expansion Valve (see video demonstration below)

 

https://www.youtube.com/watch?v=anuIUy09QDM

 

 

My reason for using the Atari initially, is so that I can easily change parameters of operation via a Basic program. Of course eventually the Atari will be replaced by a microcontroller chip, but in the meantime it gives me a simple solution to exercising the valve and getting a feel for how it works.

 

Has anyone else ever used their Atari for stepper motor control?

 

- Michael

 

 

  • Like 1

Share this post


Link to post
Share on other sites

I did a servo motor driver once, but that isn't quite the same thing.

 

The 1050 has a stepper motor driver. You could take a look at that.

 

Bob

Share this post


Link to post
Share on other sites

I guess you always need 2 lines to do it. I wonder if you could cheaply rig something up to do it via the serial port - only the 1 serial line which works mostly autonomously and you're stuck with start/stop bits but maybe there's some way to make use of that.

Share this post


Link to post
Share on other sites

Hi Guys,

 

I was mostly just curious if anyone else had ever used their Atari for something like this. Since I'm using a fairly sophisticated driver chip, the code will be very simple. Essentially bring the direction line high or low, and then toggle the step input. Doesn't get much easier than that. This chip is fairly autonomous, so the code can be done in Basic, no IRQ routine or precise timing required. However if I had used a simple H-Bridge driver circuit, then the Atari would need to do some very specific bit juggling.

 

So Bob what did you use the servos for? Care to elaborate?

 

Rybags interesting idea, might be feasible with the stock SIO interface and no support hardware other than the A4988 chip. However since I will probably be expanding this idea to two or perhaps even three expansion valves, I'll likely stick to using the joystick ports. With a simple mux decode chip, I could have up to 4 steppers controlled by a single joystick port (thus leaving at least one available for a real joystick if needed).

 

Thanks for feedback.

 

- Michael

Share this post


Link to post
Share on other sites

As I recall, Nir Dary was fooling around with servos for animatronics things in movies. I just made one up for fun. The small servos can be driven directly from the joystick ports - no circuits needed.

 

Bob

 

 

 

Hi Guys,

 

I was mostly just curious if anyone else had ever used their Atari for something like this. Since I'm using a fairly sophisticated driver chip, the code will be very simple. Essentially bring the direction line high or low, and then toggle the step input. Doesn't get much easier than that. This chip is fairly autonomous, so the code can be done in Basic, no IRQ routine or precise timing required. However if I had used a simple H-Bridge driver circuit, then the Atari would need to do some very specific bit juggling.

 

So Bob what did you use the servos for? Care to elaborate?

 

Rybags interesting idea, might be feasible with the stock SIO interface and no support hardware other than the A4988 chip. However since I will probably be expanding this idea to two or perhaps even three expansion valves, I'll likely stick to using the joystick ports. With a simple mux decode chip, I could have up to 4 steppers controlled by a single joystick port (thus leaving at least one available for a real joystick if needed).

 

Thanks for feedback.

 

- Michael

  • Like 1

Share this post


Link to post
Share on other sites

As I recall, Nir Dary was fooling around with servos for animatronics things in movies. I just made one up for fun. The small servos can be driven directly from the joystick ports - no circuits needed.

 

Bob

 

That sounds cool! I wonder how far Nir got with that project? I'll have to do some Googling and see what I find.

 

- Michael

Share this post


Link to post
Share on other sites

How Very COOL! Yes I did a long long time ago. I drove 2 stepper motors with mirrors on them to move a laser for a lighting effect. In Basic. first I set the Port A bits to output. then I poked the step sequence to Port A. Yours is even easier. Just direction and step pulse. I can dig up the code if you like.

:)

  • Like 2

Share this post


Link to post
Share on other sites

Hi Ralphy,

 

That mirror project sounds like something a kid I knew back in the early 80's had done using a Vic20. We used his setup with a 5 watt water cooled argon laser to create a virtual ceiling of light about 8 feet above the floor covering an area the size of a multi-use room at a Jr High dance. It was so cool but also extremely dangerous at that power level!! At the time people were simply not aware of the danger of such things. The laser was on loan from a connection in Silicon Valley, and to get enough power to run it, we had tapped straight into the breaker panel. So what did you use your setup for?

 

And yes if you come across your code please share it here, and thanks for offering.

 

- Michael

  • Like 2

Share this post


Link to post
Share on other sites

Hmmm aside from the nostalgic value of using an Atari, why not just use an arduino or something similar?

To elaborate on my reasons...

 

It isn't for nostalgic value that I chose to do this. It's because the Atari 8-bit gives me a development platform that has a lot of great features of value, and which due to already having a couple laying around, adds zero cost to my project. Essentially this platform brings a keyboard for easy command input, a video monitor output for visual feedback, and an interpreted Basic language with good math support allowing for fast and easy on the fly changes to various parameters. Yes something like a PIC or Ardinio coupled to an IDE and ICSP connection could do the same, but I suspect not nearly as good from a real-time point of view (changes in the Atari Basic code would probagate much quicker to the hardware). And as I mentioned in my first post, the Atari is only being used for the initial development while I get a feel for how the electronic expansion valves work in my application. The goal is to move this into an embedded microcontroller after these first experiments.

 

- Michael

  • Like 4

Share this post


Link to post
Share on other sites

last time I saw anything remotely controlling steppers from the Atari was in a machine shop in Warren County, New Jersey.... It was an Atari 800 and all four joystick ports were being used...the programs were all on cassette tape and paper tape.... it was later donated to Warren county Vocational Technical School where I am sure it eventually met it's demise... it controlled x,y,z and angle positions a,b and finally motor speed/ on off... the values had to be calibrated/adjusted based on the degrees per step on the stepper motors... then lists of all coordinates were pumped in for a given part and it cut it out of metal blocks... pretty cool stuff

Edited by _The Doctor__
  • Like 1

Share this post


Link to post
Share on other sites

I only remember the cassette being in the sio port, everything else was thru joystick ports as far as I can remember.... the wires were all together going off the front ports and exitting together in in a bundle to the right of the Atari where it was wrapped with a cloth like tape to the sio cord and power cord down to the floor(I did not tear it apart to see if any of it was spliced or interconnected...but it could have been, The weird thing was a sort of tablet/pad it went into to more than one joystick port and required pulling harness out and plugging in the tracing pad ..... then you had to swap it out again to go back to machining....

thank god the joystick ports all faced to the front on the 800!

I believe a tape reader like it was on ebay in the past 3 or 4 years though..... at least I remember seeing it and thinking hey! I know what that is!

Share this post


Link to post
Share on other sites

I find it hard to believe someone hasn't bought or posted about the tablets and readers on AtariAge before....I know I had a conversation with someone about the tablet and we got it working for him...I doubt it was a pm....

Share this post


Link to post
Share on other sites

Sounds like someone created a CNC machine based on an Atari. Pretty cool real world application. This takes me back to the late 80's when I built 3 systems to test industrial chillers. These were based on 800XLs using the joystick ports to read the temperature from a thermocouple meter with serial output, switch TC inputs via small DIP relays, and control power on/off and cooling/defrost functions. Information was then displayed on-screen showing sampled temps, elapsed time, and current operational mode. Timed cooling and defrost cycles were performed by the Atari, on up to two refrigeration circuits. It also had a mini word processor built in to compose notes that would be time stamped. All information was sent to a printer. I was also working on a chart recorder routine, which actually worked quite well in stand-alone tests, but unfortunately never got integrated into the test program.

 

It was quite an ambitious project for the time, and when customers visited our facility, they were shocked to discover that 8-bit Atari computers were running this.

 

I only wished I had some of the upgrades available back then that are being made now.

 

 

last time I saw anything remotely controlling steppers from the Atari was in a machine shop in Warren County, New Jersey.... It was an Atari 800 and all four joystick ports were being used...the programs were all on cassette tape and paper tape.... it was later donated to Warren county Vocational Technical School where I am sure it eventually met it's demise... it controlled x,y,z and angle positions a,b and finally motor speed/ on off... the values had to be calibrated/adjusted based on the degrees per step on the stepper motors... then lists of all coordinates were pumped in for a given part and it cut it out of metal blocks... pretty cool stuff

- Michael Edited by mytekcontrols
  • Like 3

Share this post


Link to post
Share on other sites

Sounds like someone created a CNC machine based on an Atari. ...

Back then professional interfaces for home computers were available for many machines even ATARI 8-Bit. For fischertechnik (http://www.fischertechnik.de/en/Home.aspx) computing kits there was a control adapter available for ATARI XL/XE allowing to utilize things like a plotter/scanner kit.

 

Your cool project brought back memories. :-)

  • Like 2

Share this post


Link to post
Share on other sites

Back then professional interfaces for home computers were available for many machines even ATARI 8-Bit. For fischertechnik (http://www.fischertechnik.de/en/Home.aspx) computing kits there was a control adapter available for ATARI XL/XE allowing to utilize things like a plotter/scanner kit.

 

Your cool project brought back memories. :-)

 

Thanks for that link. Yeah it brought back memories for me as well. I just wish that I still had the program disk, but it's long gone. However I do have the MAC65 listed printout for the scrolling chart recorder routine, maybe later I'll scan it and post it. It was cool all on its own, and would render a chart in Graphics 8 that scrolled down the page vertically with dotted lines denoting time and temperature scales, and solid lines representing the actual real time temperature plot. It supported multiple channels and incorporated tagging of the plot lines to differentiate the different channels (text to dot rendering). The whole thing fit into Page 6 memory, and then could be accessed from Basic (passing temperature data), with all the timing, scrolling, and plotting handled in the background by the ML routine.

 

- Michael

  • Like 1

Share this post


Link to post
Share on other sites

Hello folks,

 

I sat down and cranked out a little Basic program interfaced to the A4988 intelligent stepper motor driver break-out board that I talked about earlier, which I'll be using to control an electronic refrigeration expansion valve. Here's a video of it in action, although you'll have to take my word on it that the valve was moving (actually use your 'imagination' might be a better word, since this was captured from an emulator and not real hardware). Although I have used this program on real hardware, so I do know that it works properly.

 

https://www.youtube.com/watch?v=ZPFY3ObVaZw&feature=youtu.be

 

Here's the file: EEVALVE.BAS

 

Presently I have this limited to 225 steps for fully open, although it appears that the valve will go a bit further, going up to nearly 250 steps before hitting the upper stop. The 'HOME' aspect basically bottoms out (closes) the valve, using 275 steps to insure that it truly is fully closed. This essentially initializes the valve so that when entering the number of steps open, that it will be repeatable. Line 909 allows all of these parameters to be changed via constants.

 

- Michael

 

EDIT: Opps I forgot to demo the JOG function... oh well more reason to download and try it yourself :grin:

Edited by mytekcontrols
  • Like 2

Share this post


Link to post
Share on other sites

For those people that run this program on real hardware, SHIFT+HOME would be SHIFT+CLEAR on a stock Atari keyboard. However on the Atari800 emulator and the TK-II it actually is the key marked 'HOME' on your PC keyboard (not sure about Altirra or some of the other emulators).

 

- Michael

  • Like 1

Share this post


Link to post
Share on other sites

Update...

 

I've been kinda busy with my 'real' job lately :( so I haven't been able to work on my other for fun Atari stuff. But this particular project is work related, and I have made a few revisions to both the code and hardware since I first started it. Thanks to dmsc, I was able to implement an analog position feedback output so that all aspects (both control and monitoring) could be done through a single joystick port (Joy1). Here's a link to that thread: PWM using joystick port

 

So I finalized the software changes to the stepper valve control, and also drew up a schematic of the required hardware.

 

XjcjFm1.png

 

Software: EEVALVE.atr

 

 

As I likely mentioned before, the analog signal for the positional feedback will be input into a USB-A/D module that via DasyLab on a PC will give me recordable test data as well as a real-time HMI display of the entire refrigeration system I am developing. The stepper driver output will be used to control the opening or closing of a electronic stepper expansion valve used to regulate refrigerant flow in this experimental chiller. The positioning of this valve is highly accurate and repeatable via the step process.

 

After the initial development has been completed and we move into phase 2 of the project, all aspects will be tied into a custom embedded control system (bye bye Atari). However using the Atari for the 1st phase of this development gave me a very easy method to test the expansion valve, and allowed for a great amount of flexibility in handling both the control and display aspects as such. Basically the Atari became a giant version of an MCU such as the Arduino or a PIC, giving me an I/O port (joystick), a display (TV), an input device (keyboard), a built-in high level language (Basic), and of course programmable memory. But the best part was that it was all incorporated into one easy to use package that I already have several iterations of in my collection. And it gives me a fairly portable rugged test system that should hold up well in my shop environment.

 

- Michael

 

EDIT: The EEVALVE.atr disk will automatically launch into Turbo Basic (for speed), and then run the actual valve control program. No user intervention required. If the stepper valve is going in the wrong direction, reversing either one of the coil connections coming from the A4988 will make it right.

 

EDIT (4/10/16): Updated Schematic. Fixed incorrect Stepper Motor Type from Uni-Polar to Bi-Polar.

 

EDIT: (4/11/16): Please note that the PWM-to-Analog output may vary by a +/- a few milivolts dependent upon the tolerance of the parts.

Edited by mytekcontrols
  • Like 3

Share this post


Link to post
Share on other sites

On my last post, I made a small technical error on the schematic. Where it specifies a uni-polar motor it really should have said bi-polar instead. Of course 6 or 8 lead uni-polar designs can often be rewired to a bi-polar configuration, but not so for 5 lead motors.

 

Now I'm kinda stumped as to how I can correct the schematic image, since changing it on Imgur might cause a new image link to be generated. Anyone have a suggestion?

 

- Michael

Share this post


Link to post
Share on other sites

On my last post, I made a small technical error on the schematic. Where it specifies a uni-polar motor it really should have said bi-polar instead. Of course 6 or 8 lead uni-polar designs can often be rewired to a bi-polar configuration, but not so for 5 lead motors.

 

Now I'm kinda stumped as to how I can correct the schematic image, since changing it on Imgur might cause a new image link to be generated. Anyone have a suggestion?

 

- Michael

Shoot Albert a quick PM, he'll unlock the post so you can edit it.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...