[solved] Strange potentiometer behaviour after AM 4.0 upgrade

Support for Arduino in combination with Air Manager and Air Player

Moderators: Ralph, russ

Message
Author
altack
Posts: 33
Joined: Mon Nov 21, 2016 1:13 pm

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#21 Post by altack » Fri Apr 30, 2021 7:06 pm

OK Corjan,
your Beta made my UNO card working much better than previously :D

I can now easily pass my simple test code and the LED is lighting up when I press the push-button.
I can also now manage the pin assignement (STEP and DIR) on the hardware properties window which is a great improvement !
Moreover the optical sensor is recognized and working, but, unfortunately, I can't make my 28BYJ-48 5V stepper motor react to the STEP and DIR inputs through an EasyDriver board.

Suspecting that the very first UNO flashing may have fried the EasyDriver board or the stepper motor (or both :o ), I tested on a brand new stepper motor/EasyDriver board spare combo but, so far, to no avail...

Is it possible to check on your side that UNO cards are driving stepper motors using latest flash code release ?

User avatar
Sling
Posts: 4423
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#22 Post by Sling » Fri Apr 30, 2021 11:22 pm

If this is the compass motor and code you asked about earlier you will need to alter the code as advised to get the motor running. Ignore if not.

User avatar
jph
Posts: 641
Joined: Fri Apr 10, 2020 12:50 pm
Location: Portugal

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#23 Post by jph » Sat May 01, 2021 11:27 am

altack wrote:
Fri Apr 30, 2021 7:06 pm
OK Corjan,
your Beta made my UNO card working much better than previously :D

I can now easily pass my simple test code and the LED is lighting up when I press the push-button.
I can also now manage the pin assignement (STEP and DIR) on the hardware properties window which is a great improvement !
Moreover the optical sensor is recognized and working, but, unfortunately, I can't make my 28BYJ-48 5V stepper motor react to the STEP and DIR inputs through an EasyDriver board.

Suspecting that the very first UNO flashing may have fried the EasyDriver board or the stepper motor (or both :o ), I tested on a brand new stepper motor/EasyDriver board spare combo but, so far, to no avail...

Is it possible to check on your side that UNO cards are driving stepper motors using latest flash code release ?
Check your connections to the easy driver. Also, if you ever unplug or plug in the stepper motor motor whilst the board is powered you WILL fry the board.
THE ONLY connections you should have to the ED board should be DIR and STEP, hence, there is no way the AM4 could 'fry' the board. - plugging in the stepper - or disconnecting will though.

Make sure you have the correct pins assigned to the step / dir pins in AM also.
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

altack
Posts: 33
Joined: Mon Nov 21, 2016 1:13 pm

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#24 Post by altack » Sat May 01, 2021 5:40 pm

jph wrote:
Sat May 01, 2021 11:27 am
Check your connections to the easy driver. Also, if you ever unplug or plug in the stepper motor motor whilst the board is powered you WILL fry the board.
THE ONLY connections you should have to the ED board should be DIR and STEP, hence, there is no way the AM4 could 'fry' the board. - plugging in the stepper - or disconnecting will though.

Make sure you have the correct pins assigned to the step / dir pins in AM also.
You are absolutely right and I made my homework: I disconnected everything and tested every single item !
I reflashed the UNO card with the standard Arduino IDE and a very simple testing code for an EasyDriver board and a stepper motor.
Then I checked all stepper motor I have as well as all EasyDriver boards (I've got about 5 pieces of each) and there is no hartdware malfunction ! :D

You can see by yourself on this short video I made this afternoon with my wet compass rig : https://youtu.be/C03DTyoga80

Now, when reconnected and reflashed through the AM 4.0 Beta Corjan gave me this is another story : my super simple "lighting LED" test is OK but there is no way for me to control the stepper motor even with just hw_stepper_motor_position(my_stepper, nil, "ENDLESS_CLOCKWISE") command...

I know Corjan and the team is working hard into debugging the 4.0 code so I will wait for his call otherwise I'll probably revert to AM 3.7.1 which was running just fine until last thursday...

User avatar
jph
Posts: 641
Joined: Fri Apr 10, 2020 12:50 pm
Location: Portugal

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#25 Post by jph » Sun May 02, 2021 7:49 am

Hi @altack
No worries, hope you get it sorted. Would be interested in the results.
I would also be very interested in seeing the arrangement you have for the optical / position sensor arrangement. Are you using infrared / beam break system ? or hall effect ?
Any images would be really good and I would be happy to add them to the hardware thread. Would be great info for others.
Joe
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

altack
Posts: 33
Joined: Mon Nov 21, 2016 1:13 pm

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#26 Post by altack » Sun May 02, 2021 12:59 pm

Hi Joe,

Unfortunately I didn’t make pictures when I built the wet compass but I can describe the process:

First I 3D printed this model from thingeverse ( https://www.thingiverse.com/thing:2297653).

Then I bought this optical endstop from Amazon ( https://www.amazon.fr/gp/product/B07PC ... UTF8&psc=1).
I had to desolder the white plastic cable connector (because it was protruding) so as to resolder it on the same side of the sensor on the board.

With a Dremel circular saw I then cut a 10mm slot on the top of 180° mark on the 3D printed compass card (actually the « S » mark ;) ).

By doing that, when the North is facing the rumb line on the compass face, the optical sensor triggers and gives a signal to the Arduino associated pin (one you can use with the hw_stepper_motor_calibrate command).

The last step is to install both compass card (with his stepper motor) and the optical sensor into the wet compass 3D printed body. You have to slide the combo into position then hotglue the optical sensor in his final position (not too far for the slot you had cut in the compass card to fit in the slot of the optical sensor, not too close to let the compass card turn freely from the sensor).

I designed and 3D printed a modified back cover so as to hide everything but since the whole stuff is invisible from the pilot seat I never used it...

For the lua code, thanks to other forum members, I tinkered some codes available by May 2020 and afterward I used flawlessly the one you already saw in this thread (the one not endorsed by sling) until I upgraded to AM 4.0

Here is a picture, you may see the optical sensor just over the East marking on the compass card:

Image

The blue and grey wires you see on the left are connected to a white LED which provide front lighting...

Hope it is understandable !
Francois

User avatar
Ralph
Posts: 5068
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#27 Post by Ralph » Sun May 02, 2021 1:33 pm

I'll see if I can remember to try a stepper on an Uno this week.

User avatar
jph
Posts: 641
Joined: Fri Apr 10, 2020 12:50 pm
Location: Portugal

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#28 Post by jph » Mon May 03, 2021 9:50 am

altack wrote:
Sun May 02, 2021 12:59 pm
Hi Joe,

Unfortunately I didn’t make pictures when I built the wet compass but I can describe the process:

First I 3D printed this model from thingeverse ( https://www.thingiverse.com/thing:2297653).

Then I bought this optical endstop from Amazon ( https://www.amazon.fr/gp/product/B07PC ... UTF8&psc=1).
I had to desolder the white plastic cable connector (because it was protruding) so as to resolder it on the same side of the sensor on the board.

With a Dremel circular saw I then cut a 10mm slot on the top of 180° mark on the 3D printed compass card (actually the « S » mark ;) ).

By doing that, when the North is facing the rumb line on the compass face, the optical sensor triggers and gives a signal to the Arduino associated pin (one you can use with the hw_stepper_motor_calibrate command).

The last step is to install both compass card (with his stepper motor) and the optical sensor into the wet compass 3D printed body. You have to slide the combo into position then hotglue the optical sensor in his final position (not too far for the slot you had cut in the compass card to fit in the slot of the optical sensor, not too close to let the compass card turn freely from the sensor).

I designed and 3D printed a modified back cover so as to hide everything but since the whole stuff is invisible from the pilot seat I never used it...

For the lua code, thanks to other forum members, I tinkered some codes available by May 2020 and afterward I used flawlessly the one you already saw in this thread (the one not endorsed by sling) until I upgraded to AM 4.0

Here is a picture, you may see the optical sensor just over the East marking on the compass card:

Image

The blue and grey wires you see on the left are connected to a white LED which provide front lighting...

Hope it is understandable !
Francois
Hi Francois, Superb info ! huge thanks. The 'beam break / beam Make' sensors are really good !. I can absolutely see what you have done after seeing the thingyverse design. Excellent work. :)
If you can get in image of the 10mm slot you cut in the compass drum it would be excellent. I know exactly what you mean, some others may not. a great addition to the hardware thread that you can please add, or, I am happy to add and present it under your name and work. Using various methods of calibration is a bit of a black art for many. That thingyverse design lends itself to adding calibration due to the drum.
Some of the rotary instruments in a flat plane disk type can be done using a similar method with a simple round flat disk with a single slot - under the main disk (with a light sensor).
Some ideas for creating disks are items such as coffee jar inserts, plastic covers for project folders, acrylic etc, but the cutting of the circular shape can be difficult . But there are loads of possibilites. It is far better to use a beam 'make' such as you are doing, than a beam 'break' .. lovely work. Seeing actual solutions such as yours is worth more than a thousand words. ;)
Joe
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

altack
Posts: 33
Joined: Mon Nov 21, 2016 1:13 pm

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#29 Post by altack » Mon May 03, 2021 1:29 pm

I'm glad you finf it usefull, please feel free to use or edit any part of this thread in your hardware thread.

Regarding the 10 mm slot, I should have added "deep" but an image is worth a thousand words so...

Image

For sure you can edit the original "ring.STL" file (like with TinkerCAD above) but my guess is that a clean cut using a Dremel like circular saw makes a sharper signal, mileage may vary though !

Likewise you can edit the wet compass case STL file so as to provide a support for the optical sensor, for my part I just hotglued a bit of spare square rod I had but, please, don't tell anyone :D

JackZ
Posts: 1849
Joined: Mon Feb 22, 2016 1:02 pm

Re: Strange potentiometer behaviour after AM 4.0 upgrade

#30 Post by JackZ » Mon May 03, 2021 1:57 pm

Well done Francois, and a clever use of the optical sensor.
Didn’t know that it was possible to have the stepper run in « endless rotation » mode.

To be picky (you know me 8-) ), the compas rose should probably be mounted on a gimbal to stay horizontal during turns?

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests