Hello
At first sorry for my bad Englich. I hope you can unterstand what I mean.
Ich want to implement a force controll for Gripper with the Pyboard.
Therefore I use
- the ADC for measure the force
- the servo (X1, X2)
- the UART interface to communikate with a WLAn Modul (ESP8266)
- an other UART interface to communikate with the YouBot to get commands and parameters
So what is the best way to coordinate the single tasks.
So far I write the follow classes:
C_adc to read the measment and calc the result force which should be return
C_ servo to write target values to the servos
C_regelung to calc the new angles
C_WLAN to public measured values
C_youbot to get what to do and retun the correct execution
A main funktion to start the single funktions and create the instances.
I have some ideas:
- to use timer interrupts to start the feedback controll every known time
- use a scheduler http://goo.gl/wsuo9u
- use 3 states and start one point after finsh the last
Do you have a good idea?
Another Problem with the scheduler is, that I can not start a funktion of an other class in a funktion of a class.
Thank You
Best regards
Martin.
Gripper Control
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Gripper Control
Re schedulers, the officially supported way of doing asynchronous programming is to use the uasyncio module. If you're more familiar with the thread approach there is an unofficial module based on microthreading in the wiki.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Gripper Control
Hello,
Where I can find a good and easy instruction to use asyncio with the pyboard?
Is this module truly the best way to impliment a implement discrete controller?
I think this is in the first way for a higher performance?
Thank you
Where I can find a good and easy instruction to use asyncio with the pyboard?
Is this module truly the best way to impliment a implement discrete controller?
I think this is in the first way for a higher performance?
Thank you