Notifications
Clear all

Just became a member

24 Posts
8 Users
8 Likes
770 Views
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@@banjobrad2

I am at a loss to understand the role a microprocessor would play in this?  Doesn't the heater come with an on/off switch and a heat setting knob? Automation is great until it fails particularly when if it doesn't have a manual over ride.  My father in laws passenger car window no longer works and there is no way to do it manually. Details of this actual device and what you want it to do that it can't already do might help? A link to the actual device might help explain the problem?

 


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2507
 

Posted by: @banjobrad2

[snipt]

I wouldn't care at what point it is opened when I shut off the power as long as I can resume turning the encoder one way or the other to accomplish open or closed once the power is back on. If for instance I leave the vent door fully open when I turn off the power, I'll know it's open the next time I get in and drive, so I'll leave it that way or turn the encoder ccw to close it. Does that make any sense or am I missing something?

It's still a good idea to home the stepper (if that's the route you go) when you start up the truck. Just put a small limit switch in an inconspicuous spot (like when they're closed) and then, at startup, rotate the vents until they close the limit switch.

From then on, you'll know exactly where they are.

 

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1644
 

Hi @banjobrad2,

Re: If I use a rotary encoder for example to rotate the motor 180 deg., the vent door ... etc.

That is precisely the correct idea ...though it would need to be the type of rotary encoder that gives an 'absolute' angle position ... the 'cheap and nasty' ones, such as those included in many of the Arduino-style introduction kits, only give a pulse each time they are rotated through a certain angle, say one pulse every 20 degrees rotation, but do not tell which 20 degrees of the 9 possibilities in 180 degrees, so check carefully before you buy.

Furthermore, this approach means that (optionally), you can add extra code to check if the vent is jamming, and take appropriate action ... e.g. removing power from the motor to prevent it burning out if it is stuck halfway, and showing there is a fault by lighting a 'fault' LED.

Best wishes, Dave


   
Inst-Tech reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1644
 

Hi @banjobrad2,

   @will has explained in a little more detail how a microswitch (which I mentioned in my first post) could be used, as an alternative to the rotary encoder ... your choice ... I have seen both approaches work in different situations. The important point is to have a mechanism for 'measuring' where the moving part is.

I would not advise trying to keep the microcontroller powered simply to remember the position ... from time to time the program will crash, you will need to change the vehicle battery or disconnect it for maintenance, or ??

And do fuse the system .. you don't want a fire if a wire chaffs somewhere, etc.

Best wishes, Dave


   
Inst-Tech reacted
ReplyQuote
(@banjobrad2)
Member
Joined: 1 year ago
Posts: 14
Topic starter  

@robotbuilder  The device does not exist yet, I'm going to build it. Fab of parts is not a problem, just need some electrical advice. The truck originally had a vent at the front behind the hood that you would push and pull to open or close, that was welded up, now I'm trying to design a ventilation door assembly that would pull air in from the side louvers. Would rather not use cables, not much room under the dash to run them.


   
ReplyQuote
(@banjobrad2)
Member
Joined: 1 year ago
Posts: 14
Topic starter  

@davee  All good advice Dave. If I use a rotary encoder, how exactly do I go about making it remember where it was last in rotational position once power is removed? Can this be done with code?


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6865
 

@banjobrad2 That is why it isn't a good idea unless you leave the code always powered on or store the value in eprom or spiffs or even attach an SD card. A servo might be simpler if there is enough mechanical advantage otherwise a stepper. Some steppers come with a type of encoder but I think they are much more expensive, not 100% sure.

Another solution is to use a micro switch as someone suggested. All you do then is drive the motor in a predefined direction until it hits the switch. This is now your zero spot.

I would not count on the code to be always running, batteries die.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1644
 

Hi @banjobrad2,

  Re: If I use a rotary encoder, how exactly do I go about making it remember where it was last in rotational position once power is removed?

  In theory it is possble to have memory that can be written to, and that does not forget everything when the power fails .. but I think this is a rabbit hole that is well worth avoiding for your application. It is much harder to achieve a reliable and robust solution than it first appears.

So far as I can think, there are two possibilities to choose between:

  1. Some types of rotary encoders will give an absolute position readout .. that will do the job fine ... but they are more complex and maybe outside of your budget .. Sorry I haven't had the need to buy one, so I would start with looking at Digi-key and Mouser for some examples ... depending on what you find, you can decide whether it is worth looking for a better deal.
  2. As already mentioned, if you have a microswitch which is triggered at one extreme, then you can have a position reset procedure, that moves the the vane until the switch is triggered .. then you have an 'absolute' position reference .. optionally you can then use a simple rotary encoder to measure the change of angle .. until the power is removed .. or use a stepper motor and count the steps.
    • Of course this assumes you want several 'part open' positions. If you are only interested in "fully open" and "fully closed", the encoder can be replaced with a second microswitch.

The second option wil probably be the more 'cost effective' route, but it may require a bit more mechanical work.

Part of the game is clearly thinking out what you want your system to achieve, before you start. Most of us (well me, anyway) start off with 'half an idea' and only realise some of the implications halfway through the project.

Best wishes, Dave


   
ReplyQuote
(@banjobrad2)
Member
Joined: 1 year ago
Posts: 14
Topic starter  

@davee   Thanks Ron, I'll pursue the idea of a micro switch to index the rotation.

Take care.


   
ReplyQuote
Page 2 / 2