Kung-Fu Perribot
Hello!...This is my second time in life that I get into an embedded operating system (in a basic way) to control my Perribot implementing what would be a very basic Scheduler through the systick of RT-Thread.
Using the development card: WCH RISC-V MCU CH32V307, which I found very interesting and extremely easy to implement with the IDE: MounRiver Studio.
Clock Tick(OS Tick)
Any operating system needs to provide a clock tick for the system to handle all time-related events, such as thread latency, thread time slice rotation scheduling, timer timeout, etc. Clock tick is a specific periodic interrupt. This interrupt can be regarded as the system heartbeat. The time interval between interrupts depends on different applications, generally it is 1ms–100ms. The faster the clock tick rate, the greater the overhead of the system. The number of clock ticks counted from the start of the system is called the system time.
For our RT-Thread operating system to work we need to attach the libraries to the project
Filling to the point: already in the main we invoke the initialization of the basic operating system.
Which as you can see is basically responsible for configuring the period of the interruptions of the timer for what is good being the systick with its respective callbacks and other setings
In a basic way this timer is responsible for increasing the BASE counter that well being the heart of our operating system simplifies and which will set the pace of other secondary counters for the SUB-tasks of the system
In essence this operating system what it does is to multiplex or divide the time of tasks according to fragments of time having in the slightest hierarchy the sequences of movements that form the trajectories of the Perribot, on them being the orders of movement to which these sequences belong, and in greater hierarchy selection of these orders
The orders are as follows: sitting, lying down, standing, walking, hitting, kicking etc.
The rest is the simple, the control of the 12 Servo motors with PWMs
initialize the PWMs according to their respective Servo Motors
Individual leg control functions
For now the Perribot is controlled by me, because I did not have enough time to put "intelligence" In the future: but little by little I will be giving it autonomy (I just hope it does not bite me later!) and for now
I say goodbyeGreetings to all see you in the following electronics project!...
Comments