Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Pen lift stops the drawing
Kevlars
Newbie
Posts: 4
Permalink
Kevlars
Post Pen lift stops the drawing
on: April 29, 2018, 14:25
Quote

Hey guys,
I did not find a problem similar to mine on the forum, so here goes.
My polargraph works nicely and draws nice pictures, but when i want to draw pictures that need the pen to be lifted from the paper, the polargraph stops. The program shows BUSY: C14, END and never moves on from there, however it did actually lift the pen off the paper with the servo. The pen lift and pen drop functions all work fine.
When drawing without a servo connected, the pen lift option is not available and thus the drawing finishes.
Can anybody tell me what is going wrong?
Thanks in advance!
Image

sandy
Administrator
Posts: 1333
Permalink
sandy
Post Re: Pen lift stops the drawing
on: April 29, 2018, 17:08
Quote

Hello, welcome 🙂
The particular pen lift command that stopped the machine - (C14,END), was that the first pen lift command in the whole queue?

I'm tempted to suggest this might be a power supply issue. The pen lift servo motor runs on the same 5v power supply that the microcontroller (arduino) runs on, so if it draws a lot of current, it can sometimes cause the controller to be starved of power.

The fact that the C14,END command does NOT cause this crash if the servo is not physically attached is interesting, and supports the theory above. But the problem with that theory is that this kind of problem usually triggers a full reset of the board, and I think you'd notice that. If nothing else, it would eventually go READY again.

What do you do when it crashes? Does anything respond? Do you reset it? Do you have to disconnect or reconnect?

How do you have it wired up, and what kind of power supply and motor shield are you using?

When you say "The pen lift and pen drop functions all work fine", do you mean that while the machine is not drawing, you can use the buttons in the controller to send pen lift / drop commands, and they always work?

That's a puzzle!

sn

Kevlars
Newbie
Posts: 4
Permalink
Kevlars
Post Re: Pen lift stops the drawing
on: May 3, 2018, 08:24
Quote

Hey!
Thanks for the response!

I was thinking about power supply issues, but making the motors run on another (external) supply doesn't seem to solve the problem. If i go too high on the voltage and/or amperage with the wall supplies i have around the motors do not work as expected. They shake (move back and forth quick), it's a 12V 1A supply and i would think that would work better than the 6V 500mA supply i was using before.
The arduino is powered via USB and i'm using what seems like an adafruit motorshield v1 clone of the brand Funduino. The motorshield should be able to handle this i think. I replaced one of the l293d chips once already because i probably used a too high voltage supply (not the 12V supply).
The servo motor i'm using is a small one and not rated for a lot of torque and so i expect not a lot of current draw. I will try with another small servo. (Will have to make a new connector because these connectors are apparently not standard)

When the robot stops drawing i usually reconnect via the serial port to get it starting again, but then the drawing does not start where it left off. The pen lift command keeps being busy, so i cannot execute any other commands.
The pen lift commands (buttons in controller) do work when it is not drawing

Should i power the arduino also via the external power supply or only power the motors with this supply?

sandy
Administrator
Posts: 1333
Permalink
sandy
Post Re: Pen lift stops the drawing
on: May 7, 2018, 15:02
Quote

A problem with the motorshield is that the stepper motor power supply can be separated (and uses the screw terminal power connector), but the penlift servo motor always runs from the same power supply as the arduino - so it's normally the USB supply. If it works normally (when the steppers are not moving) then that kinda proves that it isn't causing resets though. It'd be resetting every time.

Lets try something:

Open up the Arduino IDE and the serial monitor at 57600 baud. Enter

C14,180,END

with line endings, and then:

C14,END

and see what difference you get from each one.

Also, which version of firmware are you using (it tells you on startup when you connect with serial monitor).

sn

Kevlars
Newbie
Posts: 4
Permalink
Kevlars
Post Re: Pen lift stops the drawing
on: May 10, 2018, 15:27
Quote

When sending:
C13,END
C14,END
C13,90,END
C14,180,END
Everything seems to work fine. It drops and lifts the pen just as expected.
The pen lift and pen drop functions in the polargraphcontroller program work.

This is what i get on startup:

POLARGRAPH ON!
Bad format for hardware version - defaulting to ATMEGA328 (Uno)
incoming: Hardware: 1
incoming: MC_UNO
incoming: Loaded width:370
incoming: Loaded height:700
incoming: Loaded mmPerRev:20.00
incoming: Loaded steps per rev:400
incoming: Loaded step multiplier:1
incoming: Loaded down pos:143
incoming: Loaded up pos:23
incoming: Recalc mmPerStep (0.05), stepsPerMM (20.00)
incoming: Recalc pageWidth in steps (7400)
incoming: Recalc pageHeight in steps (14000)

But i found in the arduino code i uploaded to the arduino that the version is 1.2.1

Right now when drawing a simple image with white areas (so that the pen needs to be lifted) it will lift the pen and drop it for a quarter of the image drawn, but then get stuck at a pen lift/ pen drop command (C14,END or C13,END), i tried to reconnect and then place the pen where it was before and start the drawing from there, but at the next pen drop/lift it would stop again.

Kevlars
Newbie
Posts: 4
Permalink
Kevlars
Post Re: Pen lift stops the drawing
on: May 13, 2018, 11:28
Quote

Update:
Drawings can now complete!
It was a power supply issue, apparently all the power supplies i used broke. I suspect because of the motor controller, so i have now connected the supply to the arduino input instead of directly to the controller and that seems to work.
Thanks for the replies and the help to get me to a solution!

sandy
Administrator
Posts: 1333
Permalink
sandy
Post Re: Pen lift stops the drawing
on: May 13, 2018, 12:06
Quote

Hum! Not sure I was really much help there, but glad you got it working!

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