Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Servo Support #13

Closed
twitchyliquid64 opened this issue Oct 22, 2014 · 17 comments
Closed

Servo Support #13

twitchyliquid64 opened this issue Oct 22, 2014 · 17 comments

Comments

@twitchyliquid64
Copy link

Hi,

Did some research after our discussion in the comments last night.

Turns out that analogWrite cannot be used for servos, as the pulse widths and duty cycles are incompatible.

http://forum.arduino.cc/index.php/topic,5701.0.html

So I had a look around at how the merlin 3d printer firmware does it. They simply use the arduino servo library:

https://github.com/ErikZalm/Marlin/blob/Marlin_v1/Marlin/Marlin_main.cpp#L495

Servo servos[NUM_SERVOS];
servos[0].attach(SERVO0_PIN);

The Gcode they use is:

  • M280 - Position an RC Servo P S, ommit S to report back current angle

Do you reckon we can add this?

PS: What timers on the arduino are already used?

@TimEvWw
Copy link
Contributor

TimEvWw commented Oct 22, 2014

At this moment, no timers are used, just delays.

Something like this can be added of course, but probably not copy-paste.
Marlin and FarmBot licenses are different. This is for positioning or for
the tool mount?

On Wed, Oct 22, 2014 at 1:32 PM, Twitch notifications@github.com wrote:

Hi,

Did some research after our discussion in the comments last night.

Turns out that analogWrite cannot be used for servos, as the pulse widths
and duty cycles are incompatible.

http://forum.arduino.cc/index.php/topic,5701.0.html

So I had a look around at how the merlin 3d printer firmware does it. They
simply use the arduino servo library:

https://github.com/ErikZalm/Marlin/blob/Marlin_v1/Marlin/Marlin_main.cpp#L495

Servo servos[NUM_SERVOS];
servos[0].attach(SERVO0_PIN);

The Gcode they use is:

  • M280 - Position an RC Servo P S, ommit S to report back current angle

Do you reckon we can add this?

PS: What timers on the arduino are already used?


Reply to this email directly or view it on GitHub
#13.

@twitchyliquid64
Copy link
Author

This is for the tool mount defs.

Marlin makes use of the servo library that ships with arduino. There is no need to copy-paste code as it is so simple.

http://arduino.cc/en/reference/servo

@twitchyliquid64
Copy link
Author

Servo library uses timer1, so be mindful not to use that one if you plan on using timers.

@TimEvWw
Copy link
Contributor

TimEvWw commented Oct 22, 2014

Ok. Just create a new issue for this so it's on the list.

I'm still busy with the emergency stop first. Probably I'll have to order a
small servo to be able to test it.

On Wed, Oct 22, 2014 at 2:30 PM, Twitch notifications@github.com wrote:

This is for the tool mount defs.

Marlin makes use of the servo library that ships with arduino. There is no
need to copy-paste code as it is so simple.

http://arduino.cc/en/reference/servo


Reply to this email directly or view it on GitHub
#13 (comment)
.

@twitchyliquid64
Copy link
Author

This is an issue.

My RAMPS board is in the mail. If it gets here before you have got around to it, ill PR.

@TimEvWw
Copy link
Contributor

TimEvWw commented Oct 25, 2014

What servo motors are you planning to use?

I was looking into it and only found 6 volt or 7.4. But on the ramps board
we use 12 volt. There are servo motos at 12 volt, but those are expensive
(>$100)

On Wed, Oct 22, 2014 at 2:45 PM, Twitch notifications@github.com wrote:

This is an issue.

My RAMPS board is in the mail. If it gets here before you have got around
to it, ill PR.


Reply to this email directly or view it on GitHub
#13 (comment)
.

@twitchyliquid64
Copy link
Author

IIRC there are servo headers on the ramps board, and with a jumper they can
be tied to the 5V rail.

5V is just enough to power most servos.

On Sun, Oct 26, 2014 at 9:24 AM, Tim Evers notifications@github.com wrote:

What servo motors are you planning to use?

I was looking into it and only found 6 volt or 7.4. But on the ramps board
we use 12 volt. There are servo motos at 12 volt, but those are expensive
(>$100)

On Wed, Oct 22, 2014 at 2:45 PM, Twitch notifications@github.com wrote:

This is an issue.

My RAMPS board is in the mail. If it gets here before you have got
around
to it, ill PR.


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60078573>

.


Reply to this email directly or view it on GitHub
#13 (comment)
.

@TimEvWw
Copy link
Contributor

TimEvWw commented Oct 26, 2014

Indeed, there is a separate 5 volt circuit. An additional power supply is needed or a voltage converter chip.

Op 26-okt.-2014 om 02:32 heeft Twitch notifications@github.com het volgende geschreven:

IIRC there are servo headers on the ramps board, and with a jumper they can
be tied to the 5V rail.

5V is just enough to power most servos.

On Sun, Oct 26, 2014 at 9:24 AM, Tim Evers notifications@github.com wrote:

What servo motors are you planning to use?

I was looking into it and only found 6 volt or 7.4. But on the ramps board
we use 12 volt. There are servo motos at 12 volt, but those are expensive
(>$100)

On Wed, Oct 22, 2014 at 2:45 PM, Twitch notifications@github.com wrote:

This is an issue.

My RAMPS board is in the mail. If it gets here before you have got
around
to it, ill PR.


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60078573>

.


Reply to this email directly or view it on GitHub
#13 (comment)
.


Reply to this email directly or view it on GitHub.

@twitchyliquid64
Copy link
Author

It doesnt have a 7805 on the board?

On Sun, Oct 26, 2014 at 6:03 PM, Tim Evers notifications@github.com wrote:

Indeed, there is a separate 5 volt circuit. An additional power supply is
needed or a voltage converter chip.

Op 26-okt.-2014 om 02:32 heeft Twitch notifications@github.com het
volgende geschreven:

IIRC there are servo headers on the ramps board, and with a jumper they
can
be tied to the 5V rail.

5V is just enough to power most servos.

On Sun, Oct 26, 2014 at 9:24 AM, Tim Evers notifications@github.com
wrote:

What servo motors are you planning to use?

I was looking into it and only found 6 volt or 7.4. But on the ramps
board
we use 12 volt. There are servo motos at 12 volt, but those are
expensive
(>$100)

On Wed, Oct 22, 2014 at 2:45 PM, Twitch notifications@github.com
wrote:

This is an issue.

My RAMPS board is in the mail. If it gets here before you have got
around
to it, ill PR.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60078573>

.


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60499551>

.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#13 (comment)
.

@TimEvWw
Copy link
Contributor

TimEvWw commented Oct 26, 2014

Ah, it seems it does have one. That should work for testing. I'll borrow a servo from a RC enthusiast.

Op 26-okt.-2014 om 08:04 heeft Twitch notifications@github.com het volgende geschreven:

It doesnt have a 7805 on the board?

On Sun, Oct 26, 2014 at 6:03 PM, Tim Evers notifications@github.com wrote:

Indeed, there is a separate 5 volt circuit. An additional power supply is
needed or a voltage converter chip.

Op 26-okt.-2014 om 02:32 heeft Twitch notifications@github.com het
volgende geschreven:

IIRC there are servo headers on the ramps board, and with a jumper they
can
be tied to the 5V rail.

5V is just enough to power most servos.

On Sun, Oct 26, 2014 at 9:24 AM, Tim Evers notifications@github.com
wrote:

What servo motors are you planning to use?

I was looking into it and only found 6 volt or 7.4. But on the ramps
board
we use 12 volt. There are servo motos at 12 volt, but those are
expensive
(>$100)

On Wed, Oct 22, 2014 at 2:45 PM, Twitch notifications@github.com
wrote:

This is an issue.

My RAMPS board is in the mail. If it gets here before you have got
around
to it, ill PR.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60078573>

.


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60499551>

.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#13 (comment)
.


Reply to this email directly or view it on GitHub.

@twitchyliquid64
Copy link
Author

Two bucks on ebay for a 9g one. But yeah, either works.

Servo intensive applications should use their own power regulator though
using 12V from the toolhead, as 7805's cant provide too much power.

On Sun, Oct 26, 2014 at 7:21 PM, Tim Evers notifications@github.com wrote:

Ah, it seems it does have one. That should work for testing. I'll borrow a
servo from a RC enthusiast.

Op 26-okt.-2014 om 08:04 heeft Twitch notifications@github.com het
volgende geschreven:

It doesnt have a 7805 on the board?

On Sun, Oct 26, 2014 at 6:03 PM, Tim Evers notifications@github.com
wrote:

Indeed, there is a separate 5 volt circuit. An additional power supply
is
needed or a voltage converter chip.

Op 26-okt.-2014 om 02:32 heeft Twitch notifications@github.com het
volgende geschreven:

IIRC there are servo headers on the ramps board, and with a jumper
they
can
be tied to the 5V rail.

5V is just enough to power most servos.

On Sun, Oct 26, 2014 at 9:24 AM, Tim Evers notifications@github.com

wrote:

What servo motors are you planning to use?

I was looking into it and only found 6 volt or 7.4. But on the
ramps
board
we use 12 volt. There are servo motos at 12 volt, but those are
expensive
(>$100)

On Wed, Oct 22, 2014 at 2:45 PM, Twitch notifications@github.com

wrote:

This is an issue.

My RAMPS board is in the mail. If it gets here before you have
got
around
to it, ill PR.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60078573>

.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60499551>

.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60508558>

.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#13 (comment)
.

@TimEvWw
Copy link
Contributor

TimEvWw commented Nov 6, 2014

http://youtu.be/dwUVyM4Rh1w

Well, it's moving. I had to add an extra power supply for this one. It
supports a servo in pin 4 and 5.

On Sun Oct 26 2014 at 9:23:30 AM Twitch notifications@github.com wrote:

Two bucks on ebay for a 9g one. But yeah, either works.

Servo intensive applications should use their own power regulator though
using 12V from the toolhead, as 7805's cant provide too much power.

On Sun, Oct 26, 2014 at 7:21 PM, Tim Evers notifications@github.com
wrote:

Ah, it seems it does have one. That should work for testing. I'll borrow
a
servo from a RC enthusiast.

Op 26-okt.-2014 om 08:04 heeft Twitch notifications@github.com het
volgende geschreven:

It doesnt have a 7805 on the board?

On Sun, Oct 26, 2014 at 6:03 PM, Tim Evers notifications@github.com
wrote:

Indeed, there is a separate 5 volt circuit. An additional power
supply
is
needed or a voltage converter chip.

Op 26-okt.-2014 om 02:32 heeft Twitch notifications@github.com
het
volgende geschreven:

IIRC there are servo headers on the ramps board, and with a jumper
they
can
be tied to the 5V rail.

5V is just enough to power most servos.

On Sun, Oct 26, 2014 at 9:24 AM, Tim Evers <
notifications@github.com>

wrote:

What servo motors are you planning to use?

I was looking into it and only found 6 volt or 7.4. But on the
ramps
board
we use 12 volt. There are servo motos at 12 volt, but those are
expensive
(>$100)

On Wed, Oct 22, 2014 at 2:45 PM, Twitch <
notifications@github.com>

wrote:

This is an issue.

My RAMPS board is in the mail. If it gets here before you have
got
around
to it, ill PR.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60078573>

.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60499551>

.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60508558>

.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-60509955>

.


Reply to this email directly or view it on GitHub
#13 (comment)
.

@TimEvWw TimEvWw closed this as completed Nov 6, 2014
@roryaronson
Copy link
Member

Awesome, I got my new Pi B+ setup yesterday and was able to turn on my
vacuum pump for the first time from the menu program! My endstops still
were not showing readings though in the controller.

Can you make the video public?

On Thu, Nov 6, 2014 at 12:57 PM, Tim Evers notifications@github.com wrote:

Closed #13
#13.


Reply to this email directly or view it on GitHub
#13 (comment)
.

Rory Landon Aronson http://www.roryaronson.com
(678) 321-7679

@TimEvWw
Copy link
Contributor

TimEvWw commented Nov 6, 2014

Video access changed.

That endstop is strange. I tested it here again and it works correctly.
I'll dial in and do some tests soon.

On Thu, Nov 6, 2014 at 10:31 PM, Rory Aronson notifications@github.com
wrote:

Awesome, I got my new Pi B+ setup yesterday and was able to turn on my
vacuum pump for the first time from the menu program! My endstops still
were not showing readings though in the controller.

Can you make the video public?

On Thu, Nov 6, 2014 at 12:57 PM, Tim Evers notifications@github.com
wrote:

Closed #13
#13.


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#event-189571396>

.

Rory Landon Aronson http://www.roryaronson.com
(678) 321-7679


Reply to this email directly or view it on GitHub
#13 (comment)
.

@roryaronson
Copy link
Member

Nice, looks good! What do you think is a good first use case for it?

On Thu, Nov 6, 2014 at 2:05 PM, Tim Evers notifications@github.com wrote:

Video access changed.

That endstop is strange. I tested it here again and it works correctly.
I'll dial in and do some tests soon.

On Thu, Nov 6, 2014 at 10:31 PM, Rory Aronson notifications@github.com
wrote:

Awesome, I got my new Pi B+ setup yesterday and was able to turn on my
vacuum pump for the first time from the menu program! My endstops still
were not showing readings though in the controller.

Can you make the video public?

On Thu, Nov 6, 2014 at 12:57 PM, Tim Evers notifications@github.com
wrote:

Closed #13
#13.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#event-189571396>

.

Rory Landon Aronson http://www.roryaronson.com
(678) 321-7679


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-62054929>

.


Reply to this email directly or view it on GitHub
#13 (comment)
.

Rory Landon Aronson http://www.roryaronson.com
(678) 321-7679

@TimEvWw
Copy link
Contributor

TimEvWw commented Nov 6, 2014

Don't know.

You can use it to aim a sensor to left/right/forward/backward and aiming a sprayer nozzle.

Also for speed controlled servo motor with a valve for distributing solid fertilizer (pellets dropping on spinning disc).

The simplest is just raking leaves (just a spinning brush) with controlled speed.

Op 6-nov.-2014 om 23:21 heeft Rory Aronson notifications@github.com het volgende geschreven:

Nice, looks good! What do you think is a good first use case for it?

On Thu, Nov 6, 2014 at 2:05 PM, Tim Evers notifications@github.com wrote:

Video access changed.

That endstop is strange. I tested it here again and it works correctly.
I'll dial in and do some tests soon.

On Thu, Nov 6, 2014 at 10:31 PM, Rory Aronson notifications@github.com
wrote:

Awesome, I got my new Pi B+ setup yesterday and was able to turn on my
vacuum pump for the first time from the menu program! My endstops still
were not showing readings though in the controller.

Can you make the video public?

On Thu, Nov 6, 2014 at 12:57 PM, Tim Evers notifications@github.com
wrote:

Closed #13
#13.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#event-189571396>

.

Rory Landon Aronson http://www.roryaronson.com
(678) 321-7679


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-62054929>

.


Reply to this email directly or view it on GitHub
#13 (comment)
.

Rory Landon Aronson http://www.roryaronson.com
(678) 321-7679

Reply to this email directly or view it on GitHub.

@twitchyliquid64
Copy link
Author

Everything.

Grabbers, sensor orientations, cutters, 4dof, etc.
On Nov 7, 2014 9:37 AM, "Tim Evers" notifications@github.com wrote:

Don't know.

You can use it to aim a sensor to left/right/forward/backward and aiming a
sprayer nozzle.

Also for speed controlled servo motor with a valve for distributing solid
fertilizer (pellets dropping on spinning disc).

The simplest is just raking leaves (just a spinning brush) with controlled
speed.

Op 6-nov.-2014 om 23:21 heeft Rory Aronson notifications@github.com het
volgende geschreven:

Nice, looks good! What do you think is a good first use case for it?

On Thu, Nov 6, 2014 at 2:05 PM, Tim Evers notifications@github.com
wrote:

Video access changed.

That endstop is strange. I tested it here again and it works
correctly.
I'll dial in and do some tests soon.

On Thu, Nov 6, 2014 at 10:31 PM, Rory Aronson <
notifications@github.com>
wrote:

Awesome, I got my new Pi B+ setup yesterday and was able to turn on
my
vacuum pump for the first time from the menu program! My endstops
still
were not showing readings though in the controller.

Can you make the video public?

On Thu, Nov 6, 2014 at 12:57 PM, Tim Evers notifications@github.com

wrote:

Closed #13
#13.


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#event-189571396>

.

Rory Landon Aronson http://www.roryaronson.com
(678) 321-7679


Reply to this email directly or view it on GitHub
<

https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-62054929>

.


Reply to this email directly or view it on GitHub
<
https://github.com/FarmBot/farmbot-arduino-controller/issues/13#issuecomment-62059998>

.

Rory Landon Aronson http://www.roryaronson.com
(678) 321-7679

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub
#13 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants