matt,
your idea is not bad, but if the motor once has started, it keeps on running, and you can't change the target counter intermediately...
and having this on a remote brick (via BT) you can send the encoder target to the slave and the slave itself controls the actions just by his own - no more checks or value transfers back and forth are necessary! :)
Absolute position reglation in firmware
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Absolute position reglation in firmware
No, that is one of the HUGE advantages of this new feature, you CAN change the target at any time, and as often as you want. I use it in a control loop for a steering mechanism for an RC car.
I know you can send the target position to slave using BT, but I want to be able to do it with RS-485, and standard FW doesn't allow for that.
The point of my if statement as follows:is to detect if the motor is near the target position (to detect if it has completed it's assignment).
I know you can send the target position to slave using BT, but I want to be able to do it with RS-485, and standard FW doesn't allow for that.
The point of my if statement as follows:
Code: Select all
if( MotorTachoCount (OUT_A)>=(TargetPosition-Threshold) && MotorTachoCount (OUT_A)<=(TargetPosition+Threshold) )
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: Absolute position reglation in firmware
Yes, I see my firmware more like an experimental development firmware.mattallen37 wrote:That is good, but wouldn't it be better for John to add your single function to his tried and proven FW, than for you to add his countless modifications to your single one? I need RS-485 support, as well as the math (bitwise operators, sin, and cosin), among other things.
OK, this is part of the solution.mattallen37 wrote:Well, I understand, but if it must be EXACTLY on the position, what difference will there be in making another function? I would just use a range to find out if it is at the right place. Something like the following:schodet wrote:This can be done, but it is not always sufficient. The motor can be off by one or two degree depending on how well your PID coefficients are tuned.It will check the position compared to the target position, + or - the threshold. Basically, if the target was 180, and the threshold was 5, the "if" statement would be true if the MotorTachoCount was in the range of 175-185.Code: Select all
if( MotorTachoCount (OUT_A)>=(TargetPosition-Threshold) && MotorTachoCount (OUT_A)<=(TargetPosition+Threshold) )
But I have other ideas too. In our APBTeam robot we simply check that the regulated position matches the desired position; if this is true, we consider the movement is finished. Combined with a blocking detection, this works really well, but it is only applicable with speed limitation.
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
Re: Absolute position reglation in firmware
Matt, have you seen any regression in other regulation methods?
Thanks for testing!
Thanks for testing!
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: Absolute position reglation in firmware
I am not exactly sure what you mean. This is the only motor position controller that I have been able to use that works for what I want. No other has allowed me to update the desired position on-the-fly, or been anywhere near this stable (no overshooting and resonating and all that).schodet wrote:Matt, have you seen any regression in other regulation methods?
Thanks for testing!
I do not understand PID stuff to make my own controller, so this is really awesome for me. I have been wanting something like this now for about a year now.
Edit: Oh, and you're welcome for "testing" it. It is so cool, I have built two robots already, just to "test" it (one of them is a robotic arm with 5 motors, two NXT... about 80cm tall).
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: Absolute position reglation in firmware
Whaou! Thanksmattallen37 wrote:I am not exactly sure what you mean. This is the only motor position controller that I have been able to use that works for what I want. No other has allowed me to update the desired position on-the-fly, or been anywhere near this stable (no overshooting and resonating and all that).
I do not understand PID stuff to make my own controller, so this is really awesome for me. I have been wanting something like this now for about a year now.
Edit: Oh, and you're welcome for "testing" it. It is so cool, I have built two robots already, just to "test" it (one of them is a robotic arm with 5 motors, two NXT... about 80cm tall).
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
Who is online
Users browsing this forum: No registered users and 0 guests