-
2 Attachment(s)
microcontroller scanner
Hey folks,
I posted a few questions before the festive season about how to drive my DT25 galvos, and since then things have been coming along. I'm using a TI microcontroller to spit out the analogue signals for the galvos. I'm driving the galvos single ended: x- and y- are tied to ground, and only x+ and y+ are controlled.
I can successfully make my laser show some lines here and there:
Attachment 13827
But you can see the text isn't written very well. On the left it's supposed to be block letters saying FHV, but you can see that the base of the letters is all curvy and innaccurate.
Looking at the output of the DACs on a scope, we get this:
Attachment 13828
it's upside down, but apart from that, the letters are nice and square. This seems to tell me that I'm doing something wrong with the way I'm talking to the galvos.
I'm not sending the signals overly fast - I can already see the image flicker at this speed.
I'm not making the image very big. This is operating straight from the output of the TI chip, so the signals are 0 - 3V (yeah I know I'm only using 1/4 of the display region, but adding an amplifying circuit adds another possible cause of the problem).
So can anyone suggest how I can improve this? Unfortunately I have to give a presentation for uni next week, so while it's a proof of concept, it'd be nice to make it as pretty as possible.
Thanks!
Bonus: I haven't got the controller for the galvos on a heat sink yet, but the image is the same even when it is first turned on and everything is cold.
-
Flicker with this kind of low point count will probably be you sending them too slow.
The DT25 can easily handle 25Kpps that means 25K points per second.
Also for the letters, use inbetween points instead of just at the corners.
This should solve the curving
-
FourDee hit it on the head. You need more anchor points at the corners, and more points along the straight lines of the letters as well. If you can get the number of points in that image up to around 300 or so, it will look *much* better.
Adam
-
PM me with a email and tomarrow or late tonight EST I'll send you a working demo copy of drawing software that adds corner points, blanking points, and anchor points to your images, then saves them as a ilda file. Some compiled code that takes a ilda file down to ascii numbers, is linked below, I'm assuming you store your image as data inline in your program.
Which TI processor are you using?
Grab ILDAREAD AND ILDAWRITE, run them in a dos box.
http://www.laserfx.com/Backstage.Las...loadIndex.html
You need to learn about corner points, anchor points and blanking points.
Or you can get a copy of laserboy freeware and do something similar.
This paragraph explains a lot in a few words:
Quote:
It also adds necessary anchor points in corners depending on the corner angle - more points at sharp angles, and less at obtuse angles - this allows you have good quality image on any system. Just draw what you want in any way, Anarchy Editor will carry out all the dirty work for you to make your image perfect.
End quote
Steve
-
Speedy responses! Thanks guys.
I didn't think to have several points around the corners to slow the mirrors down, I just implemented a delay at each corner to give the mirrors settling time. I'll try manually putting some more points in where I think they should go. Currently the F and the H only have about 15 points, the V has 65 and the big box thing has 388.
I haven't had a chance to read through the documentation Steve, but I'll look into it tonight. You're correct that I'm just storing the data points inline in the code. I couldn't think of a better way to do it. I have MATLAB generate the data points (from a given image), and then I just copy paste the data points into the code.
I have implemented blanking on the laser, it's just not happening in that photo.
Corner points and anchor points I'm not so aware of.
The controller is an MSP430 (8MHz, 2xDACs).
Why do you need to put points along the straight lines as well as at the corners? Are the galvos prone to overshoot their mark?
-
Scanner feedback 101
A untuned scanner amp responding to a square wave:
From the dedicated and patient ELM CHAN:
http://elm-chan.org/works/vlp/stpy1.jpeg
Yes, a good tutorial is on line somewhere, but you may find how they are tuned to be interesting. Leave your tuning where its at, and work up your code.
Your outputting a wave thats a bit faster then the standard scanner tuning is set up for. But GOOD JOB on getting output.
Here: this is confusing if you dont know what a PID loop is yet.
Proportional,
A signal that is the raw feedback signal from the position sensor, chooses the direction and speed of the feedback. Has AC and DC parts.
Integral,
What amounts to a low pass filtered, DC coupled, version of the feedback, slows the scanner as it nears target.
Derivative,
What amounts to be a spike aligned with the edges of changes in the feedback,
Used to slam the scanner to a stop and damp oscillations that occur as it stops. A carefully high pass filtered and processed version of the raw feedback signal, has no DC part. Ie its only there when a sharp , fast move occurs. Well, faster then a certain threshold. Set up to be opposite in polarity to the motion.
Scanners want to overshoot (A body in motion remains in motion, Dr Newton's little law) and Oscillate , as the shaft and mirrors have resonances as well as inertia. The forces on a tiny galvo shaft are huge on a small scale. Remember, a fast square wave contains all high frequencies in its edges, and your outputting a lot of HF to cause excitation of the shaft's ringing.
Overly complex but here:
http://en.wikipedia.org/wiki/PID_controller
See here for some understanding with scope waveforms.
Speaking of scope waveforms, you galvo amps may have a feedback test point brough out for scan fail safeguards.. While randomly probing sensitive galvo amps with a scope is not a good idea until you have a passing grade and a finished product, you may find watching the feedback signals on your scope enlightening. (excuse pun)
Schematia of the amp the Chinese copied first:
I'm told many low cost modern amps are PII or some other mess, but the basic ideas are the same:
Skywise kindly hosts this for me.. Its a combination of data for two types of scanners widely available when I was a kid.
http://www.skywise711.com/lasers/scanner/scanner.html
I'll get a copy of the software to you late tonight. Along with two standard unblanked 8 bit test patterns that might just fit in your micro.. Got enough ram left for 512 points times two ?
Elm Chan has great scope pictures showing overshoot, and ringing, at his site: The ringing is the damped sine wave, the overshoot is the huge spike on the leading and falling edges just before the ringing.
His tuning method is a bit different from what I was taught, but it works.
http://elm-chan.org/works/vlp/report_e.html
Ponder the following thought:
In theory, if your software was fast enough, at a time T equal to one half the period of the jump, when you change angles, you applied a spike of one half the amplitude as your commanded position, and opposite in polarity, the galvo would slam on the brakes without having to have as much circuitry as it does. But since we command galvos from DC to 2.5 Khz or so, that is a lot of adjustable timing for the software to cope with. But you can try it if you had small jump, fixed spacing, between points. It wont work well for long jumps. Probably not a good idea until you get the basics working. In the old days, before the ILDA tuning standard, people adjusted the locations of the their points while watching the image, to get things right. But when you sent your image to a friend or business partner, it did NOT look good on their scanners. This is why I'd say don't adjust your tuning.
Hint, the fastest way in Physics for a solid object to get from one position to another is to maximally linearly accelerate, and then half way there, maximally linearly decelerate at the same rates.
Steve
-
Line Drawing Algorithm
Everyone so far is right. You are asking the scanners to jump too far and then change direction to fast. You need to add some points in between. I would not suggest just adding points to the corners. You will eventually end up with bright dots at the corners and faint lines in between. I think you are more after a nice looking equal brightness line.
A simple way to do this is with a line drawing algorithm such as Bresenham's algorithm (find it in google or the Wiki). While there are many many code examples I suggest you look at one of the open source or free source software packages out there. Monkey Tools (is a drawing package), Laser Boy, LFI Player (Source Forge). All of these I believe have C/C++ code for drawing in there. Just watch out for the licenses that are attached if you copy the source code. You can always peek and then write your own right?
As the others stated there are other optimizations you can do. Mixed Gas was talking about the free demo for Anarchy laser show editor. I would like to point out that Monkey Tools is also free, with source code, can draw lines and can save ILDA files too! And... it isn't a demo.
Nice project and ...
Good Luck!
-
Ah thanks for the theory Steve! I'm coming to the end of my EE degree, so I'm pretty comfortable with PID controllers. That's kind of why I thought it'd be best just to send corner points to the galvos - that way the control circuitry can deal with making the mirrors get there as fast as possible, without overshoot.
Yeah the micro has enough memory for 55k points, so i'll try to implement those test patterns.
I'm keeping the screwdriver away from the galvo controller, I get the idea they're usually tuned pretty well anyway.
I'm using MATLAB to decide where the points should go, so it's fairly easy to make it spit out points equidistant along the line. In fact, that's how it was initially. I decided not to have points all the way along the lines and only at the corners, but I can't remember if that was to save space in the code, or because the image didn't come out right. I'll edit the MATLAB code and try again with data points equidistant on all the lines.
-
Hum, Chris, you think I would not take good care of him ???
Steve
-
[QUOTE=jack;132835]Ah thanks for the theory Steve! I'm coming to the end of my EE degree, so I'm pretty comfortable with PID controllers.
Sorry for the overkill explanation then... But there are others out there.... ;)
Steve