Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Strange problems with servo [SOLVED] TOPIC CLOSED
boris
Newbie
Posts: 10
Permalink
Post Strange problems with servo
on: March 10, 2018, 17:47

Dear Sandy,

to start with: many thanks for your great work!! I built a (maybe bit to huge - machine width is 1806mm 🙂 machine over the past weeks following your brilliant instructable and those manymany hints of forum members (highly appreciated as well!).

My machine works with an arduino MEGA and a adafruit motorshield v2.3. with latest firmware and server version directly from sandy's github. My steppers are NEMA with 200 steps per turn and I am really overwhelmed by the precision of this huge thing. My main usecase will be (at least in the beginning) to draw vector graphics. So, both steppers work fine and precise (I also tried SINGLE and DOUBLE mode of steering the steppers, I did like the reduced noise but disliked the reduced precision), also there seems to be no communication problem between the MEGA and my iMac.

I have a really strange problem: My Servo does not what it should do. PenUp/Pendown does mostly not do a thing. I tried to modify the angle settings and uploaded them to the Arduino, it anyhow mostly doesnt move. Sometimes it makes small movements like 10 Degrees (although settings would indicate much bigger movements, which are not enough to lift the pen enough), most of the time the servo does not react at all. I cannot understand under which conditions a small movement of the servo happens, mostly there is no movement when ther should be one.

I thought that the servo type I used had a problem (which is not a continous rotation model or a digital servo)., so I tried another one from a different company. Same Picture. Then I tried a different motorshield (but still adafruit v2.3). Did not help. I then downloaded from the Arduino examples the sketch "sweep" and... it worked with both servo types sweeping out of a sudden without changing wiring

Any ideas how i could narrow down the problem a bit more? Could I activate specific servo monitoring options?

I feel very close to a fully working machine, but could not find the problem keeping me from final success, thanks in advance for hints or ideas on that topic!!

boris
Newbie
Posts: 10
Permalink
Post Re: Strange problems with servo
on: March 11, 2018, 16:39

[img][/img]
Image
Image

boris
Newbie
Posts: 10
Permalink
Post Re: Strange problems with servo
on: March 11, 2018, 19:06

Just to quickly explain the pictures above: I activated logging and in the first pic one can see that new servo angles are uploaded successfully. So, overall it shouldn't be a communication problem between processing and the arduino mega, as the answer is 100 ok.
Then I tried the newly loaded angles with the button in the setup menu and the servo moved, but only a very small angle. However, response is depicted in second picture, some values seem strange but overall ok. My impression was that the servo somehow wanted to continue turning into one direction, although pulse duration should toggle between two values.

Shall I switch to a previous arduino release? Is there a way to a dress the servo from the arduino differently, as the sweep sketch works nicely?

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Strange problems with servo
on: March 11, 2018, 19:23

Hi there! Thanks for the extra debug notes. I'm assuming that the pic with the stream of numbers is taken during an attempted lift or drop?

So it looks like you already have DEBUG_PENLIFT enabled, that's about the only debugging feature that's built in, and that'll tell you the position that the machine is asking the servo to move to.

Have a look at your "sweep" example that works fine and see which pin it is using to control the servo. There'll probably be a variable declared called servoPin in sweep. It should have the same value as PEN_HEIGHT_SERVO_PIN in the Polargraph firmware. That's 9 by default. (https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L135)

There are two connectors for servo motors on that shield, wired to pin 9 and pin 10. I can't remember which is which (servo 2 is pin 9 I think?), but I expect you've tried both.

Other thing you might try is changing the speed that the position change happens at by modifying penLiftSpeed (https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L134) from 3 up to 10 or 20. I guess I would be surprised if that makes any difference, but give it a shot.

The range that you've got it set to (48 to 189) seems like it should be ok, although it's a much wider range than you should need for the 90 degree movement. I have found servos to be very odd around the ends of their travel, and can get physically stuck if swept too far at one extreme. I'd use the polargraph controller software (second tab, "setup") to set the range to something small and well within normal boundaries, like 80 to 170. Use the "pen up position"/"pen down position" and "test lift range" to try and get some life out of it. Doing a "upload lift range" on it's own can sometimes help (see http://www.polargraph.co.uk/forum/polargraphs-group2/troubleshooting-forum5/test-lift-range-works-but-pen-lift-pen-drop-dont-thread536.0/).

Good luck,

sn

boris
Newbie
Posts: 10
Permalink
Post Re: Strange problems with servo
on: March 12, 2018, 20:10

Hi Sandy,
many thanks for taking Your time answering this !!

Modifying penLiftSpeed did the trick, I changed the value to 20 and now the servo moves at each command.

Next, I downloaded 90 and 150 as values and tested using "test lift range". The pen down position ("2" in the attached picture) stopped approx 60 degrees after the penup ("1" in the picture), however, the next movement continues into the same direction in which the servo initially started from the penup position. So starting from pendown it runs into the wrong direction first and after reaching the physical end position ("3" ), it goes back exactly to the starting position. Strange, isn't it?

Anyway, if this might also be a completely different problem, the initially mentioned problem is solved as movement of the servo is working. I also discovered that currently connection between Arduino and iMac is lost quite often due to problems of processing writing into the serial interface. Maybe this also has an influence to the servo behaviour?
Image

boris
Newbie
Posts: 10
Permalink
Post Re: Strange problems with servo
on: March 13, 2018, 08:33

Hi again,

Values working are: Pendown 95, Penup 150, penliftspeed 20.
It doesnt work for Pendown above 95 (here the servo again does not move at all), but anyhow. Overall movement is now narrowed to 90 degrees with those values.

Thanks for Your hints and support!!

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: Strange problems with servo [SOLVED]
on: March 13, 2018, 23:10

Really glad you got it working Boris, I'm not surprised you've had some odd results with the small servo motors though - unless you pay a lot for them they are quite random!

The reason the penlift has so many controls to change (up and down position, and the test range function) is because I found every servo motor had a slightly different useful range. Some were very narrow, and really choked at either extreme.

I do find that pushing the control horn onto the gear on the servo often pushed the shaft of the motor too far in, and it started to bind inside the servo housing, and that led to some bad behaviour. So when I'm fixing them, I usually push the control horn on, tighten up the screw lightly and then pull it up half a millimetre or so just so it turns more freely.

Good luck with your drawings!
sn

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.024 seconds.