sending consecutive messages faster than 1ms

Sep 9, 2008 at 8:17pm

sending consecutive messages faster than 1ms

I’m using max with an arduino board to control an industrial driverboard/steppermotor combo. The motor can microstep at 22000 steps per rotation so slow is no problem but i can’t get it to go faster than [metro 5]. After that the motor starts skipping messages and jumping around. I suspect the max/arduino firmware is the bottleneck, but was wondering if it was even possible within max to send consecutive messages faster than 1ms. i’d need to send messages at about 13khz (at 4000 steps/rotation) to get it turning fas enough for what i’m building.

#39629
Sep 10, 2008 at 6:23am

On 9 sept. 08, at 22:17, chaosmoon wrote:

> I suspect the max/arduino firmware is the bottleneck, but was
> wondering if it was even possible within max to send consecutive
> messages faster than 1ms. i’d need to send messages at about 13khz
> (at 4000 steps/rotation) to get it turning fas enough for what i’m
> building.

It is not possible to send messages faster than 1kHz with Max’
scheduler (and I’m not sure you’ll get a precise timing).
But why do you need to send messages so fast to the Arduino? Can’t you
put all the logic for the stepper in the Arduino? You could also send
from Max a _list_ of values every 5ms…

p

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://www.crfmw.be/max

#139706
Sep 10, 2008 at 8:11am

Quote: Patrick Delges wrote on Wed, 10 September 2008 00:23
—————————————————-

> But why do you need to send messages so fast to the Arduino? Can’t you
> put all the logic for the stepper in the Arduino? You could also send
> from Max a _list_ of values every 5ms…
>
> p
>
> _____________________________
> Patrick Delges
>
> Centre de Recherches et de Formation Musicales de Wallonie asbl
> http://www.crfmw.be/max
>
>
—————————————————-

Ideally everything would come from the Arduino. We’re building an automated camera rail/dolly with hardware controller. The hardest part coding-wise is preset positions and getting the motor to accelerate/decelerate if the pedals are no longer pressed or if a preset position in nearing. I’m quite fresh to Max but can manage this, however i havn’t got into processing/wiring yet, and have thus far only used the arduino with the “maxuino” firmware.

My idea was to prototype in Max and get it all installed then start port the ideas to wiring if possible. Maybe i’ll have to get straight into wiring instead.

Thanks for the reply.

#139707
Sep 12, 2008 at 10:11pm

> It is not possible to send messages faster than 1kHz with Max’
> scheduler (and I’m not sure you’ll get a precise timing).

Unless I’m misunderstanding this, why would it not be possible to send messages faster than this within Max? It seems like you can use a metro object with a value of <1 and it does indeed go faster than a metro with a value of 1. Am I missing something? I agree that dropped messages would probably be a result of the Max/Arduino firmware.

#139708

You must be logged in to reply to this topic.