Exodus 7: God Hardens Hearts?

God proclaimed Moses as a god to Pharaoh. Moses and Aaron would tell Pharaoh God’s commands but Pharaoh’s heart would be hardened. When they confront Pharaoh, Aaron throws his staff before him which becomes a snake to which he calls on his ministers to do the same. Then Pharaoh is confronted with the Nile river turning to blood and when his ministers do the same, he refuses to allow the Israelites to leave Egypt. And the Egyptians suffered for a week.


Moses was a god. At least he received commands from God which gave him more power than the so called god of Egypt, Pharaoh.

When Moses staff turns into a snake, so did the minister’s or sorcerer’s of Pharaohs staffs. They could of done this by one of two processes; either they truly used some magic or they used a trick. They did the same with making the water turn to blood, or at least blood colored. The interesting thing is that these are relatively easy to use deception or slight-of-hand whereas the later miracles would be much more difficult to replicate: fleas, night, etc. In both cases, Pharaoh sees that his ministers can perform the same magic and so he hardens his heart.

Does or would God harden my heart against my will? There does not seem to be an example of anyone in the Bible who unwillingly let God harden their hearts. If we want to harden our heart, to seek our own will, God will let us – and He may even use that opportunity to accomplish His will. I believe I am safe from a hardened heart until I choose to do so. Father, please strengthen me against the wiles of Satan and the evil or useless desires of my own heart.

Posted in Christianity, Jesus Christ, Judaism, religion, sprituality, theology | Tagged , , , , , | Leave a comment

Self Balancing Gyroscope Two Wheeler

Free Ebook: here is my free ebook describing how to construct this two wheeler. Includes problems, solutions, suggestions, photos, and code.

This latest 2.7 version includes Chapter 10 on my latest version #4 vehicle with horizontal axis rotor that is starting to work pretty well. Also I have included my latest Arduino Uno code in chapter 9 with a simplified Proportional Bang-bang algorithm that works better than the previous code and allows for scaling with a faster processor than the Arduino Uno if one is available. (NOTE: faster processor probably not needed as this one is using a 10 millisecond delay in the main loop.)

Spreadsheet to calculate gyroscope vehicle parms: (NOTE: you can only view this spreadsheet but the formulas are shown at the bottom so you can create your own.)

Newest version #4 – have decided to go with this rotor orientation as it allows left and right turns.
Version #2 with new chassis, fork style steering which gets rid of balancing problems caused by turning. 3 lipo batteries – one for Arduino and gimbal motor , one for gyro rotor motor and one for RC receiver and powered rear wheel.

Self Balancing Gyroscope Two Wheeler with new 720gram rotor (version #3)

Here is my latest self balancing vehicle – it is an inline two wheeler using a mechanical gyroscope with active servo control of the gimbal. Took me a long time to get here but very satisfied that it works considering the haphazard construction techniques.

Weight of gyro rotor to Weight of vehicle is: .358g / 1.8 kg = 19.9% at 4000 rpm. It can be a little less than this before vehicle falls over. NOTE: now upgraded to 700 gram rotor, 100mm by 30mm.

Here is a link to an excellent document (pdf) to explain how to build a self balance a vehicle with a mechanical gyroscope by Mori, Hiroshi : https://thebbb.net/free/theories-and-experiments-for-gyro-monorails.pdf


Latest vehicle Version #4 with horizontal axis rotor – allows left and right vehicle turns.
Latest Version #4 doing left and right turns and radio control integrated with Arduino.

Update Oct 23: Taking a step backwards and using a servo controlled counterweight to help with the balancing and during turns. With a single gyro, you need something to help in the turns, either turn the gyro gimbal or use a counterweight. I also found a mistake in the code that causes the motorPower to stay on too long if the gyro is far out of balance.

Update Oct 21: To turn sharply, the gyro must be turned in the direction of the turn OR a counterweight must shift in the direction of the turn. So, I put a servo with a counterweight on the vehicle and manipulated it during the balancing and it definitely smoothed out the balancing. So will incorporate the counterweight with my program to see if it will automatically smooth out the balancing, help with disturbances and help during sharp turns. Always something new to experiment with.

Update Oct 18: I am at an impasse. I went back to RC separately controlling drive wheel and steering. The vehicle still cannot make fast turns because the algorithm does not react quickly enough to correct the gimbal imbalance. Guess I will stop here for a while and work on other projects. I assume now that a serious self-balancing vehicle should have two gyroscopes, preferably in vertical axis orientation so that it instantly reacts to an imbalance. I do not want to go that route. I like the idea of a single gyroscope.

Update Oct 12: Had more pin conflicts and rewired my motor driver again. But still no joy. Going to have to try taking out one of my pin interrupt routines and do the vehicle drive motor with the RC gear and not the VHN5019 motor driver. This driver uses two PWM pins but then conflicts with Timer0, and Timer2 and causes crazy erratic behavior. Will take some time off from this project as it consumes too much of my time and is interfering with family business. This kind of project is definitely for experimenters and tinkerers who can solve their own problems. But it definitely shows that the gyro effect is fickle and hard to control – thus the failure of Lit Motors C-1 self-balancing motorcycle, the ThrustCycle and the Gyro-X car.

Update Oct 6: Gone on vacation for couple of weeks.

Have decided to use PID controller and it works pretty good, is simple to implement and it scales with changes in gyroscope RPM. Wired up 2200mah battery. Have implemented interrupt controls for RC TX and RX and they work well. Had to rewire motor controller PIN 2 to PIN 13 so that I could use 2 for the RC interrupt.

Ready to test vehicle with battery power.

Update Sep 5: All hardware is working now with 540 gimbal motor. But programming has stalled a bit. Going back to bang-bang algorithm as that seems to work best and is simplest. Just need to tune it but going on vacation for a few weeks so won’t get to work on it for a while.

Also I am able to use the RC controls and kick the vehicle up from resting on it’s side to a balanced position. That is pretty cool. Also using RC transmitter I can easily balance the vehicle so I know it is possible. Just need to get my algorithm to do what I do. The bang bang is working but it still wobbles a bit but can handle disturbances pretty well. Hope that tuning is all that is required.

Update Sep 1: Found out that pulseIn() function used to get RC RX channels for steering and throttle are very inefficient and add 60 millis to the loop and cause balance routine to almost fail so had to use interrupts on pins 2 and 3 and use my own functions to get loop time back down to 4 millis. Only tricky thing I had to do was cut a trace wire on the VNH5019 driver shield for pin 2 and solder wire to reroute to pin 13 so that I could use pin 2 to attach an interrupt to read pulses for throttle (channel 3 on RC receiver.) Was afraid it wouldn’t work but it works great. Hope this is all the surprises I will have now.

Still waiting for 2200mah battery to test vehicle.

Update Aug 31: The 540 gimbal motor is defintely powerful. I have implemented a routine to stand the vehicle upright from leaning on it’s side by quickly moving the gyro gimbal and then switch to self-balancing mode. Using channel 5 on my rc transmitter to kick the vehicle up and switch it off to switch over to self-balancing mode. I tried this with the 385 motor at full power and it did not generate enough torque to pick the vehicle up so a stronger gimbal motor would be required to balance the vehicle in the event of a powerful disturbance or a sharp turn. The 540 motor is powerful enough for those events.

Waiting on 16 gauge wire and a 2200mah battery for the vehicle as an 800mah battery does not provide enough current to balance the gyroscope well. (Also found that pulseIn() function was adding 60millis to main loop so of course it would not balance well.)

Update Aug 27: I was making this harder than necessary – I have changed to a Proportional (P of PID controller) bang-bang algorithm and it captures the rotor better on disturbances. Have implemented a PID routine to calculate motorPower, then turn motor on proportionally as long as it is not inside deadband.

Had to limit the 540 gimbal motor to 0 to 150 motorPower as it draws too many amps if the motor is stalled for more than a few seconds and the motor and wires get too hot (did melt some wires the first time I tried it so had to up the wire gauge.) The 150 is conservative and I have set it as high as 225 but will try to keep it lower to keep motor cool.

Update Aug 25: It looks like the 540 gimbal motor is a winner – it balances at neutral point pretty well but has plenty of torque to capture rotor if it is far from neutral point (target or setpoint). Just need to work on programming for it now to tune it up. 550 motor just had too much cogging and the amp draw was too high – 20 + amps if stalled. The 540 has about half that much draw and less cogging. So, 540 motor with VHN5019 driver seems to be a winning combination. Finally. Tested so many motors and drivers. Also, wiring is vastly simplified as the VHN5019 is a shield that plugs into the Arduino Uno and then I have a servo shield that plugs into the VHN5019. And, the VHN5019 can supply voltage to the Arduino Uno so only two batteries required to run the whole vehicle.

Update Aug 18: Got 550 working with VHN5019 driver – unfortunately the 550 is so massive that it cannot smoothly control the gimbal so it moves very jerkily – the rotor is just too large to change directions smoothly. It balances but not well so have two other options: 540 or 545 motor which is about half as massive or I can try two 370 motors side by side on the same gear – twice the torque. That is about all the options I can think of short of designing a new servo mechanism which I just can’t seem to figure out.

Update Aug 17: I tried out the 550 motor and melted the power wires because it draws so many amps (up to 85). So tried a geared JGA252430 motor that uses only two wires (plus two power wires) and has an internal motor driver. It is working but not sure how long it will last as it gets warm. So will test this motor for a while and if it doesn’t work, go back to trying the 550 (or a 540 that has half the amp draw) with heavier wiring.

There has just go to be a better design for a gimbal motor but I can’t imagine what it would be. Will have to work on that if these two motors fail to help.

Update Aug 15: Finally got VNH5019 motor controller working with 385 motor. It is an Arduino shield so plugs right into Arduino Uno – easy to configure. Have servo shield on top of it. Gets rid of a lot of wires. Since it can handle 12 amps per channel – next item is to replace 385 with 550 motor to get some real gimbal torque. So L298N handles 2 amp motors but loses voltage to heat. A4950 handles a little less than 2 amps but no heat so delivers a few more volts to motor but cannot drive 550 motor. VNH5019 handles 12 amps – shouldn’t have to go any higher than this. Took a lot of fiddling to get each of the motor drivers to work. I also tried a VNH2SP30 which handles 7 amps but guess I got a defective one because it would only drive one motor in one direction. So have tried 4 motor drivers and the VNH5019, though a few dollars more, is clearly the champ. Plus it can supply voltage to the Arduino Uno if you want.

I tried the 390 motor and it will not work as a gimbal motor because it cogs, way too much resistance.

Update Aug 12: The 370 gimbal motor will balance the vehicle within about 5 degrees from vertical, the 385 motor will balance within about 10 degrees and hopefully, the next size up motor (either 390 or 550) will balance within about 20 degrees where frame is almost touching the ground. Currently with the 385 and the A4950 controller, it can pick the vehicle up off the ground but not quite balance it again. Hopefully with the next motor/controller it will have the power to pick the vehicle up from the ground (about a 20 degree angle) and stabilize it.

I tried a new motor driver, the A4950 (2amp max) and it helps a lot but still cannot correct a gimbal that is very far from centered and the largest motor it will control is the 385 – perhaps a 390. I then tried the VNH2SP30 (7amp max) which would have run the 550 motor but it was defective. So have ordered a VNH5019 (12 amp max) ($7) motor driver and hopefully it will work to control a very off centered gimbal.

I also implemented some code to use milliseconds timer to get rid of awful delay() statement so that I can process some other things while waiting for the gimbal to finish moving. Very useful.

At some point I should implement the PID controller again to get a smoother balance. Right now it is basically just a P controller.

Tried the 390 motor but it won’t work because it cogs so badly – cannot easily turn it’s axle with your fingers – too much drag. So going to go with the 550 which I have already built the gear works for – just waiting on a bigger motor driver.

Update Aug 9: I replaced the L298N motor driver with an A4950 and wow, it almost doubles the torque. Haven’t got it tuned yet but it works so far. Looking forward to see if it controls the gimbal with more authority. I tested the torque on a 390 motor and the A4950 provides almost twice the torque as the L298N. Plus it only requires two wires per motor compared to the L298N which requires 3 for each motor. And it is cheap too. The only downside is that the driver cannot provide power for the Arduino so I will need a separate battery for the Arduino. Not a big deal.

The A4950 will not work with the 550 though (the 390 seems about the largest motor it will work with), so I have ordered yet another motor driver, the VNH3SP30 which will provide up to 7amps per channel. This is another 3 wire per motor driver but that is ok. Won’t try this one until I have worked out the A4950 to see how effective it is. Hopefully one of these drivers will allow the gyrocar to make faster turns.

Update Aug 2: I measured the ampere draw of various motors for the gimbal control using a 2 amp power supply. Note: the stall amp figures will not be accurate if using a greater than 2 amp power supply. I used a 7 amp power supply and for a 540 motor the stall amps went up to around 13 amps. I had to limit the power I used on the motor to keep the stall amps down. (went from 0-255 motorPower to 0-180).

Motor size stall amp (held shaft) no load amp draw 280 .20 .01 too small 370 .22 .01 barely works 380 1.87 1.0 won’t work 385 .7 ?? works 390 1.33 .18 won’t work – cogs 550 1.87 .86 wont work with L298N

Now will order A4950 motor driver to see if the added voltage and amps will make gimbal motor more effective. Also will test 550 motor with it as I really want a more powerful gimbal motor. I am accumulating quite a collection of motors.

Update Jul 30: Decided to integrate radio controls directly into Arduino. The added benefit of doing this is that I do not need wheel encoders to see if the vehicle is moving forward or backward or if it is turning. Now will work on programming to see if I can turn the rotor during vehicle turns so it can turn faster. But if I stopped now I have basically succeeded in my goals.

Update Jul 29: Was “driving” my gyro vehicle and noticed interesting behavior – if I turn slowly during forward or backward motion, the gimbal motor is able to keep up and adjust the balance of the gyroscope to keep the vehicle balanced. But if I turn quickly, the gyroscope wants to stay in the same orientation but because the vehicle is turning, it applies a torque to the gyroscope and therefore might fall over; the gimbal motor cannot make an adjustment in time. So this is why the GyroX car turns the gyroscope when the vehicle turns – to keep the gyroscope oriented with the direction of the car. What this means is that I need two additional sensors – a potentiometer attached to the steering to sense when the vehicle is turning and a wheel encoder (or two) attached to one of the wheels to know if the vehicle is in forward or backward motion. This is what happens when you keep developing a self-balancing vehicle – it just keeps getting more and more complex to account for different forces acting on the gyroscope. This is probably why the Lit Motors Inc., C-1 self balancing motorcycle failed – they had over 30 sensors on their machine – a logistical and programming nightmare.

Update Jul 27: Installed new 385 gimbal motor. Has twice the torque of the 370 and works much better as it restores from disturbance better. Need to tune it some more. Will try using pulleys next to see if it smooths out linkage.

Update Jul 25: Decided to try LQR type of algorithm and it really, really smooths out the gyroscope. Still oscillates from side to side but does it less than with the IF-THEN conditional statements I was using. Like a PID but easier to implement.

P = (.08 * gimbalError) + (.5 * velP); // fraction of error and velocity of gimbal
powerTime = 30 * sq(P); // gradual curve up
delayValue = P * 10; // need formula as should curve down

Cool! Waiting on new more powerful gimbal motors as this 370 is maxed out when the rotor gets far away from setpoint.

Update Jul 22: Waiting on parts to convert geared gimbal to belt and pulley drive. Here is photo of new 5 mm axle (on the right) I had to install on gimbal to hold the large pulley. I epoxied the axle into the aluminum right angle piece. Love epoxy, use it for everything.

Gimbal motor is still under-powered but I figured out how to double the 370 motor power. That will be my next project after I finish installing the belt and pulley gimbal drive.

Update Jul 14: With the new orientation it does turn right and left now but still sometimes falls over: just realized a problem with Arduino microprocessor – if the gimbal motor is on for 50 milliseconds but the rotor has passed the zero or set-point – it has no way to turn off until the 50 millisecond cycle is finished and then it has to correct itself in the other direction. In other words, the gimbal will always be oscillating around the set-point because it has no way to shut off the motorPower cycle mid-cycle. So more programming required.

Second thing I realized: as the rotor gets farther away from the zero or setpoint, the motor needs more power to make a correction and since it is at full power it has to run longer (500 milliseconds). But this 370 motor just does not have the torque to make a quick correction so really need a bigger gimbal motor – the problem is that bigger motors have more cogging and this resistance or friction will cause the gyro to fall over. So two big problems to take care of: programming and search for bigger motor.

Next step: going to go with pulleys instead of gears to control gimbal. Much simpler and won’t run into torque changes caused by extreme angles on the gear/lever linkage. When gimbal is at its extreme angles, it loses balance quickly and the levers don’t have a lot of force. Found some 6:1 ratio pulleys that should work great.

Update Jul 11: Decided to play with it some more and go with #4 version (see picture below) with horizontal axis rotor as that is the only one that will allow left and right turns. I am getting it to stay balanced now and will play with program to increase speed of the algorithm. Gyro is same top-heavy (now side heavy) as last working with version #3 and vertical rotor axis. Just needs more dramatic correction if out of balance and definitely keep it away from extreme out of balance angles.

Update Jul 4: I have decided to stop working on self-balancing gyroscopes – six years is long enough, I have discovered the host of problems you must contend with, that the levels of complexity have no end and I feel that at my age of 66 years, I have more important things to spend my time on. It was fun, interesting, both satisfying and frustrating. I will continue to work on bettering the gimbal servo mechanism because that still interests me and I will document another chapter in my pdf book on the subject of gimbal orientation and then I will mostly escape this rabbit hole to perhaps find another one in some other field. I like to write and am currently working on AI subject short stories.

To anyone who pursues this topic – note that there are no easy solutions but I wish you good luck and good hunting and hope you will share your findings with me.

Update Jul 2: Wow, live and learn. There are two ways to mount the rotor in a gyroscope, with the rotor axis vertical or horizontal. There are pros and cons with both. Horizontal rotor axis: This allows a vehicle to make right and left turns without the rotor falling over. This is why the newly rebuilt GyroX car uses a horizontal axis even though the gyroscope was made by a boat gyrostabilizer company that normally uses a vertical axis rotor. The problem is that there is no natural precession to center the gyro in a zero degree balanced position. Also, this orientation requires more gimbal response time and power so your level of programming and mechanics goes up. Vertical rotor axis: This allows a vehicle to use natural precession to center the gyro in a zero degree balanced position, and less gimbal motor power required. Unfortunately, if the rotor is spinning clockwise, then the rotor will fall over in a right hand turn, though left turns are just fine.

Guess I will try using a horizontal rotor axis. I have already gotten this working but it loses it’s balance after a while and I am not sure why that is. I think I need to use a different program that does not rely on precession but rather just keeps adjusting the gimbal as close to the setpoint or zero position as possible. Update: I believe the rotor side must be heavier than the motor side as I discovered this when I built this side mounted gyroscope: https://www.instructables.com/id/Make-a-Self-Balancing-Gyroscope/ ) I am forgetting what I have already learned in the past. Will now modify version #4 to see if it balances better with a heavier rotor side (Note: heavier rotor side did not help.)

Update Jun 29: have mounted gyroscope on rotating bearing, hooked up a standard servo to rotate the bearing and tested it with my RC transmitter and it balances even if the bearing is rotated a few degrees in either direction. Will now set up the servo to synchronize with the steering servo and then remount the wheels to the vehicle frame and try it out to see if it helps on left forward turns. Will probably not help with rear right turns as it will turn the bearing in the wrong direction. That is why I think the GyroX car cannot make right rear turns because the gyroscope will fall over. Update: the bearing does not help at all.

Update Jun 27: Solved two previous problems. Just played with repositioning rotor on motor shaft until I got least amount of vibration. About the best I can do. Tried the dynamic balancing but it is dangerous and doesn’t work very well. #2 problem I wrote a subroutine to increase motor speed based on how fast the gimbal is turning. Work great and rotor is very stable at high rpm and always catches itself before it tumbles when disturbed. Will make a new video of that routine at work then install rotating gimbal.

Here is subroutine:

void doVelocityGimbal() {
// every so many milliseconds, check rotation velocity of gimbal, if fast then increase P, if slow then decrease P

if(velCurrentMillis – velPreviousMillis > 300) {
velElapsedTime = velCurrentMillis – velPreviousMillis;
velSpeed = (abs(gimbalAngle – velPrevGimbalAngle));
velSpeed = velSpeed / velElapsedTime;
if (velSpeed > .005) {velP = .2;} // fast so increase P to stop gimbal torque faster
else {velP = 0;} // slow so decreaase P to let gimbal stay in this area
Serial.print(“velElapsedTime= “);Serial.println(velElapsedTime);
Serial.print(“gimbalAngle= “);Serial.println(gimbalAngle);
Serial.print(“velPrevGimbalAngle= “);Serial.println(velPrevGimbalAngle);
Serial.print(“velSpeed = “);Serial.println(velSpeed);
Serial.print(“velP= “);Serial.println(velP);
velPreviousMillis = velCurrentMillis;
velPrevGimbalAngle = gimbalAngle;

Update Jun 18: got two problems I have to deal with now: #1. vibration of the rotor coming I think from the poor fit of the shaft adapter to the motor shaft – sometimes it is smooth and sometimes terrible vibration. Will have to try a dynamic balancing contraption that I will build using some small bearings and a couple of bottle tops. #2: the gyroscope goes out of balance after a while. I need to optimize the code but will fix the vibration problem first as it is so loud it vibrates the table and probably the neighbors ceiling. So this is going to take a while. No hurry I guess. Have to get both problems addressed before moving on to the rotating gimbal.

Update June 16: Above is video of new rotor. This will be version #3 of my self-balancing vehicle using a new 720 gram aluminum rotor. Much smoother operation. Need to modify program parameters to control it as the gimbal motor is just barely balancing it with the parameters used for a rotor half of this ones mass. Was able to use most of previous motor/gimbal mount.

Update June 14: Got my new rotor which is twice the thickness of the old rotor. Shaft hole is a tiny bit larger as the machinist could not promise 5.01 mm so it is probably 5.04 but better than the old 5.1 which was a really loose and sloppy fit. Very heavy, 700 grams. Balance point is at lower edge of rotor so have to build new gimbal mount. Going to take a while. Hope it will not wear out motor bearings too quickly. This rotor will produce a lot of torque and hopefully enough to allow me to use the gimbal rotating bearing to counteract left turn fall overs.

Got new rotor mounted and it balances pretty nicely. Next, test gimbal motor with it and modify code to account for more torque needed to control gimbal.

New self balancing gyroscope rotor

Update June 8: Haven’t done anything on this project until today: found a CNC machinest to make me a new rotor, 1000mm by 30mm, twice as heavy as my first one. With this one I should be able to put back in my rotating gimbal and test left turns. Cost 130rmb (about $20).

Update April 21: I have balanced the stripped down vehicle #2 (no steering or power wheels or batteries and weighs 1.5kg) at 1850 rpm. This is the minimum it will balance at so ratio of rotor to vehicle weight is: 24% which is what my fully equiped vehicle with a new 720gram rotor would be. I think it needs to be at that ratio to balance well like Schilkovski’s gyrocar. Also at version 2.1 of my book.

Update April 15: I stripped the vehicle down to just the gyroscope and gimbal controller and did an experiment where I started out at high CG of 13 cm from ground and then lowered by about 1 cm at a time down to 2 cm from ground. Definitely the gyro gets more stable the lower you go, especially when recovering from disturbances. It won’t balance at all at 13 or 14 cm. 2800 rpm throughout the experiment. See following video:

Component and wiring schematic:

Self Balancing Gyroscopic Vehicle Schematic

Update April 14: I stripped the steering and rear wheel off to get weight down to 1.5 kgs. Then I am using two chop sticks as the “wheels” to see the effect of different heights of CG from the ground. Started at 10cm off the ground and it would not balance at 2800rpm. Dropped to 9cm and it balances. The lower I go the better balance. Went down to 2cm and is treats disturbances better the lower it goes. So now need a new rotor before I can really do anything else.

At 1.5kgs it balances quite well and takes disturbances better. At 2.5kgs (with steering and power gear) disturbances cause it to become unstable. Really need a heavier rotor but cannot find a machinest here in china for the job. The only other alternative is to programmatically fix it.

Found C-1 patent that shows how to calculate how much torque required to return 30 degree angle to vertical. Will have to do that someday. https://patents.justia.com/patent/9273961#description

Update April 7: Was driving the gyrocar today and noticed, it falls on sharp left turns (gyroscope spins to the left) but ALSO falls making turns in reverse to the right. It is fine on forward right turns and backward left turns. Interesting but not surprising.

Also I think I am at the limit of balance and really need a larger rotor for more vehicle balance control. I can also try increasing program parameters for operation at high rpm to correct imbalance. Am trying to find a machinest for a new rotor with twice the mass (360 to 720 grams) but don’t know when that will happen so am trying to improve operation programmatically.

The nice thing is that I can now balance at 3000 rpm with the electronic gimbal controls but with the controls turned off, it will not balance at all. So I do have some control. Wish I could figure out a better algorithm than the sector programming I am currently using as it seems limiting.

Update April 4: I measured the minimum rpm to balance the vehicle and using gyroscopes.org/math online calculator, I determined the following:

360 gram rotor @ 2000 rpm = 580 grams of torque = 580g/2000g (wt of vehicle) = 29% (fails to balance)

360 gram rotor @ 2700rpm = 785 grams of torque = 785/2000g = 39% (balances)

So, it takes about at 40% ratio to balance this vehicle

Update Mar 28: The biggest problem with single rotor gyroscopic vehicles – turning. I wondered why the vehicle turns so nice and sharp to the right but will fall over if I turn very quickly to the left and I think I have figured it out. If you turn in the same direction as the precession ( which in this case is to the left since the gyroscope is spinning to the left or counter-clockwise) and you turn faster than the precession rate then the gyroscope will fall over. So, how to prevent that?

  1. You can prevent it by turning the entire gyroscope to the left at the same speed as you make the turn and then there will be no loss of precession. But this is a lot of work as it means you need another gimbal on the gyroscope and a control mechanism to turn the gimbal when steering to the left. I was going to do this one and had built a bearing into the gyroscope frame but the bearing weighed so much that my vehicle would not balance well. Will come back to this when I get a larger rotor.
  2. Another way to cope with it is to speed up the rpm of the gyroscope rotor. But that requires hooking your gyroscope rotor up to the microprocessor – a lot of work and it probably still wont work as you cannot increase the rpm very quickly.
  3. I’m not sure this way will help but you might tilt the rotor forward during a left turn to roll the vehicle to compensate for the turn. I will try this method first.

Update Mar 25: rebuilt gyro vehicle on new chassis but didn’t balance very well – oscillating terribly. So took off 400 gram circular bearing and still does not balance well. Two potential problems: 1. Using soft wheels that are slightly flat creates a side force. But don’t think that is it. 2. Lowering the axis of the gimbal too low robs the gyro of power for side to side torque. Like an inverted pendulum, it needs to be higher to exert less force to balance but not too high. Too low takes more torque to correct imbalance. Too low = less force required but higher speed. Too high = more force but less speed to correct. So need a balance between the two. Guess I have to raise the gyro until I can get a heavier gyro rotor. NOTE: took care of this by changing program parms.

On the note of the gyro material: steel is 2.5 times as dense as aluminum, and brass is 2 to 3 times as dense as aluminum. Aluminum is poor choice for rotor unless you don’t care how big the dimensions are.

Update Mar 20: Built new chassis and added gyro to it – worked but very rough balance. Then discovered that by lowering powerTime variable then it smooths out corrections fantastically. Went from value of 50 to 5. Now nice and smooth corrections. This makes sense as I lowered the CG of the gyro and therefore it requires less corrective force. At 50 I was over-correcting.

Calculated that 16% rotor to total weight is minimum I can balance with.

Todo: 1. add servo to move gimbal bearing.

2. add steering gear.

Update Mar 18: New frame with circular bearing so that I can turn the gyroscope when the vehicle turns.

New chassis incorporating rotating bearing for gyro to be used during turns of vehicle. Tried it and it would not balance well enough to test it because weight ballooned up to 3kgs and the 360g rotor was just too small to work well. So, waiting on new 720g rotor to continue this experiment.

Update Feb 28: put batteries and steering gear on new chassis, and had to retune parameters to get it balancing again. Then made following vide. Left and right turns. Now need to wait on getting final parts to build final version where I will turn the gyroscope with the steering to make turns better.

Update Feb 27: rebuilt the chassis to lower the center of mass closer to ground. It runs very smoothly even at low 3300 rpm. The lower the COM and lighter you can make the gyro vehicle has a huge effect on its performance.

Update Feb 26: build stilts to raise gyro platform from 10cm to floor, to 40cm to floor. Will not balance now even at 10,000 rpm. Makes sense as it acts like a long lever when falling over and this gives greater torque to gyroscope. Therefore it would require much larger rotor and/or higher rpm to counteract falling induced torque. So, the lower the CG of the gyro, the better. I plan to rebuild the chassis to lower the motor where it almost touches the ground – control should be even easier.

Update Feb 22: added a potentiometer to the steering servo to know when I turn so as to move balance point during turns to keep rotor balanced. First I added a wire to the steering servo potentiometer wiper and ran it and a ground to the Arduino but for some unknown reason it occassionally caused the servo to do erratic behavior so had to resort to an external pot that I stole from a standard servo and it works great. Now when it detects a turn I move the balance point forward or backward by 50 to keep the rotor balanced. Not perfect but much better than without it.

Next, take video of using the steering servo pot. Then a video of driving it with sharp left and right turns. Then try 540 sized motor to reduce voltage requirements. Will at some point need a 2000mah lipo as the 800mah runs dry in 5 minutes.

Self Balancing Gyrocar Steering Potentiometer Servo Linkage
potentiometer attached to steering servo

Update Feb 21: Added machine learning code to program to randomly choose some variable values in the program and measure the error over 100 cycles and keep the variable values that result in the least amount of error (balance point – actual gimbal angle). Works good.

Also added a wire to the steering servo to feed the angle of the servo to the Arduino and if a left or right turn then moves the balance point a corresponding amount to restore balance. Need to work some more on this as it rotor falls when quickly going back to neutral point.

Update Feb 17: Part 3.1 video: driving around. Good right turns, left turn is limited by mechanism that needs some work. Exponential moving average smoothing has really made the gyro stable. Replaced powered wheel AA batteries with 3s lipo battery and adjustable LM317 power supply. Now have lots of power. Also using two 3s lipos for Arduino Uno and to power gyroscope motor.

Update Feb 15: Plotting angle reading of gyro gimbal on serial plotter and it shows little spikes that I think may be due to sloppy gear linkage. Also used Exponential Moving Average smoothing routine that works well to get rid of spikes. Will make a new gear/motor mount at some point to see if spikes go away. Gyro balances nicely even at low 4000 rpm (6volts).

Plot should be sine wave but it goes up, comes back to center then down then back up. Not sure what is happening there but pretty erratic.

Got steering working by adding a standard servo. Will post video when I get vpn back.

Here is screen print of smoothing plot:

Using moving average smoothing of gyroscope potentiometer angle readings.

Update Feb 14,2020: Now balancing pretty well at 8000 to 10000 rpm. Even balances at 4000 rpm but wobbles quite a bit. Replaced wheels and front wheel is motorized and took video of going forward and backward. Unfortunately the AA batteries got depleted very quickly. So have ordered a rechargable lipo battery. Have added a standard servo to be used for steering.

Want to try a CG self-correcting routine to find optimum CG. Algorithm: for CG from 350 to 400; measure error for 1000 cycles; divide total result by 1000; keep lowest error.

Part 2 video: added powered wheel and rear wheel.

Video of first successful balancing (Part 1):


  • Arduino Uno
  • machined aluminum rotor , 360 grams, 10cm by 1.5cm (updated to 720 grams, 10 cm by 3 cm)
  • 550 12volt 18000(no load) dc motor
  • 370 motor for gimbal control (updated to 540 motor)
  • P3022 non-contact potentiometer (required for no friction and precision values)
  • yellow geared 110 rpm motor for mobility
  • L298N motor driver (must have heatsink) (updated to VNH5019 12 amp controller)
Posted in machine learning, Mechanical Gyroscopes, robots | Tagged , , | 15 Comments

Exodus 18: Moses Builds a Hierarchy of Judges

Jethro, a close relative, perhaps a brother-in-law or father-in-law, brings Moses’ wife and two sons to visit him. He comes from Midian.

When Jethro sees how tired and over-worked Moses is, he suggests, God willing, that Moses establish a system of authorities and judges to help him.


They are at “the mountain of God” at Horeb which is Mount Sinai or Mount Horeb and is probably present day Jebel al-Madhbah.

The number of assistant judges would have numbered in the many thousands so it is logical to assume that Moses and the people would have been tired; Moses from the sheer number of cases and the people from waiting in line.

God seems open to Jethro’s ideas. I am sure it wasn’t an idea that did not occur to God beforehand yet he allows a man to broach it to Moses. Jethro seems to be a holy man himself, familiar with sacrifice and Jehovah. Perhaps God inspired Jethro to the task. It is comforting to know that God can be questioned, prevailed upon, swayed, won over, argued with, and convinced. He is more a father than a dictator and though we make mistakes or take the long road, He works with us like recalcitrant and imperfect clay.

Not much is written about Moses wife and nothing after this event. She was a Midianite. Moses had another wife as well.

Posted in religion, sprituality, theology, Judaism | Tagged , , | Leave a comment

Exodus 17: Moses Beats a Rock and Fights the Amalekites

For the fourth time, the Israelites complain to Moses about water or food. God tells Moses to strike a rock from which water gushes out at Horeb. The site was named as the place where they tested God and complained.

The Amalekites came to fight the Israelites at Rephidim. Joshua led the army against them and won the fighting as long as Moses held his staff above his head. But he tired so Aaron and Hur helped hold the staff and the Israelites won the day.


It is interesting that a split rock has been found at Rephidim that shows evidence of water erosion. Local Bedouins call the rock “Moses’ Water”.

The Amalekites, who were descendants of Esau, were natural enemies of the Israelites and would plague them in the future until the time of Saul. Archeological evidence has been found in this area of large camps and fighting and inscriptions on rocks near the split rock site and altar stones.

Posted in Judaism, religion, sprituality, theology | Tagged , , , , , | Leave a comment

Exodus 16: Grumbling, Manna and Quail and the Sabbath Day

The Israelites traveled to the desert of Sin and they were hungry and complained to Moses that it was better in Egypt where they had plenty of food.

In the evening the ground was covered in quail. In the morning the ground was covered in manna which they only gathered as much as they could it because it would spoil latter in the day. Some tried to gather it when they were not supposed to or tried to keep it but it would spoil.

On the sixth day of the week they would gather two days worth as the seventh day became a day of rest for them.

Some of the manna was preserved in a jar for future generations to see.


Complaining was becoming par for the Israelites especially when it came to water and food. They never really seemed to get the message. It makes me a little cocky but I find myself doing the same thing – I look back on my life at how blessed I have been by God but when a hardship arises, the sky falls and I run around like a headless chicken, or I worry about a future tragedy that rarely comes to pass. The New Testament message for Christians is “one day at a time”. We humans want to plan out everything for our futures so that there is no possibility of want – but that takes away our reliance on God for our daily needs.

The Israelites may have eaten well in Egypt but they seem to have forgotten the harshness of their lives there.

There always seems to be some who don’t get the memo – they went out on the seventh day and low and behold, there was no manna to be found. Kind of like ignoring biblical injunctions and then being shocked at our dismal state of affairs.

The wilderness of Sin has nothing to do with sin.

Posted in religion, sprituality, theology, Judaism | Tagged , , , , | Leave a comment

Exodus 15: A Poem Praising God, A Promise to Bless Israel

Moses composed a poem praising God for His great defeat of the Egyptian army.

Mariam, the prophetess, sister of Aaron, and supposedly Moses, dances and sings and plays an instrument in celebration.

Moses leads his people through the desert of Shur to Marah where the water was bitter. After the people complained, Moses made the water sweet with a plant. God then promises to not treat them like He treated the Egyptians if they will only obey Him.

God leads them to an oasis at Elim.


This is supposedly the oldest poem in the world. It commemorates an event that obviously did not take place in a shallow sea of reeds.

Amazing that many of the geographical names of this area today relate to the Exodus or the events that happened then. Some believe that Howarah is the site of the bitter waters which are still spurned by the Arabs. Elim is assumed to be the oasis, Wady-Ghurandel. The number of springs (12) and palm trees (70) in Elim are sacred numbers.

There is no known plant that has the ability to make bitter water sweet. Miracle.

God is a man of war. The war is not just physical but spiritual.

Posted in Judaism, religion, son of God, sprituality, theology | Tagged , , , | Leave a comment

Exodus 14: Pharaoh Pursues and Israel Escapes

God tells Moses to assume a strategy of acting lost in the desert which will encourage Pharaoh to pursue them. Egypt was already regretting letting their slaves go so Pharaoh sent 600 chariots with soldiers after them. They cornered them between the desert and the sea and the Israelites began to complain to Moses that they would have been better off in Egypt than here in the desert about to die.

The pillar of smoke came between the Egyptians and the Israelites all day and night. During the night God caused a strong wind to part the sea. In the morning the Israelites crossed the sea on dry ground and the Egyptians went after them. When the Israelites were safe on the other side, God caused the seas to return to normal, thus covering and drowning Pharaoh’s army at the bottom of the Red Sea.

Finally the Israelite people began to see that Moses did have the hand of God on him.


The Israelites seem to already be showing their streak of stubbornness and obstinacy when they complain to Moses and this would be the beginning of a long habit that would tax the patience and forbearance of God. Though they did begin to see that Moses was truly the spokesman for God after the incredible miracle of the crossing of the Red Sea.

There is so much scholarly debate today on when or if and where did the Exodus take place. Many Biblical educated elites doubt that the Exodus even happened and if it did, explain away the miracle of the Red Sea crossing as a natural sand bar across a sea of reeds that anyone could have traversed. But there does seem to be excellent archeological and geographical evidence for the crossing at the Gulf of Aqaba at Nuweiba with coral formations in the likeness of chariots and chariot wheels, coral encrusted bone fragments found at a depth of 200 feet and memorial pillars on the coast-lines. The sea is a mile deep in places but at Nuweiba there is a natural underwater land bridge with gentle slopes from both beaches. The distance across the sea at this point is about 11 miles and the deepest point on the land bridge is about 2600 feet.

There will always be doubters and nay-sayers but the evidence seems compelling that something did happen at Nuweiba that corresponds extraordinarily accurately to the Biblical record.

Posted in religion, son of God, sprituality, theology, Uncategorized | Tagged , , , , , , , , | Leave a comment

Exodus 13: The Firstborn Males Belong to God

Moses tells the people they must honor what God has done for them through the annual celebration of the Passover and also that every first born male child and beast belongs to God. Curiously He also wants every firstborn male donkey redeemed by a lamb or else have it’s neck broken. This was symbolic of Pharaoh’s stubbornness and the killing of all Egyptian firstborns.

God then leads the people out of Egypt by a circuitous route away from the more common route near the Philistines. He leads them by a pillar of smoke by day and fire my night.

They took the bones of Joseph with them.


The donkey was an unclean animal and so had to be redeemed by a sacrificial lamb.

God was concerned that if the people traveled through Philistine territory, they may turn back to Egypt. Interesting that He would not compel them to leave Egypt – He always seems to entice them to leave through the miracles of the plagues and Moses and Aaron’s persuasions and reassurances.

It is interesting that the supposed tomb of Joseph in Egypt held no bones, as to be expected.

Posted in religion, son of God, sprituality, theology | Tagged , , , , , | Leave a comment

Exodus 12: The Beginning of the Passover and the Exodus

God told the people through Moses to sacrifice a lamb for each family on the 14th day of the month, take the blood and paint the doorposts with it, roast the lamb (sheep or goat) and eat it with unleavened bread and bitter herbs. They were to be packed and ready to go. This meal was to be the beginning of a memorial meal that only the Hebrews and their circumsized slaves could participate in.

Then at midnight, God slew all the first born in Egypt, both men and beasts. Pharaoh told the Israelites they could leave Egypt. So they left from Ramses to Succoth, numbering about 600,000 men plus their families, stock, gold, silver and clothing they received from the Egyptians. They had lived in Egypt for 430 years to the day.

The Passover meal was an ordinance from that night. The bones of the lamb were not to be broken.


The male lamb to be sacrificed was without a blemish (perfect) and the bones were not to be broken – prophetic symbols of the coming Christ sacrifice. It was also prophetic of the new Lord’s Supper to be initiated by Christ – unleavened bread and wine symbolic of the blood of Christ. Perhaps there is also some symbolic significance of the “gifts” of the Egyptians to the Hebrews and the gifts of the Magi to the new born Christ.

The number of Israelites could have been around 3 million. The 600,000 men did not count young men, women or children. They may have also taken slaves and even Egyptians who wanted to leave with them.

God said he would strike all the “gods” of Egypt and so he did through each of the ten plagues.

Posted in religion, son of God, sprituality, theology | Tagged , , , , , | Leave a comment

Exodus 11: The Last Plague

Moses is told by God of the final plague of the firstborn of the Egyptians in which God Himself would kill. There would be great crying and lamenting in Egypt that night but not a dog would bark among the Israelites. He also tells the Israelites to ask the Egyptians for gold and silver who looked on them with favor. Pharaoh was again warned of the impending event but still would not let the people go.


It seems only fair pay for employment that the Hebrews should receive gold and silver from the Egyptians. What is fair wage for slavery?

Egyptian historical records do not speak to any of these events – but then it is probably something they figured best forgotten. Shame, guilt and defeat are great motivators for rewriting history.

Even Pharaoh’s people now felt a respect for Moses that they seemingly have lost for their “god” Pharaoh who has been soundly beaten and who has seen his ministers and “gods” embarrassed and pummeled into submission.

Posted in religion, sprituality, theology | Tagged , , , , , , , , | Leave a comment

Exodus 10: Locusts and Darkness

God tells Moses to go to Pharaoh and tells him that a plague of grasshoppers is coming to which even Pharoah’s officials want him to give in and let the people go. Pharaoh wants to let only the men go so Moses brings on the plague of locust with a wind from the East. The locust eat every green thing in Egypt. Pharaoh tells Moses the people can go but then God hardens his heart and again he refuses to let them go.

God brings a plague of darkness on Egypt, except on the Israelites, for three days where they cannot see anything – so much so that they cannot even leave their beds.

Again, Pharaoh gives in but God hardens his heart. Pharaoh prophecies that he will never see Moses face again and Moses agrees that that is the truth.


This chapter makes it very apparent that it is God who is now hardening Pharaoh’s heart, though with or without Pharaoh’s voluntary participation. God wished to display all of these various plagues to show His power.

Locusts are grasshoppers that physically change through an environmental stimulus so that they travel and feed together. They are a super grasshopper. I wonder if perhaps the desertification of most of Egypt is a remnant of the hardness of Pharaoh’s heart so that he affected not only his people in his day but down through history to the present times.

Reader’s Digest and Science Magazine, among other publishers have offered explanations of the ten plagues that do not require a miraculous or theological cause such as the disturbance of the red clay of the Nile via flooding being interpreted as blood and causing the death of the all the fish leading to a disease that killed the frogs who were trying to escape the Nile as well. One can always assume these as completely natural and coincidental occurrences. Doubters can always find a reasonable defense.

The plague of darkness. Of course one cannot purport a solar eclipse as the sun would have had to stand still (or the spinning of the Earth) for three days. God had taken away the Egyptian’s sun god Ra. Is there a possible foreshadowing here of the three days of Jesus in the tomb? Can you imagine the fear that the Egyptians experienced as they may have easily assumed that they were struck blind for the remainder of their lives? Was this a form of living hell for them?

Every word of the Bible can be ascribed to men or to God. Satan is a master of deception and “wise men” can always supply a rational appeal to forsake a super-natural origin or cause. Father, help me to read these mechanistic explications without giving them credence or credibility. Faith in You is reason enough and if I do experience doubt, perhaps it is not my quantity of faith but the rather the fact that I have not studied the reasonable of the Biblical narrative in depth.

Posted in Jesus Christ, religion, son of God, sprituality, theology | Tagged , , , , | Leave a comment

Exodus 9: Pharaoh is Fickle

God warns Pharaoh and the people of Egypt of three more plagues, death of animals in the fields, boils, and hail. These plagues did not affect the Israelites. In each case, Pharaoh would begin to give in and then in the end harden his heart against God and Moses.


There is a seeming contradiction in that “all” the field animals were killed and then the next plague of boils affected man and beast and the next plague of hail killed all the beasts in the field. If the beasts in the fields were all killed then what beasts of the field could the plague of hail kill? Well, some of the Egyptians no doubt saved their livestock by gathering them from the fields before the plagues, perhaps they bought more, or perhaps only certain beasts were targeted in the former plague and different ones in the latter plague.

I think God in his wisdom, tests the faith even of the readers of these stories sometimes by not providing all the intricate and explanatory details so that seeming contradictions provide a convenient excuse for unbelievers to express their lack of faith. If God had provided a scientifically verifiable clarification for every miracle and story in the Bible, there would be no doubters. Obviously Pharaoh did not make an issue with all the beasts being killed in one plague and then wonder where did the beasts for the next plague come from. The writer of Exodus would have obviously seen the potential contradiction and yet did not provide a more satisfying illumination. Apparent contradictions are a lazy thinker’s way of rationalizing their doubt. Not the kind of people that God calls to be His.

Posted in Christianity, Jesus Christ, Judaism, sprituality, theology | Tagged , , , , , , , | Leave a comment