Author Topic: Another Solenoid Engine  (Read 5185 times)

Offline cfellows

  • Rest In Peace
  • Full Member
  • *
  • Posts: 1700
Another Solenoid Engine
« on: May 12, 2018, 09:27:06 PM »
Hagar's solenoid engine has inspired me to resume work on this engine.  For size comparison, the flywheel on this engine is 7" diameter...



I originally designed this engine to be controlled with hall effect sensors and an arduino triggering a motor control board.  The original design didn't have enough power and by the time I gathered the parts for greater power, I lost interest.  I wanted to make it either 2 stroke or 4 stroke in operation, being as much interested in the sound as in the performance.  It uses a Scotch Yoke design with about a 1/2" stroke.



After seeing Hagar's post, I decided to eliminate all the electronic parts and simply use a cam and switches enabling me to control both the timing and the dwell of the contacts.   If I want to run it in two stroke mode, I can simply used a double lobed cam.

I found 14 tooth and 28 tooth, 24 pitch gears for the cam so I'm off to do some more thinking...

Chuck
« Last Edit: May 13, 2018, 12:08:28 AM by cfellows »
So many projects, so little time...

Offline zeeprogrammer

  • Full Member
  • *****
  • Posts: 6811
  • West Chester, PA, USA
Re: Another Solenoid Engine
« Reply #1 on: May 12, 2018, 09:42:28 PM »
 :ThumbsUp:

Have at it Chuck. I'll be watching.
Carl (aka Zee) Will sometimes respond to 'hey' but never 'hey you'.
"To work. To work."
Zee-Another Thread Trasher.

Offline cfellows

  • Rest In Peace
  • Full Member
  • *
  • Posts: 1700
Re: Another Solenoid Engine
« Reply #2 on: May 12, 2018, 10:50:38 PM »
Thanks, Zee.  By the way, if anyone is interested, here is a link to the original build thread which has more details on the engine. 

http://www.modelenginemaker.com/index.php/topic,6476.msg135908.html#msg135908

Most of he images are hosted on photobucket, which opted to pull the rug out from under everyone who was posting pictures there.  You can view the pictures by right clicking on the photobucket notice then left click on "Open in new Tab" where the picture will be displayed. 

Chuck
So many projects, so little time...

Offline Hagar

  • Full Member
  • ****
  • Posts: 59
Re: Another Solenoid Engine
« Reply #3 on: May 13, 2018, 08:35:24 PM »
Hi Chuck,

I fully agree. To my eyes, a model engine is a tribute to past full size machines. Arduino is for science fiction devices. Perfect to power any saucer but far from the spirit we target.
As for the sound, the more moving parts an engine holds, the better is the song. And electronic components are mute.

And i must admit : the main reason i have to avoid Arduino is i'm not clever enough to understand how it works. :Lol:

We're all looking at the work you're about to do. :popcorn:

Offline cfellows

  • Rest In Peace
  • Full Member
  • *
  • Posts: 1700
Re: Another Solenoid Engine
« Reply #4 on: May 14, 2018, 05:37:04 PM »
Thanks for the comment, Hagar.  The main reason for considering the electronic approach was the flexibility of control it allows.  Makes it pretty easy to progammatically change from 4 stroke to 2 stroke operation with just a switch.  And it makes it easy to control voltage, timing and dwell with simple rotary controls.  Lots of room for experimentation. 

On the down side, electronics can be finicky about wrong connections and voltage spikes.  The Arduino can be a touchy little devil and while not expensive, it's difficult to diagnose where the problems are.

So I've been noodling for a couple of days on  design and placement of the mechanical switching components.  I would like to use micro-switches mounted on a plate which I can rotate to adjust timing and move in and out to adjust dwell.  The micro-switches would be actuated directly by a cam lobe machined into the hub of the secondary timing gear pictured.





The clearance space under the flywheel is somewhat limited but there is room for the micro-switches are 1/2" x 1/4" x 1/4" and a thin metal plate.

Another option is to mount the timing gear on a shaft which extends though the frame to the back of the engine where a cam could be mounted and there is plenty of room for any kind of configuration I can come up with.  Anyway, any thoughts or suggestions are certainly welcome since I haven't come to any solutions I like so far.

Chuck
So many projects, so little time...

Offline cfellows

  • Rest In Peace
  • Full Member
  • *
  • Posts: 1700
Re: Another Solenoid Engine
« Reply #5 on: May 19, 2018, 03:44:12 AM »
Still puzzling through the mountings for the switches.  In the meantime, I went ahead and finished the cam gear and got it mounted.





Chuck
So many projects, so little time...

Offline 10KPete

  • Full Member
  • ****
  • Posts: 1606
  • Nordland, WA, USA
Re: Another Solenoid Engine
« Reply #6 on: May 19, 2018, 07:35:17 AM »
 :popcorn: :popcorn: :DrinkPint: :DrinkPint: :ThumbsUp: :ThumbsUp:

Pete
Craftsman, Tinkerer, Curious Person.
Retired, finally!
SB 10K lathe, Benchmaster mill. And stuff.

Offline cfellows

  • Rest In Peace
  • Full Member
  • *
  • Posts: 1700
Re: Another Solenoid Engine
« Reply #7 on: May 20, 2018, 08:51:50 PM »
Thanks for the encouragement, Pete.  This may come as a disappointment to some, but I've decided to use electronic switching on this engine rather than mechanical points or micro switches.  There are several reasons, the most important being current considerations.  These solenoids will draw upwards of 7 or more amps at full voltage and frankly, I doubt the micro switches would hold up very long under that kind of current, even with clamping diodes or capacitors.  Of course, the other consideration is that electronic switching makes it much easier to control timing, dwell, and mode of operation (2 stroke or 4 stroke).  And, I had already purchased the electronic components and figured I might as well use them.  From the picture, you can see that it looks pretty complicated...



Starting in the upper right corner is the barrel jack where the power will be connected.  Going clockwise, the black box below the jack is a 5v regulated supply.  It will take the 12 - 24 volt input power and step it down to a constant 5v to power the Arduino.  There is probably a simpler way to do that, but it was pretty cheap.  In the middle is the Arduino Nano, which will receive signals from the Hall sensors and programmatically control the Cytron dual motor driver board which left of the Arduino.  When signalled by the Arduino, it will drive either of the solenoids with PWM DC voltage up to 30 volts and 13 amps.  This board will rapidly switch power on and off to inductive loads without damage from voltage spikes, etc.

I still need to add a couple of potentiometers and a switch to provide input control for adjustment of timing, dwell, and mode of operation.  Then of course, I'll need to debug the whole thing to get it working right.  Might take a while, but the joy is in journey, right?

Chuck
So many projects, so little time...

Offline b.lindsey

  • Global Moderator
  • Full Member
  • *****
  • Posts: 13860
  • Dallas, NC, USA
    • Workbench-Miniatures
Re: Another Solenoid Engine
« Reply #8 on: May 21, 2018, 01:16:50 AM »
I don't pretend to understand all this Chuck, but it is impressive to say the least. Following along to see how it works.

Bill

Offline Craig DeShong

  • Full Member
  • ****
  • Posts: 1293
  • Raleigh, NC. USA
Re: Another Solenoid Engine
« Reply #9 on: May 25, 2018, 07:21:37 PM »
I have a friend who is a retired process control engineer and electronic wizard.  I'm afraid to show him this thread, lest he goad me into building the mechnical part so he could diddle with the electronics. :ROFL:
Craig
The destination motivates us toward excellence, the journey entertains us, and along the way we meet so many interesting people.

Offline cfellows

  • Rest In Peace
  • Full Member
  • *
  • Posts: 1700
Re: Another Solenoid Engine
« Reply #10 on: May 25, 2018, 08:15:09 PM »
I decided to use prepackaged components, the motor controller and the 5-volt power supply, since there's less chance of error.  You could use discrete electronic parts, such as MOSETs to drive the solenoids and voltage regulator circuits to drive the Arduino. 

Chuck
So many projects, so little time...

Offline cfellows

  • Rest In Peace
  • Full Member
  • *
  • Posts: 1700
Re: Another Solenoid Engine
« Reply #11 on: May 26, 2018, 05:10:32 AM »
Got this thing running this evening.  I had a problem with a loose connection in the wiring which took me a while to track down.  Other than the connection, the wiring was all (miraculously) correct.  Then I had to go though a process of debugging the Arduino software to get it to run in 4 stroke mode.  That took me a good hour to figure out.  You'd never know I spent most of my career in computer programming.   :facepalm:

I still have to add the controls for timing, pulse duration, and 2 stroke vs 4 stroke mode.  The video has it running in 4 stroke mode at about 60% voltage.  The motor driver uses Pulse Width Modulation which is basically pulsed DC to alter the effective voltage.  Unfortunately, the PWM pulses are in the audio range, so you can here a slight whine whenever the solenoids are energized.  Once I get the controls installed, the driver will supply a steady 15 volts DC so the whine will go away.  I'll control the speed with the timing and the pulse duration.

<a href="https://www.youtube.com/watch?v=TYhLcXor8MY" target="_blank">http://www.youtube.com/watch?v=TYhLcXor8MY</a>

This is the Arduino program code if anyone is interested...

/*
 Electronic contol for Scotch Yoke Horizontal Twin Solenoid Engine

 Reads signals from Hall Sensors on engine crankshaft and turns on Cytron dual motor controller to drive solenoids
 at proper timing
*/

// constants won't change. They're used here to set pin numbers:
const int hallPin1 = 2;            // the number of the first hall effect sensor pin
const int hallPin2 = 3;            // the number of  the second hall effect sensor pin
const int SOLENOID1 =  9;     // the number of the first PWM pin to trigger Cylinder 1
const int SOLENOID2 = 10;     // the number of the second PWM pin to trigger Cylinder 2

// variables will change:
int valHall1 = 1;                   // holds the signal read from Hall sensor 1
int valHall2 = 1;                   // holds the signal read from Hall sensor 2
boolean revToggle = true;     // Toggles every other crankshaft revolution for 4 stroke operation
int pwmOut = 150;              // PWM value to be sent to MOSFET gates.  0=off, 255=full on

// Setup section gets executed once when Arduino is first powered up
void setup() {
  pinMode( SOLENOID1, OUTPUT );                         // PWM output signal pin to motor controller solenoid 1
  pinMode( SOLENOID2, OUTPUT );                         // PWM output signal pin to motor controller solenoid 2     
  // initialize the hall effect sensor pins as an input:
  pinMode( hallPin1, INPUT_PULLUP );                     // Input pin for Hall sensor 1
  pinMode( hallPin2, INPUT_PULLUP );                     // input pin for Hall sensor 2
  analogWrite(SOLENOID1,0);                                 // Initialize both solenoids to off
  analogWrite(SOLENOID2,0);
}

// The loop section gets executed repeatedly, once for each revolution of the flywheel, as long as power is on
void loop(){
  revToggle = !revToggle;                                        // This variable is used to toggle on and off for 4 stroke operation
  do {
    valHall1 = digitalRead( hallPin1 );                        // Loop while we wait for signal from Hall sensor 1
  } while( valHall1 ); 
  analogWrite( SOLENOID2, 0 );                               // Turn off solenoid2 since it is at bottom dead center
  if( revToggle ) {                                                    // If toggle is on,
    analogWrite( SOLENOID1, 150 );                         //   turn on solenoid 1
  }
  do {                                                                     // Loop while we wait fo signal from Hall sensor 2
    valHall2 = digitalRead( hallPin2 );
  } while( valHall2 );
  analogWrite( SOLENOID1, 0 );                                // Turn off solenoid 1
  if( revToggle ) {                                                     // If toggle is on,
    analogWrite( SOLENOID2, 150 );                          //   turn on solenoid 2
  }
 }
« Last Edit: May 26, 2018, 05:56:02 AM by cfellows »
So many projects, so little time...

Offline 10KPete

  • Full Member
  • ****
  • Posts: 1606
  • Nordland, WA, USA
Re: Another Solenoid Engine
« Reply #12 on: May 26, 2018, 05:26:39 AM »
Whooeeee! That is really something, Chuck! You nailed that sound and I want to hear the 2 cyl.

You totally lost me on the electronic controls but I do understand the concepts.

Great work.

Pete
Craftsman, Tinkerer, Curious Person.
Retired, finally!
SB 10K lathe, Benchmaster mill. And stuff.

Offline rudydubya

  • Full Member
  • ****
  • Posts: 290
  • Western Arkansas USA
Re: Another Solenoid Engine
« Reply #13 on: May 26, 2018, 07:28:19 AM »
Well done, Chuck.  Smooth running and nice sound.  I've always enjoyed following your projects.

Regards,
Rudy

Offline MJM460

  • Full Member
  • ****
  • Posts: 1648
  • Melbourne, Australia
Re: Another Solenoid Engine
« Reply #14 on: May 26, 2018, 09:12:45 AM »
Hi Chuck,  I am another following keenly.  A great model, running well.  Thanks for posting the Arduino programme, your background really shows in the annotations and showing me how to do it.  I have done more with Picaxe, but my lack of annotations make the programmes very hard to read after a long gap.  But the presentation for both has many similarities.  I have also tried to help my grandson with Arduino.  Really fascinating capabilities.

Looking forward to seeing how you modify the program to get that variable timing.  Will it scale with engine speed, or are you thinking fixed timing?

MJM460
The more I learn, the more I find that I still have to learn!

 

SimplePortal 2.3.5 © 2008-2012, SimplePortal