Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: How to use the Standalone command queue runner
supersambo
Newbie
Posts: 9
Permalink
Post How to use the Standalone command queue runner
on: December 11, 2016, 16:19
Quote

Hi,
I recently discovered your Standalone queue runner. This is great because on my mac I cannot even turn off the screen without the controller software stopping to send commands.

However, I'm not entirely sure how to use the script. When running the script it starts drawing right away. The problem is my gondola doesn't stay at the home position without me or the motors holding it.
For now, I'm exporting the queue when gondola is at home and I let python sleep for about 10 seconds after connecting which gives me enough time to hold the gondola in position by hand. This works but it's probably not the way it's suppose to be done?

This leads me to another question. How can I tell the polargraph to hold the motors? When sending "set home position" from the controller the motors remain fixed. However sending the sam message from the python script does not have the same effect 🙁

best,
stephan

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: How to use the Standalone command queue runner
on: December 12, 2016, 20:17
Quote

Let me see - when you send "set home" in the controller, it issues a

C09,xxx,xxx,END

and it successfully makes the motors engage.

When you put that command into a txt file, and run it through the standalone script - then it doesn't make the motor engage?

It should anyway. What I'd do is have one script "setup.txt" that sends the pen size, and motor speed commands, and finally a "set home" command.

You run that first, it locks the motors, then you physically move the gondola to the home point, and then you run your main script that has your drawing in it.

sn

supersambo
Newbie
Posts: 9
Permalink
Post Re: How to use the Standalone command queue runner
on: December 13, 2016, 19:39
Quote

Hi again,
thank you for the reply. Well, that's what I was thinking but I did so by adding set_home() method to your script which didn't work properly. It's working now. Thank you!

I will now try to add some sort of --recover option to the script so I can hopefully salvage my drawings when polarGraph gets stuck again (which is unfortunately still happening)

Thanks again!
best, stephan

supersambo
Newbie
Posts: 9
Permalink
Post Re: How to use the Standalone command queue runner
on: December 19, 2016, 12:05
Quote

Hi,
I tweaked the script so it better fits my needs.
https://gist.github.com/supersambo/b2e7089e8269682b88ddd354627b3052
After some testing it seems to be working. I'm still experiencing problems with the Polargraph getting stuck in the middle of nowhere, so I changed 1. the starting routine and 2. I added a recover option.
It's crucial for this to start from the exact same home position every time so I put some nails behind my sprockets where I can engage the chain and painted the respective balls that should go in there.

The routine is as follows:
1. I run the script
2. Script prompts to move gondola to home position, which is when I engage the chain between the nails
3. Hit enter to set home and lock the motors
4. Then I release the chain and hit enter again
5. Polargraph starts drawing

For this to work properly the home position must be set in the script on lines 27-28.

Now, when the polargraph gets stuck I:
1. write down the last line number from console
2. hit ctrl-c to interrupt
3. run the script again with the '--recover' flag. Something like:

python send.py mycommands.txt /dev/ttyACM0 --recover

4. I complete the above steps 2-4
5. Before it starts drawing the script will ask for the line number where polargraph got stuck (which I wrote down before). I enter the number without quote and hit enter
6. The gondola is then supposed to return to the position where it got stuck
7. I confirm the position and hit enter so polargraph continues drawing.

Does this make sense? Do you see any problems with this approach?

Best,
stephan

sandy
Administrator
Posts: 1317
Permalink
sandy
Post Re: How to use the Standalone command queue runner
on: December 22, 2016, 21:16
Quote

It seems like a reasonably approach to me. I think I would take the line number as a parameter

python send.py mycommands.txt /dev/ttyACM0 --start 28

And it'd just default to 0 (the beginning) when it's not given. This makes the script a little more amenable to automation. But it's a matter of taste! Your way will work fine too.

sn

supersambo
Newbie
Posts: 9
Permalink
Post Re: How to use the Standalone command queue runner
on: January 3, 2017, 09:00
Quote

Sounds like a good idea! I will change that

supersambo
Newbie
Posts: 9
Permalink
Post Re: How to use the Standalone command queue runner
on: January 7, 2017, 12:57
Quote

Just edited the script according to you suggestion...
https://gist.github.com/supersambo/b2e7089e8269682b88ddd354627b3052

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