[1062] How to drive several steppers at the same time?

Discuss your projects and problem using Max/MSP with Phidgets on Windows or Mac.
hans37

[1062] How to drive several steppers at the same time?

Postby hans37 » Thu Jul 28, 2011 9:22 am

Hello phidgets users.
I' m using 1062 stepper controllers. I downloaded the Max patches examples. Everything is working great except when I want several of my steppers to move a the same time.
Do you have any idea how to achieve this in the exemple patch?
It would help me a lot.
Thanks.

mphi
Phidgetly
Posts: 45
Joined: Tue Nov 16, 2010 4:27 pm
Contact:

Re: [1062] How to drive several steppers at the same time?

Postby mphi » Thu Jul 28, 2011 12:44 pm

You have to create a new PhidgetStepper object for each Stepper you use. Be sure to reference them by serial number.

Please see the Getting Started Guide guide for Max/MSP for more details

hans37

Re: [1062] How to drive several steppers at the same time?

Postby hans37 » Thu Jul 28, 2011 3:17 pm

Thanks mphi.
I tried to place a new phidgetStepper object in the same patch with the same serial id than the first one but nothing happens...
The getSerial or status query does not work on the latter. It outputs "0"
If I connect a new board, it does not work either despite filling the object with the different serial ID

I had sent them the read message and the start one... Still nothing in return.

I don't Know what to try next, I'm stuck and can use only one stepper at one...
Thanks again...

mphi
Phidgetly
Posts: 45
Joined: Tue Nov 16, 2010 4:27 pm
Contact:

Re: [1062] How to drive several steppers at the same time?

Postby mphi » Thu Jul 28, 2011 4:17 pm

Make sure that another program is not using the Phidgets.

To demonstrate what I mean by creating another Phidget object, I have attached a screenshot of my .help file. Although it is for the PhidgetInterfaceKit, the same rules apply to the PhidgetStepper.
Attachments
MaxMSP 2 Phidgets.JPG
MaxMSP 2 Phidgets.JPG (85.95 KiB) Viewed 3618 times

hans37

Re: [1062] How to drive several steppers at the same time?

Postby hans37 » Thu Jul 28, 2011 6:14 pm

Thanks again for your quick reply.
Yes I understood this solution was for using 2 or more boards at the same time.
That's exactly what I tried with the phidgetStepper patch, I copied/paste the whole example in order to use 2 boards in the same patch.
it didn't work, don't know why.

If i use one object in a patch, everything is ok, but I'm only able to control the steppers one by one...

Just to check whether I'm misleading or not:
For example: In order to control the stepper 1 and the stepper 2 of a first board, do I have to copy the phidget object anyway? keeping the the same serial attribute in both?

here is my example in max 5.
in red: 2 objects controlling two different steppers plugged on a first 1062 board
in green: 2 objects controlling two different steppers on an other board.
Am I right?
thanks.
hans

edit: attached file seems to be too heavy
here is a link:
http://5img.com/vimg51/8566/17phidgetstepper.jpg

mphi
Phidgetly
Posts: 45
Joined: Tue Nov 16, 2010 4:27 pm
Contact:

Re: [1062] How to drive several steppers at the same time?

Postby mphi » Fri Jul 29, 2011 9:52 am

It seems that there needs to be 2 things that need to be cleared up.

1. If you are using a single PhidgetStepper(1062) to control multiple stepper motors, you do not need to create a new PhidgetStepper object for each stepper motor.
You just need to specify the motor index(0, 1, 2, or 3)
ie, setEngaged 0 $1 --->for motor 0
setEngaged 1 $1 --->for motor 1
setEngaged 2 $1 --->for motor 2
setEngaged 3 $1 --->for motor 3

2. If you are trying to control more than one PhidgetStepper, then you need to create a PhidgetStepper object for each PhidgetStepper.
So, modify your patch so that you have only one PhidgetStepper 32001, and one PhidgetStepper 28432 object. Then click on getSerial for both PhidgetSteppers, and see if both of them give you the correct serial number.
Do all have them return the correct serial number, or only one, or none of them at all?

I have attached a screenshot of my patch if things are not clear.

Note: Once you modify the patch, you may need to restart Max for the PhidgetSteppers attach successfully.

Lastly, can you confirm that the PhidgetStepper.mxe(Windows) PhidgetStepper.mxo(Mac) is in the same directory as the .help file.
Attachments
Simple 2 Steppers.JPG
Simple 2 Steppers.JPG (13.66 KiB) Viewed 5336 times

hans37

Re: [1062] How to drive several steppers at the same time?

Postby hans37 » Fri Jul 29, 2011 6:13 pm

Ok thanks.

1. when I use one board only I'm still stuck dealing with the use of several steppers at once.
(reassure me, the move of the 4 stepper at once and at different speed and position is possible?)
here is a screenshot of the patch...
Should this patch work?

2. It's understood for the phidgets object that i need to clone in case of the use of another board.
The problem remains in practice: the very first plugged board is seen, the second one is not.
It seems to be the order of creaion of those phidgets objects that is crucial.
2nd or third phidgetsStepper objects in the same patch are allways silent
Even if when I proceed like this:
Opening the helpfile patch, creating a new phidgetStepper object and deleting the orginal one.
The remaining object is still silent, no serial read, 0 status...
same thing if I manually fill the object with the corresponding serial number...

Sorry for this issue...

mxo file is in the same directory.
Do I have better chance to try the windows version of max?
Attachments
phidgets_multicontrol.jpg
phidgets_multicontrol.jpg (101.42 KiB) Viewed 3618 times

hans37

Re: [1062] How to drive several steppers at the same time?

Postby hans37 » Sat Jul 30, 2011 2:37 pm

I finally think there is an issue with the USB port of one of my board that make my patch crash.The other board works without any problem....
Thanks anyway for your help...


Return to “Max/MSP”

Who is online

Users browsing this forum: No registered users and 2 guests