Author Topic: Tindie project - Stepper motor gauge  (Read 6379 times)

0 Members and 1 Guest are viewing this topic.

Offline boffinTopic starter

  • Supporter
  • ****
  • Posts: 1027
  • Country: ca
Tindie project - Stepper motor gauge
« on: October 27, 2015, 04:27:59 pm »
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.
« Last Edit: October 27, 2015, 04:36:58 pm by boffin »
 

Offline homebrew

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: ch
Re: Tindie project - Stepper motor gauge
« Reply #1 on: October 27, 2015, 05:59:51 pm »
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) Fuse
2) P-Mosfet in reverse  (Protection against reverse polarity) see http://www.ti.com/lit/an/snva717/snva717.pdf for details
3) Some measures of over voltage protection

In General:
4) 100nF cap before the regulator
5) Bulk capacitor before the regulator 100uF or more, depending on your load
5) Reverse protection diode over the regulator

22uF 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.
 

Offline boffinTopic starter

  • Supporter
  • ****
  • Posts: 1027
  • Country: ca
Re: Tindie project - Stepper motor gauge
« Reply #2 on: November 02, 2015, 01:16:50 am »
I would put (at least) the following on your board:
1) Fuse
2) P-Mosfet in reverse  (Protection against reverse polarity) see http://www.ti.com/lit/an/snva717/snva717.pdf for details
3) Some measures of over voltage protection
4) 100nF cap before the regulator
5) Bulk capacitor before the regulator 100uF or more, depending on your load
5) Reverse protection diode over the regulator

22uF 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...

Like 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 concerns
22uF 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.

 

Offline jwm_

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
    • Not A Number
Re: Tindie project - Stepper motor gauge
« Reply #3 on: November 02, 2015, 01:47:24 am »
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.

Offline homebrew

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: ch
Re: Tindie project - Stepper motor gauge
« Reply #4 on: November 02, 2015, 08:38:54 am »
Like many things on Tindie, it contains a building block that others can expand on and use in their projects. 

Apparently yes, but that doesn't mean that everybody SHOULD add carelessly designed stuff on top of it ...

My comments:
ATTiny can sink/source 40mA, the coils in the Switec are 20mA.  Should be fine; despite your concerns

Sure 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???

If someone wants to add a simple diode & fuse; on the front end, they're welcome to.

But 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 protection https://www.eevblog.com/forum/projects/automotive-device-power-supply-design-do-i-need-tvs-and-resistors/
 
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.

Well, 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.
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Tindie project - Stepper motor gauge
« Reply #5 on: November 02, 2015, 08:49:23 am »
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)
 

Offline homebrew

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: ch
Re: Tindie project - Stepper motor gauge
« Reply #6 on: November 02, 2015, 09:12:13 am »
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)

I 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.
 

Offline FrankenPC

  • Supporter
  • ****
  • Posts: 335
  • Country: us
Re: Tindie project - Stepper motor gauge
« Reply #7 on: November 02, 2015, 09:24:25 am »
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

Chinglish poetry: In the hot summer. In the car ran full steam. It tastes strange. For this worry? With this fan will bring you a cool summer. Suitable for all kinds of cars. Agricultural vehicles. Van. Tricycle.
 

Offline jwm_

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
    • Not A Number
Re: Tindie project - Stepper motor gauge
« Reply #8 on: November 02, 2015, 09:35:34 am »
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

You 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.

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: Tindie project - Stepper motor gauge
« Reply #9 on: November 02, 2015, 03:58:18 pm »
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)


I use this  http://www.homedepot.com/p/3M-Scotch-1-in-x-1-66-yds-Outdoor-Mounting-Tape-411-DC/100575385

 

Offline zapta

  • Super Contributor
  • ***
  • Posts: 6189
  • Country: us
Re: Tindie project - Stepper motor gauge
« Reply #10 on: November 02, 2015, 04:00:08 pm »
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.

The demo video is very nice.  Does it preserve the absolute zero point?
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: Tindie project - Stepper motor gauge
« Reply #11 on: November 02, 2015, 05:49:36 pm »
The demo video is very nice.  Does it preserve the absolute zero point?

Do 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.
 

Offline jwm_

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
    • Not A Number
Re: Tindie project - Stepper motor gauge
« Reply #12 on: November 03, 2015, 12:29:45 am »
The demo video is very nice.  Does it preserve the absolute zero point?

Do 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.

Hmm.. 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.

Online BradC

  • Super Contributor
  • ***
  • Posts: 2104
  • Country: au
Re: Tindie project - Stepper motor gauge
« Reply #13 on: November 03, 2015, 01:13:12 am »
* 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.

This 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.
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Tindie project - Stepper motor gauge
« Reply #14 on: November 03, 2015, 01:44:45 am »
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.
 

Offline Habropoda

  • Regular Contributor
  • *
  • Posts: 67
  • Country: us
Re: Tindie project - Stepper motor gauge
« Reply #15 on: November 03, 2015, 02:38:14 am »
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.
 

Offline boffinTopic starter

  • Supporter
  • ****
  • Posts: 1027
  • Country: ca
Re: Tindie project - Stepper motor gauge
« Reply #16 on: November 03, 2015, 02:54:31 am »
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.
 

Offline FrankenPC

  • Supporter
  • ****
  • Posts: 335
  • Country: us
Re: Tindie project - Stepper motor gauge
« Reply #17 on: November 03, 2015, 06:13:07 am »
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

You 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.

I 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.
Chinglish poetry: In the hot summer. In the car ran full steam. It tastes strange. For this worry? With this fan will bring you a cool summer. Suitable for all kinds of cars. Agricultural vehicles. Van. Tricycle.
 

Offline jwm_

  • Frequent Contributor
  • **
  • Posts: 319
  • Country: us
    • Not A Number
Re: Tindie project - Stepper motor gauge
« Reply #18 on: November 03, 2015, 08:20:16 am »
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


You 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.

I 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.

Yeah 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
« Last Edit: November 03, 2015, 08:27:21 am by jwm_ »
 

Offline homebrew

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: ch
Re: Tindie project - Stepper motor gauge
« Reply #19 on: November 03, 2015, 10:30:38 am »
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.

As 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 ...

 
« Last Edit: November 03, 2015, 11:38:50 am by homebrew »
 

Offline homebrew

  • Frequent Contributor
  • **
  • Posts: 293
  • Country: ch
Re: Tindie project - Stepper motor gauge
« Reply #20 on: November 04, 2015, 07:56:19 am »
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).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf