Tindie project - Stepper motor gauge - Page 1
Forum section: electronics / projects

author: boffin
author_rank: Unknown
timestamp: October 27, 2015, 04:27:59 pm
content: I finally got my butt in gear and created a tindie store to list my serial gauge stepper controller:https://www.tindie.com/stores/boffin/Comments welcome..And if you're interested; coupon code: 9E93CE8 good until the end of the month.

author: homebrew
author_rank: Frequent Contributor
timestamp: October 27, 2015, 05:59:51 pm
content: Nice idea ... but certainly not in an automotive environment!You have absolutely NO input protection on your power pins whatsoever. In an automotive environment you have to expect power surges and under certain conditions even reverse voltages...I would put (at least) the following on your board:1) Fuse2) P-Mosfet in reverse (Protection against reverse polarity) seehttp://www.ti.com/lit/an/snva717/snva717.pdffor details3) Some measures of over voltage protectionIn General:4) 100nF cap before the regulator5) Bulk capacitor before the regulator 100uF or more, depending on your load5) Reverse protection diode over the regulator22uF are a bit on the low side, too ...Running the stepper directly from the ATTiny ports seems a bit questionable. Can you guarantee that the ATTiny still operates within specs?And a horrible layout of the VCC and GND lines...So I personally wouldn't sell this at that stage of development.

author: boffin
author_rank: Unknown
timestamp: November 02, 2015, 01:16:50 am
content: Quote from: homebrew on October 27, 2015, 05:59:51 pmLike many things on Tindie, it contains a building block that others can expand on and use in their projects.My comments:If someone wants to add a simple diode & fuse; on the front end, they're welcome to.ATTiny can sink/source 40mA, the coils in the Switec are 20mA. Should be fine; despite your concerns22uF might be a tad small, I'll probably up it a big on the next rev.As for the 'horrible' layout of the Vcc and Gnd, I wouldn't mind hearing your explanation; or were you just having a bad day?They're already 20mil, kept well away from other things, and relatively straight from the connector through to the uC. Admittedly it does jump through the board at the decoupling cap, but I'll change that on the next rev of the board.

author: jwm_
author_rank: Frequent Contributor
timestamp: November 02, 2015, 01:47:24 am
content: 40mA is the absolute maximum rating, in that you will not cause permanent damage to the device if you stay within it. The maximum current at which the chip is guarenteed to function properly is less. Common values for attiny are 10mA at 3v and 20 at 5v. Maximum ratings are the permanent damage thresholds, not the will function properly ones.

author: homebrew
author_rank: Frequent Contributor
timestamp: November 02, 2015, 08:38:54 am
content: Quote from: boffin on November 02, 2015, 01:16:50 amApparently yes, but that doesn't mean that everybody SHOULD add carelessly designed stuff on top of it ...Quote from: boffin on November 02, 2015, 01:16:50 amSure enough. It is your project. Do whatever you like. And in general I don't have any concerns ... why should I? - it's not my project. I just try to help you by challenging some aspects. If you come to the conclusion that it will work nevertheless it's fine. But I assumed that you placed it here to get some feedback. Or was it just or advertising???Quote from: boffin on November 02, 2015, 01:16:50 amBut I don't see any design files for the PCB published. So how would somebody contribute? Maybe I'm just too stupid to look but otherwise these types of problems are common with half opened projects :-(I mean seriously - why won't you share your design files?BTW, here is a thread on automotive input protectionhttps://www.eevblog.com/forum/projects/automotive-device-power-supply-design-do-i-need-tvs-and-resistors/Quote from: boffin on November 02, 2015, 01:16:50 amWell, the first thing is that I ASSUME (based on the ground trace from the decoupling cap to the ISP connector) that you don't have a ground plane. Between VCC and GND you have quite large loop areas so this thing will be problematic EMC wise. It will radiate quite a bit and also be be more sensitive to EM radiation from the outside.I would suggest to pour ground planes on BOTH sides and stitch them together with a lot of vias. Ideally you would not cut the ground plane on the bottom side - if necessary cover the area with ground on the top layer. I would place the positive pin of the decoupling cap even closer to the VCC pin on the ATiny.See a fantastic example in the design files published here:https://www.eevblog.com/forum/projects/isp-mini-yet-another-avr-programmer/As for the regulator - please read the datasheet (i.e.https://www.fairchildsemi.com/datasheets/MC/MC78L05A.pdf):1) Capacitor on the input is required.2) Also the regulator is quite on the edge of specification power wise. In a car environment it has to drop 13.8V-5V = 8.8V (under good conditions- could be worse though). Given 40mA of your two coils and the losses in the rest of the thing, it would be safe to assume a need of around 50mA. Hence the regulator dissipates 0.44W of heat. Given the thermal resistance of 150°K/W the junction-temperature will be at least 66°K above ambient. So there is not that much margin on a hot day ...Further, you could source the stepper with a higher voltage, too. According to the datasheet (http://www.jukenswisstech.com/JSTFiles/downloads/2011/06/X27_Flyer_v1.3.pdf), the coils are rated up to 9V. Of course you would design the driver to source that 20mA when holding the position. But when changing the magnetic fields in the stepper, the higher voltage comes handy to build up the field more quickly. Initially you would have 0mA current flowing due to induction. Hence especially when moving quickly this might be necessary to not loose steps.

author: Richard Crowley
author_rank: Super Contributor
timestamp: November 02, 2015, 08:49:23 am
content: I don't understand the design of boards like these.There appear to be no mounting holes.How do people use little boards like this in the Real World?(not just sitting on a bench with flying lead wires)

author: homebrew
author_rank: Frequent Contributor
timestamp: November 02, 2015, 09:12:13 am
content: Quote from: Richard Crowley on November 02, 2015, 08:49:23 amI think it is intended that the stepper is mounted itself to an instrument panel.Whether or not this is a good idea to mount the PCB just by its solder joints to the motor is another topic...Also the wiring with the .1" connectors is questionable in an environment with quite some vibrations.

author: FrankenPC
author_rank: Unknown
timestamp: November 02, 2015, 09:24:25 am
content: Your price point is certainly there!Side question, I wonder is anyone has tried this with a three phase brushless motor? The price will be higher obviously. The same type of system used in something like this:http://www.ebay.com/itm/CNC-Brushless-PTZ-Drone-Accessery-Gimbal-Mount-of-Camera-For-Gopro-DJI-Phantom-/311397889371?hash=item4880c2b55b:g:tjkAAOSwHnFVm~gt

author: jwm_
author_rank: Frequent Contributor
timestamp: November 02, 2015, 09:35:34 am
content: Quote from: FrankenPC on November 02, 2015, 09:24:25 amYou generally cannot drive them at slow speed or with any precision, at least not easily. In order to drive the phases properly you need to actively sense the rotor position, the most common way is via the back EMF which only really exists once you are going at speed. Additionally, steppers usually have a few hundred steps per rotation, a 3 phase motor might only have a dozen and just four is not uncommon.There are various tricks to get them to start up going the right way, detecting the phase by sending test pulses and seeing how long it takes for the field to decay, nothing simple though.

author: zapta
author_rank: Super Contributor
timestamp: November 02, 2015, 03:58:18 pm
content: Quote from: Richard Crowley on November 02, 2015, 08:49:23 amI use thishttp://www.homedepot.com/p/3M-Scotch-1-in-x-1-66-yds-Outdoor-Mounting-Tape-411-DC/100575385

author: zapta
author_rank: Super Contributor
timestamp: November 02, 2015, 04:00:08 pm
content: Quote from: boffin on October 27, 2015, 04:27:59 pmThe demo video is very nice. Does it preserve the absolute zero point?

author: mikerj
author_rank: Super Contributor
timestamp: November 02, 2015, 05:49:36 pm
content: Quote from: zapta on November 02, 2015, 04:00:08 pmDo you mean does the stepper miss any steps during the demo, or does the board preserve the zero point after a power cycle? The latter is very unlikely, even OEM car dashboards don't do this.

author: jwm_
author_rank: Frequent Contributor
timestamp: November 03, 2015, 12:29:45 am
content: Quote from: mikerj on November 02, 2015, 05:49:36 pmHmm.. seems less than useful if it doesn't preserve the zero point. there are a few ways i can think of to do it* limit switch at zero, physical switch, hall effect sensor, optical. I'd go with hall effect, dirt cheap and can probably work through the faceplate with a small magnet glued to the backside of the pointer.* manually set it once and store the current positon in eeprom after each move. (wear level it of course)* beefy caps to have enough energy to send it back to zero when it detects power is out. (or enough to write to eeprom just once)* spring load it to come back to zero, The steppers holding torque will keep it in place when you have power.first pass I'd do the capacitor eeprom thing as it is pure software except for a method to interrupt on external power loss. still a chance it might get out of sync, but provide a mechanism to re-zero it. Unless it is displaying something mission critical, like boiler temperature before it explodes. then hall sensors or better a spring to pull it back below zero to see power is out.

author: BradC
author_rank: Super Contributor
timestamp: November 03, 2015, 01:13:12 am
content: Quote from: jwm_ on November 03, 2015, 12:29:45 amThis is how Navman marine instruments used to do it. A tiny magnet in the pointer and a hall effect behind the face plate. From hazy memory, the dash in my Audi did it that way too.The Navmans had 360 degree indication, so no zero pin to bump up against. They do a 360 sweep to calibrate on power on. With a well balanced pointer and decent control algorithms missed steps are a non-issue. Additionally if you placed the hall effect in a frequently traversed place on the dial then on the fly recalibration is easy.

author: Richard Crowley
author_rank: Super Contributor
timestamp: November 03, 2015, 01:44:45 am
content: It looks to me like your average vehicle speedometer (and similar gauges) simply have a mechanical stop (a small pin) the prevents the indicator hand from going any lower than zero. Upon power-up, you simply drive the indicator downwards for {full scale} steps, and you are guaranteed zero-reference without any additional sensors, etc.Those things don't have much torque (because they don't need it.) Driving them into a hard-stop at power-up isn't going to hurt them.Keep it simple, folks.

author: Habropoda
author_rank: Regular Contributor
timestamp: November 03, 2015, 02:38:14 am
content: I agree on keeping it simple.These little steppers are actually a lot of fun. They do have a limited movement of about 300 degrees or so. You can just bump them against one side and then the other on startup to knock out any any missteps. They are weak so you need to use acceleration and deceleration to prevent lost steps. Once you have it adjusted they are fast and accurate. Handy for all kinds of retro indicators and not as bulky and noisy as a servo.

author: boffin
author_rank: Unknown
timestamp: November 03, 2015, 02:54:31 am
content: Keep it simple; exactly. This is more of a 'hey, want to steampunk an old gauge', not 'I'm going to build a mil-spec system for launching into space.'Comments:I left room for the 5v regulator because a friend asked about driving it from a 9v source. Driving the coils from 9v isn't practical, because they're driven from the ATTiny (which is 5.5v max). Would it get warm in a higher voltage environment, yep. Adding a separate driver chip would take up more PCB space or involve switching to surface mount; neither of which I think is ideal.Ground plane, sure; didn't bother in the 1st run of PCBs, will probably add one next time around. Haven't played with PCB layout since the 80s (PDP-11 running Racal Redac).Input (pre regulator) cap. Again, sure, I'll add a spot next run.0.1" header isn't going to work for something w/ vibration, in which case I would expect people to just solder to it (see note above about KISS).The stepper itself has an internal stop, and 315 degrees of movement w/ 1/3 of a degree of accuracy (hence 0-944). People on the net talk about removing the internal stop to do 360 rotation, but I haven't tried. If you did that, you'd need a way of zero detect, with the internal stop, you can (and do), just CCW step against the stop to reset it.It's possible to mount using the two tiny screw holes on the far edges of the stepper.

author: FrankenPC
author_rank: Unknown
timestamp: November 03, 2015, 06:13:07 am
content: Quote from: jwm_ on November 02, 2015, 09:35:34 amI have a quad copter and camera driven by something very similar to the link I provided. The speed and precision are incredible. I'm not entirely sure we are talking about the same thing.

author: jwm_
author_rank: Frequent Contributor
timestamp: November 03, 2015, 08:20:16 am
content: Quote from: FrankenPC on November 03, 2015, 06:13:07 amYeah we are not, for some reason my brain read the ebay page as a brushless propeller motor despite it clearly not being one in any way. brainfart.Actually, the construction of those brushless gimbals looks very similar to propeller motors, closed loop feedback? I'll have to look into they do that. perhaps sine wave drive.John

author: homebrew
author_rank: Frequent Contributor
timestamp: November 03, 2015, 10:30:38 am
content: Quote from: boffin on November 03, 2015, 02:54:31 amAs I find the stepper highly interesting, I'll started to design my own PCB around it.A first playaround with eagle suggests that all the components would fit on a circular PCB with the exact same size of the stepper itself.A suitable HBridge (i.e. A3901) doesn't add to the bill that much and with its DFN package the space required can be pretty much ignored.I'll post the design files when finished (could take some days as I have a lot of other work to do ...)Maybe this could also serve as a nice demo project on PCB layout, as it is not very complex ...Here a short impression from the HIGHLY UNFINISHED tinkerning ...

author: homebrew
author_rank: Frequent Contributor
timestamp: November 04, 2015, 07:56:19 am
content: So here are the promised design files.As I don't want to use the thing in an automotive environment, no reverse protection or surge protection has been added. As I further plan to have several instruments on a panel I opted for RS485 communication.Would be happy about any feedback though, before I order some PCBs ...Of course, everything is open (CERN OHL).