If you made $4000 gross revenue in a quarter, the first $3000 of that is royalty free, so you have $1000 of royalty-bearing gross revenue. Royalty is 5%, so in that quarter, you would owe a royalty payment of $50.
If you made $20,000 gross revenue in a quarter, the first $3000 of that is royalty free, so you have $17,000 of royalty-bearing gross revenue. Royalty is 5%, so in that quarter, you would owe a royalty payment of $850.
If you made $30,000 gross revenue in a quarter, the first $3000 of that is royalty free, so you have $27,000 of royalty-bearing gross revenue. Royalty is 5%, so in that quarter, you would owe a royalty payment of $1350.
Royalty payments are calculated on a quarter-by-quarter basis. I.e., revenue and payments in one quarter have no effect on the other quarters.